LyoqDQogKiBAZmlsZSByZWdpc3QuYw0KICogQGJyaWVmIEltcGxlbWVudGF0aW9uIG9mIHJlZ2lzdC5jLg0KICoNCiAqIENvcHlyaWdodCAoQykgMjAyMiBTYW5lY2hpcHMgVGVjaG5vbG9neSBDby4sIEx0ZC4NCiAqIEBhdXRob3IgDQogKiANCiAqIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5DQogKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMiBhcw0KICogcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24uIKOosdjRoaO6R1BMdjIgTGljZW5jZaOpDQogKg0KICovDQogDQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKiAJCQkJICAgIAkJICBJbmNsdWRlIGhlYWRlciBmaWxlcwkJCQkJCQkgICAqDQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2luY2x1ZGUgPHN0cmluZy5oPg0KI2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPHB0aHJlYWQuaD4NCiNpbmNsdWRlIDxhc3NlcnQuaD4NCiNpbmNsdWRlIDxzeXMvaXBjLmg+DQoNCiNpbmNsdWRlICJhdHJlZ19jb21tb24uaCINCiNpbmNsdWRlICJtZXNzYWdlLmgiDQojaW5jbHVkZSAic29mdGFwX2xvZy5oIg0KI2luY2x1ZGUgImF0cmVnX21zZy5oIg0KDQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWFjcm8gZGVmaW5pdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKg0KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoNCg0KLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCiAqIAkJCQkJCSAgICAgICBUeXBlIGRlZmluaXRpb25zCQkJCQkgICAgICAgICAgIAkgICAqDQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCg0KDQovKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICogCQkJCQkgICAgICBMb2NhbCB2YXJpYWJsZSBkZWZpbml0aW9ucwkJCQkJCSAgICoNCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KLyoqIEFUyc/Pws7Es/XKvLuvserWviAqLw0KaW50IGF0cmVnX3Nlcl9jeHRfaXNfaW5pdCA9IDA7DQppbnQgYXRyZWdfaW5mb19jeHRfaXNfaW5pdCA9IDA7DQoNCi8qKiBsb2dsZXZlbLP1yry7r7Hq1r4gKi8NCnN0YXRpYyBpbnQgbG9nbGV2ZWxfaXNfaW5pdCA9IDA7DQoNCi8qKiC5q7mysr+31rP1yry7r7Hq1r4gKi8NCnN0YXRpYyBpbnQgY29tbW9uX2lzX2luaXQgPSAwOw0KDQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKgkJCQkJCSAgR2xvYmFsIHZhcmlhYmxlIGRlZmluaXRpb25zCQkJCQkJICAgKg0KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoNCg0KLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCiAqIAkJCQkJICAgICBMb2NhbCBmdW5jdGlvbiBkZWNsYXJhdGlvbnMgCQkgICAgIAkJCSAgICoNCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KDQoNCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQogKiAJCQkJICAgICAgICBMb2NhbCBmdW5jdGlvbiBpbXBsZW1lbnRhdGlvbnMJCSAgIAkJCQkgICAqDQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCi8qKg0KICogQGJyaWVmICAgICAgILP1yry7r3NlciBBVMnPz8LOxDogYXRyZWdfc2VyX2N0eA0KICogQHBhcmFtICAgICAgIM7eDQogKiBAcmV0dXJuICAgICAgzt4NCiAqIEBub3RlICAgICAgICDO3g0KICogQHdhcm5pbmcgICAgIM7eDQogKi8NCnN0YXRpYyB2b2lkIGF0cmVnX3Nlcl9pbml0X3Byb2MoKQ0Kew0KCWlmKDAgPT0gYXRyZWdfc2VyX2N4dF9pc19pbml0KSB7CQ0KCQltZW1zZXQoJmF0cmVnX3Nlcl9jdHgsIDAsIHNpemVvZihhdHJlZ19zZXJfY3R4KSk7DQoJICAgIG1lbXNldChh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