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bHVkZSA8c3RyaW5nLmg+DQorI2luY2x1ZGUgPHN0ZGxpYi5oPg0KKw0KKyNpbmNsdWRlICJhdHJlZ19jb21tb24uaCINCisjaW5jbHVkZSAiYXRfdXRpbHMuaCINCisNCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqIAkJCQkJCSAgICAJTWFjcm8gZGVmaW5pdGlvbnMJCQkJCQkJICAgKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwkgDQorDQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAJCQkJCQkgICAgICAgCVR5cGUgZGVmaW5pdGlvbnMJCQkJCQkJICAgKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KKw0KKyANCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqIAkJCQkJICAgICAgIExvY2FsIHZhcmlhYmxlIGRlZmluaXRpb25zCQkJCQkJICAgKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KKyANCisgDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAJCQkJCSAgICAgICBHbG9iYWwgdmFyaWFibGUgZGVmaW5pdGlvbnMJCQkJCSAgICAgICAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorIA0KK3N0cnVjdCBhdHJlZ19zZXJfY29udGV4dF90IGF0cmVnX3Nlcl9jdHg7DQorc3RydWN0IGF0cmVnX2luZm9fY29udGV4dF90IGF0cmVnX2luZm9fY3R4Ow0KK3N0cnVjdCBhdHJlZ19jb21tb25fY29udGV4dF90IGF0cmVnX2NvbW1vbl9jdHg7DQorDQorLyoqIHNlciAtILavzKxpZLPYLAm3ts6nOiAwfjUxMSAqLw0KK3Vuc2lnbmVkIGNoYXIgYXRyZWdfc2VyX2R5bmFtaWNfaWRwb29sW0FUUkVHX1NFUl9JRF9NQVhdOw0KKy8qKiBpbmZvIC0gtq/MrGlks9gsCbe2zqc6IDUxMn43NjggKi8NCit1bnNpZ25lZCBjaGFyIGF0cmVnX2luZm9fZHluYW1pY19pZHBvb2xbQVRSRUdfSU5GT19JRF9NQVhdOw0KKw0KK2V4dGVybiBpbnQgYXRyZWdfc2VyX2N4dF9pc19pbml0Ow0KK2V4dGVybiBpbnQgYXRyZWdfaW5mb19jeHRfaXNfaW5pdDsNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqIAkJCQkgICAgICAgICAgIExvY2FsIGZ1bmN0aW9uIGRlY2xhcmF0aW9ucwkJCQkJCSAgICoNCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisgDQorIA0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogCQkJCQkgICAgICBMb2NhbCBmdW5jdGlvbiBpbXBsZW1lbnRhdGlvbnMgCQkJCQkgICAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKio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DQorCQl9DQorICAgIH0NCisgICAgcHRocmVhZF9tdXRleF91bmxvY2soJmF0cmVnX3Nlcl9jdHguYXRfc2VyX2xvY2tfdG1wKTsNCisJDQorICAgIHJldHVybiBOVUxMOw0KK30NCisNCisNCitzdGF0aWMgdm9pZCAqYXRyZWdfaW5mb19zZWFyY2hfaW5zdGFuY2VfdG1wX2J5X3JlcWlkX3Byb2MoaW50IHJlcV9tc2dfaWQpDQorew0KKwlzdHJ1Y3QgYXRyZWdfaW5mb19pbnN0YW5jZV90ICplbnRyeSA9IE5VTEw7DQorCQ0KKyAgICBwdGhyZWFkX211dGV4X2xvY2soJmF0cmVnX2luZm9fY3R4LmF0X2luZm9fbG9ja190bXApOw0KKwlsaXN0X2Zvcl9lYWNoX2VudHJ5KGVudHJ5LCAmYXRyZWdfaW5mb19jdHguYXRfaW5mb19saXN0X3RtcCwgbGlzdCkgew0KKyAgICAgICAgaWYoZW50cnktPnJlcV9tc2dfaWQgPT0gcmVxX21zZ19pZCkgew0KKwkJICAgIHB0aHJlYWRfbXV0ZXhfdW5sb2NrKCZhdHJlZ19pbmZvX2N0eC5hdF9pbmZvX2xvY2tfdG1wKTsNCisJCQkNCisJCQlyZXR1cm4gKHZvaWQgKillbnRyeTsNCisJCX0NCisgICAgfQ0KKyAgICBwdGhyZWFkX211dGV4X3VubG9jaygmYXRyZWdfaW5mb19jdHguYXRfaW5mb19sb2NrX3RtcCk7DQorCQ0KKyAgICByZXR1cm4gTlVMTDsNCit9DQorDQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAJCQkJICAgICAgIAkgIEdsb2JhbCBmdW5jdGlvbiBpbXBsZW1lbnRhdGlvbnMJCQkJCSAgICoNCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCit2b2lk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