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cmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuCisgKgorICovCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+CisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+CisjaW5jbHVkZSA8bGludXgvc2NoZWQuaD4KKyNpbmNsdWRlIDxsaW51eC9qaWZmaWVzLmg+CisjaW5jbHVkZSA8bGludXgvc2xhYi5oPgorI2luY2x1ZGUgPGxpbnV4L3RpbWVyLmg+CisjaW5jbHVkZSA8bGludXgvZGVsYXkuaD4KKyNpbmNsdWRlIDxsaW51eC9rdGhyZWFkLmg+CisjaW5jbHVkZSA8bWFjaC9pb21hcC5oPgorCisjaWZuZGVmIENPTkZJR19TWVNURU1fQ0FQCisjaW5jbHVkZSA8bGludXgvcHJvY19mcy5oPgorI2luY2x1ZGUgPGxpbnV4L3N0cmluZy5oPgorI2luY2x1ZGUgPGxpbnV4L3NlcV9maWxlLmg+CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILrqtqjS5SAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIGRlZmluZWQoX09TX1RPUykKKyMgZGVmaW5lIE9TX1NUQVRJU1RJQ19JUkFNX0JBU0UgICAgKElSQU1fQkFTRV9BRERSX09TX1NUQVRJU1RJQ19QU0NQVSkKKyMgZGVmaW5lIE9TX1NUQVRJU1RJQ19USU1FICAgICAgICAgekRydlRpbWVyX1N0YW1wKCkKKyNlbGlmIGRlZmluZWQoX09TX0xJTlVYKQorIyBkZWZpbmUgT1NfU1RBVElTVElDX0lSQU1fQkFTRSAgICBnX3p4aWNfdHJhY2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lSQU1fU09GVElSUV9FTkQgICAgICAgIChPU19JUkFNX1NPRlRJUlFfU1RBUlQgKyBzaXplb2YodF9vc19pcmFtX3N0YXRpc3RpYykpCisjZGVmaW5lIE9TX0lSQU1fVElNRVJfU1RBUlQgICAgICAgIChPU19JUkFNX1NPRlRJUlFfRU5EICsgc2l6ZW9mKHRfb3NfaXJhbV9zdGF0aXN0aWMpKQorI2RlZmluZSBPU19JUkFNX1RJTUVSX0VORCAgICAgICAgICAoT1NfSVJBTV9USU1FUl9TVEFSVCArIHNpemVvZih0X29zX2lyYW1fc3RhdGlzdGljKSkKKyNlbmRpZgorCisjZGVmaW5lIG9zX3N0YXRpc3RpY19jaGVjaygpICAgICAgICooKHZvbGF0aWxlIHVuc2lnbmVkIGxvbmcgKilPU19TVEFUSVNUSUNfSVJBTV9CQVNFKQorI2RlZmluZSBvc19zdGF0aXN0aWNfZW5hYmxlZCgpICAgICBnX29zX3N0YXRpc3RpY19lbmFibGUgCisKKyNpZm5kZWYgQ09ORklHX1NZU1RFTV9DQVAKKyNkZWZpbmUgS0VSTkVMX0wxV19JUkFNX0xPR19EUk9QICAgKElSQU1fQkFTRV9BRERSX0xPR19EUk9QX1RSQUNFKQorI2RlZmluZSBLRVJORUxfTDFsX0lSQU1fTE9HX0RST1AgICAoS0VSTkVMX0wxV19JUkFNX0xPR19EUk9QICsgc2l6ZW9mKFRfTG9nSXJhbV9SZWNvcmQpKQorI2VuZGlmCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyv2+3b3hubm2qNLlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit0eXBlZGVmIHZvbGF0aWxlIHN0cnVjdCB7CisgICAgdW5zaWduZWQgaW50IGVuYWJsZTsKKyAgICB1bnNpZ25lZCBpbnQgY250OworICAgIHVuc2lnbmVkIGludCBpbmRleDsKKyAgICBzdHJ1Y3QgeworICAgICAgICB1bnNpZ25lZCBjaGFyIG5hbWVbT1NfSVJBTV9TVEFUSVNUSUNfTkFNRV9MRU5dOworICAgICAgICB1bnNpZ25lZCBpbnQgZGF0YTI7CisgICAgfSBzdGF0aXN0aWNzW09TX0lSQU1fU1RBVElTVElDX0NOVF07Cit9dF9vc19pcmFtX3RocmVhZF9zdGF0aXN0aWM7CisKK3R5cGVkZWYgdm9sYXRpbGUgc3RydWN0IHsKKyAgICB1bnNpZ25lZCBpbnQgY250OworICAgIHVuc2lnbmVkIGludCBpbmRleDsKKyAgICBzdHJ1Y3QgeworICAgICAgICB1bnNpZ25lZCBpbnQgZGF0YTE7CisgICAgICAgIHVuc2lnbmVkIGludCBkYXRhMjsKKyAgICB9IHN0YXRpc3RpY3NbT1NfSVJBTV9TVEFUSVNUSUNfQ05UXTsKK310X29zX2lyYW1fc3RhdGlzdGljOworCit0eXBlZGVmIHN0cnVjdCB7CisgICAgdW5zaWduZWQgaW50IGNudDsKKyAgICB1bnNpZ25lZCBpbnQgaW5kZXg7CisgICAgc3RydWN0IHsKKyAgICAgICAgdW5zaWduZWQgaW50IGRhdGExOworICAgICAgICB1bnNpZ25lZCBpbnQgZGF0YTI7CisgICAgfSBzdGF0aXN0aWNzW09TX0REUl9TVEFUSVNUSUNfQ05UXTsKK310X29zX2Rkcl9zdGF0aXN0aWM7CisKKyNpZm5kZWYgQ09ORklHX1NZU1RFTV9DQVAKK3R5cGVkZWYgc3RydWN0IAoreworCXVuc2lnbmVkIGludCBub19sb2NrOworCXVuc2lnbmVkIGludCBub19tZW07Cit9VF9Mb2dJcmFtX1JlY29yZDsKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyKu+1rHkwb8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgZGVmaW5lZChfT1NfTElOVVgpCitzdGF0aWMgY2hhciAqZ196eGljX3RyYWNlX2FwY3B1X2FkZHI7CisjZW5kaWYKKworc3RhdGljIGludCBnX29zX3N0YXRpc3RpY19lbmFibGU7CitzdGF0aWMgdW5zaWduZWQgaW50IGdfb3Nfc3RhdGlzdGljX2NudDsKKworc3RhdGljIHRfb3NfaXJhbV90aHJlYWRfc3RhdGlzdGljICpnX29zX2lyYW1fc3dhcGluX3N0YXRpc3RpYzsKK3N0YXRpYyB0X29zX2lyYW1fc3RhdGlzdGljICpnX29zX2lyYW1faXJxX3N0YXJ0X3N0YXRpc3RpYzsKK3N0YXRpYyB0X29zX2lyYW1fc3RhdGlzdGljICpnX29zX2lyYW1faXJxX2VuZF9zdGF0aXN0aWM7CisKKyNpZiBkZWZpbmVkKF9PU19UT1MpCitzdGF0aWMgdF9vc19pcmFtX3N0YXRpc3RpYyAqZ19vc19pcmFtX2Rzcl9zdGFydF9zdGF0aXN0aWM7CitzdGF0aWMgdF9vc19pcmFtX3N0YXRpc3RpYyAqZ19vc19pcmFtX2Rzcl9lbmRfc3RhdGlzdGljOworI2VsaWYgZGVmaW5lZChfT1NfTElOVVgpCitzdGF0aWMgdF9vc19pcmFtX3N0YXRpc3RpYyAqZ19vc19pcmFtX3NvZnRpcnFfc3RhcnRfc3RhdGlzdGljOworc3RhdGljIHRfb3NfaXJhbV9zdGF0aXN0aWMgKmdfb3NfaXJhbV9zb2Z0aXJxX2VuZF9zdGF0aXN0aWM7CitzdGF0aWMgdF9vc19pcmFtX3N0YXRpc3RpYyAqZ19vc19pcmFtX3RpbWVyX3N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V9SZWNvcmQgKmdMMTFfTG9nTWlzc1BvaW50ID0gKFRfTG9nSXJhbV9SZWNvcmQgKilLRVJORUxfTDFsX0lSQU1fTE9HX0RST1A7CisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMirvta6r8r9yfnD9yAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBvc19zdGF0aXN0aWNfZW5hYmxlKHZvaWQpOworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIL7Wsr+6r8r9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICC57LyjzbO8xrW9SVJBTQorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIGlyYW1fYWRkcjogtdjWtyAKKyAgICAgICAgICAgICAgICBkYXRhOiAgICAgIMrCvP7P7gorICAgICAgICAgICAgICAgIHRpbWU6ICAgICAgyrG85AorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICB2b2lkCisqIMbky/zLtcP3OiAgICAgzt4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW5saW5lIHZvaWQgb3Nfc3RhdGlzdGljX2luX2lyYW0odm9sYXRpbGUgdm9pZCAqaXJhbV9hZGRyLCB2b2lkICpkYXRhLCB1bnNpZ25lZCBsb25nIHRpbWUpCit7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICBpbmRleDsKKyAgICB0X29zX2lyYW1fc3RhdGlzdGljICppcmFtOworCisgICAgaXJhbSA9ICh0X29zX2lyYW1fc3RhdGlzdGljICopaXJhbV9hZGRyOworICAgIAorICAgIGluZGV4ID0gaXJhbS0+aW5kZXg7CisgICAgaWYoaW5kZXggPj0gT1NfSVJBTV9TVEFUSVNUSUNfQ05UKQorICAgIHsKKyAgICAgICAgaW5kZXggPSAwOworICAgIH0KKworICAgIGlyYW0tPnN0YXRpc3RpY3NbaW5kZXhdLmRhdGExID0gKHVuc2lnbmVkIGludClkYXRhOworICAgIGlyYW0tPnN0YXRpc3RpY3NbaW5kZXhdLmRhdGEyID0gdGltZTsKKyAgICBpbmRleCsrOworCisgICAgaXJhbS0+aW5kZXggPSBpbmRleDsKKyAgICBpcmFtLT5jbnQgPSBnX29zX3N0YXRpc3RpY19jbnQ7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgz9+zzLnsvKPNs7zGtb1JUkFNCisqILLOyv3LtcP3OiAgICAgCisqICAgKLSryOuyzsr9KSAgaXJhbV9hZGRyOiC12Na3IAorICAgICAgICAgICAgICAgIGRhdGE6ICAgICAgysK8/s/uCisgICAgICAgICAgICAgICAgdGltZTogICAgICDKsbzkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICDO3gorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyBpbmxpbmUgdm9pZCBvc19zdGF0aXN0aWNfdGhyZWFkX2luX2lyYW0odm9sYXRpbGUgdm9pZCAqaXJhbV9hZGRyLCB2b2lkICpkYXRhLCB1bnNpZ25lZCBsb25nIHRpbWUpCit7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgaW5kZXg7CisgICAgdF9vc19pcmFtX3RocmVhZF9zdGF0aXN0aWMgKmlyYW07CisKKyAgICBpcmFtID0gKHRfb3NfaXJhbV90aHJlYWRfc3RhdGlzdGljICopaXJhbV9hZGRyOworICAgIAorICAgIGluZGV4ID0gaXJhbS0+aW5kZXg7CisgICAgaWYoaW5kZXggPj0gT1NfSVJBTV9TVEFUSVNUSUNfQ05UKQorICAgIHsKKyAgICAgICAgaW5kZXggPSAwOworICAgIH0KKworICAgICNpZiBkZWZpbmVkKF9PU19UT1MpCisgICAgc3RybmNweSgoY2hhciAqKShpcmFtLT5zdGF0aXN0aWNzW2luZGV4XS5uYW1lKSwgY3lnX3RocmVhZF9nZXRfbmFtZSgoY3lnX2hhbmRsZV90KWRhdGEpLCBPU19JUkFNX1NUQVRJU1RJQ19OQU1FX0xFTiAtIDEpOworICAgICNlbGlmIGRlZmluZWQoX09TX0xJTlVYKQorICAgIHN0cm5jcHkoKGNoYXIgKikoaXJhbS0+c3RhdGlzdGljc1tpbmRleF0ubmFtZSksICgoc3RydWN0IHRhc2tfc3RydWN0ICopZGF0YSktPmNvbW0sIE9TX0lSQU1fU1RBVElTVElDX05BTUVfTEVOIC0gMSk7CisgICAgI2Vsc2UKKyAgICAjIGVycm9yICJ1bmtvd24gb3MiCisgICAgI2VuZGlmCisgICAgaXJhbS0+c3RhdGlzdGljc1tpbmRleF0ubmFtZVtPU19JUkFNX1NUQVRJU1RJQ19OQU1FX0xFTiAtIDFdID0gMDsKKyAgICBpcmFtLT5zdGF0aXN0aWNzW2luZGV4XS5kYXRhMiA9IHRpbWU7CisgICAgaW5kZXgrKzsKKworICAgIGlyYW0tPmluZGV4ID0gaW5kZXg7CisgICAgaXJhbS0+Y250ID0gZ19vc19zdGF0aXN0aWNfY250OworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgILnsvKPNs7zGtb1ERFIKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICBpcmFtX2FkZHI6ILXY1rcgCisgICAgICAgICAgICAgICAgZGF0YTogICAgICDKwrz+z+4KKyAgICAgICAgICAgICAgICB0aW1lOiAgICAgIMqxvOQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIM7eCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGlubGluZSB2b2lkIG9zX3N0YXRpc3RpY19pbl9kZHIodm9pZCAqZGRyX2FkZHIsIHZvaWQgKmRhdGEsIHVuc2lnbmVkIGxvbmcgdGltZSkKK3sKKyAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICAgICBpbmRleDsKKyAgICB0X29zX2Rkcl9zdGF0aXN0aWMgICAgICAgICAqZGRyOworCisgICAgZGRyICA9ICh0X29zX2Rkcl9zdGF0aXN0aWMgKilkZHJfYWRkcjsKKyAgICAKKyAgICBpbmRleCA9IGRkci0+aW5kZXg7CisgICAgaWYgKGluZGV4ID49IE9TX0REUl9TVEFUSVNUSUNfQ05UKQorICAgIHsKKyAgICAgICAgaW5kZXggPSAwOworICAgIH0KKyAgICBkZHItPnN0YXRpc3RpY3NbaW5kZXhdLmRhdGExID0gKHVuc2lnbmVkIGludClkYXRhOworICAgIGRkci0+c3RhdGlzdGljc1tpbmRleF0uZGF0YTIgPSB0aW1lOworICAgIGluZGV4Kys7CisKKyAgICBkZHItPmluZGV4ID0gaW5kZXg7CisgICAgZGRyLT5jbnQgPSBnX29zX3N0YXRpc3RpY19jbnQ7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAguey8o82zvMa1vUREUgorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIGlyYW1fYWRkcjogtdjWtyAKKyAgICAgICAgICAgICAgICBkYXRhOiAgICAgIMrCvP7P7gorICAgICAgICAgICAgICAgIHRpbWU6ICAgICAgyrG85AorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICB2b2lkCisqIMbky/zLtcP3OiAgICAgzt4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW5saW5lIHZvaWQgb3Nfc3RhdGlzdGljX2luZm9fdXBkYXRlKHZvaWQpCit7CisgICAgZ19vc19zdGF0aXN0aWNfY250Kys7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgtqjKscb3u9i197mz19MKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICAKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIM7eCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBvc19zdGF0aXN0aWNfZGVsYXllZF93b3JrX3RpbWVyX2ZuKHVuc2lnbmVkIGxvbmcgZGF0YSkKK3sKKwlpbnQgc2VjID0gMDsKKwltc2xlZXAoMjAwMDApOworICAgIHdoaWxlKCFvc19zdGF0aXN0aWNfY2hlY2soKSkKKwl7CisJCS8vs6y5/TQwc6Os1rG9083Ls/YKKwkJaWYoc2VjID49IDQpCisJCQlyZXR1cm47CisJCW1zbGVlcCgxMDAwMCk7CisJCXNlYysrOworCX0KKwlvc19zdGF0aXN0aWNfZW5hYmxlKCk7CisJcmV0dXJuIDA7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgyKu+1rqvyv3Ktc/WICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAguey8o82zvMaz9cq8u68KKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBwc7rLtffTwworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgb3Nfc3RhdGlzdGljX2luaXQodm9pZCkKK3sKKyAgICBtZW1zZXQoKHZvaWQgKilJUkFNX0JBU0VfQUREUl9MSU5VWF9TVEFUSVNUSUMsIDB4MCwgSVJBTV9CQVNFX0xFTl9MSU5VWF9TVEFUSVNUSUMpOworfQorRVhQT1JUX1NZTUJPTChvc19zdGF0aXN0aWNfaW5pdCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgyrnE3LnsvKPNs7zGuabE3AorKiCyzsr9y7XD9zogICAgIAorKiAgICi0q8jrss7K/SkgIGFkZHJlc3M6ILzHwry1vUlSQU3W0LXEtdjWtyAKKyAgICAgICAgICAgICAgICBzaXplOiAgICBJUkFNv9W85LTz0KEKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIM7eCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZCBvc19zdGF0aXN0aWNfZW5hYmxlKHZvaWQpCit7CisjaWYgZGVmaW5lZChfT1NfVE9TKQorICAgIGdfb3NfaXJhbV9zd2FwaW5fc3RhdGlzdGljICAgICAgICA9ICh0X29zX2lyYW1fdGhyZWFkX3N0YXRpc3RpYyAqKU9TX0lSQU1fVEhSRUFEX1NXQVBJTjsKKyAgICBnX29zX2lyYW1faXJxX3N0YXJ0X3N0YXRpc3RpYyAgICAgPSAodF9vc19pcmFtX3N0YXRpc3RpYyAqKU9TX0lSQU1fSVJRX1NUQVJUOworICAgIGdfb3NfaXJhbV9pcnFfZW5kX3N0YXRpc3RpYyAgICAgICA9ICh0X29zX2lyYW1fc3RhdGlzdGljICopT1NfSVJBTV9JUlFfRU5EOworICAgIGdfb3NfaXJhbV9kc3Jfc3RhcnRfc3RhdGlzdGljICAgICA9ICh0X29zX2lyYW1fc3RhdGlzdGljICopT1NfSVJBTV9EU1JfU1RBUlQ7CisgICAgZ19vc19pcmFtX2Rzcl9lbmRfc3RhdGlzdGljICAgICAgID0gKHRfb3NfaXJhbV9zdGF0aXN0aWMgKilPU19JUkFNX0RTUl9FTkQ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gKHRfb3NfZGRyX3N0YXRpc3RpYyAqKWttYWxsb2Moc2l6ZW9mKHRfb3NfZGRyX3N0YXRpc3RpYyksIEdGUF9LRVJORUwpOworICAgIGdfb3NfZGRyX3RpbWVyX3N0YXJ0X3N0YXRpc3RpYyAgICA9ICh0X29zX2Rkcl9zdGF0aXN0aWMgKilrbWFsbG9jKHNpemVvZih0X29zX2Rkcl9zdGF0aXN0aWMpLCBHRlBfS0VSTkVMKTsKKyAgICBnX29zX2Rkcl90aW1lcl9lbmRfc3RhdGlzdGljICAgICAgPSAodF9vc19kZHJfc3RhdGlzdGljICopa21hbGxvYyhzaXplb2YodF9vc19kZHJfc3RhdGlzdGljKSwgR0ZQX0tFUk5FTCk7CisKKyNlbHNlCisjIGVycm9yICJ1bmtvd24gb3MiCisjZW5kaWYKKworICAgIGdfb3Nfc3RhdGlzdGljX2VuYWJsZSA9IDE7Cit9CitFWFBPUlRfU1lNQk9MKG9zX3N0YXRpc3RpY19lbmFibGUpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgILnsvKPNs7zGyrnE3M2o1qoKKyogss7K/cu1w/c6ICAgICAKKyogICAotKvI67LOyv0pICB2b2lkCisqICAgKLSrs/ayzsr9KSAgdm9pZAorKiC3tSC72CDWtTogICAgIHZvaWQKKyogxuTL/Mu1w/c6ICAgICBwc7rLtffTwworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgb3Nfc3RhdGlzdGljX2VuYWJsZV9ub3RpZnkodm9pZCkKK3sKKyAgICAqKHZvbGF0aWxlIHVuc2lnbmVkIGxvbmcgKilJUkFNX0JBU0VfQUREUl9MSU5VWF9TVEFUSVNUSUNfUFNDUFUgID0gMTsKKyAgICAqKHZvbGF0aWxlIHVuc2l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gKiBAbTogcHJvYyBmaWxlIHN0cnVjdHVyZQorICogQHY6IAorICoKKyAqIFJldHVybnMgLWVycm5vLCBvciAwIGZvciBzdWNjZXNzLgorICovCitzdGF0aWMgaW50IGtlcm5lbF9sb2dfbWlzc19wb2ludF9zaG93KHN0cnVjdCBzZXFfZmlsZSAqbSwgdm9pZCAqdikKK3sKKwlpbnQgaW5kZXggCQkgCQk9IDA7CQorICAgIFRfTG9nSXJhbV9SZWNvcmQgKmlyYW0gID0gTlVMTDsKKworICAgIGlyYW0gPSAoVF9Mb2dJcmFtX1JlY29yZCAqKWdMMXdfTG9nTWlzc1BvaW50OworCWlmIChpcmFtKQorCQlwcmludGsoImtlcm5lbF9sb2dfbWlzc19wb2ludF9zaG93IGlyYW0gPSAleFxuIixpcmFtKTsKKwllbHNlCisJeworCQlwcmludGsoImlyYW0gaXMgTlVMTFxuIik7CisJCXJldHVybiAtMTsKKwl9CisKKyAgCXNlcV9wcmludGYobSwiTDFXIHBoeTogbG9nIG1pc3MgcG9pbnQgY291bnQgaXM6XG4iKTsKKworCWZvciAoOyBpbmRleCA8IDI7IGluZGV4KyspCQorCXsJCisJCWlmIChpbmRleCA9PSAxKQorCQkJc2VxX3ByaW50ZihtLCJMMWwgcGh5OiBsb2cgbWlzcyBwb2ludCBjb3VudCBpczpcbiIpOworCQkKKwkJaWYgKGlyYW0gIT0gTlVMTCkgCisJCXsKKwkJCXNlcV9wcmludGYobSwiMS4gRHVlIHRvIGFsbG9jTWVtIGZhaWwgIGNvdW50OiAldVxuIiwgaXJhbS0+bm9fbWVtKTsJCQkKKwkJCXNlcV9wcmludGYobSwiMi4gRHVlIHRvIG11bHRpIHRocmVhZCBjb25mbGljdCBjb3VudDogJXVcbiIsIGlyYW0tPm5vX2xvY2spOworCQl9CisgICAgCWlyYW0gPSAoVF9Mb2dJcmFtX1JlY29yZCAqKWdMMTFfTG9nTWlzc1BvaW50OworCX0KKworCXNlcV9wcmludGYobSwiZG9uZVxuIik7CisKKwly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vI67LOyv0pICBpcmFtX2FkZHI6ILXY1rcgCisgICAgICAgICAgICAgICAgZGF0YTogICAgICDKwrz+z+4KKyAgICAgICAgICAgICAgICB0aW1lOiAgICAgIMqxvOQKKyogICAotKuz9rLOyv0pICB2b2lkCisqILe1ILvYINa1OiAgICAgdm9pZAorKiDG5Mv8y7XD9zogICAgIM7eCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IF9faW5pdCB6eGljX2VuYWJsZV90cmFjZSh2b2lkKQoreworCXN0cnVjdCB0aW1lcl9saXN0IHRpbWVyOworCXN0cnVjdCB0YXNrX3N0cnVjdCAqdGFzazsKKworCSNpZmRlZiBJUkFNX0JBU0VfQUREUl9WQQorCWdfenhpY190cmFjZV9hcGNwdV9hZGRyID0gSVJBTV9CQVNFX0FERFJfTElOVVhfU1RBVElTVElDX0FQQ1BVOworCSNlbHNlCisKKwlnX3p4aWNfdHJhY2VfYXBjcHVfYWRkciA9IGlvcmVtYXAoSVJBTV9CQVNFX0FERFJfTElOVVhfU1RBVElTVElDX0FQQ1BVLCBJUkFNX0JBU0VfTEVOX0xJTlVYX1NUQVRJU1RJQ19BUENQVSk7CisJI2VuZGlmCisKKyNpZm5kZWYgQ09ORklHX1NZU1RFTV9DQVAKKwlwcm9jX2NyZWF0ZSgia2VybmVsX2xvZ190cmFja2VyIiwgMCwgTlVMTCwgJmtlcm5lbF9sb2dfdHJhY2tlcl9wcm9jX2ZvcHMpOworI2VuZGlmCisvKgorCWluaXRfdGltZXIoJnRpbWVyKTsKKwl0aW1lci5leHBpcmVzID0gamlmZmllcyArIDQwKkhaOy8vbXNlY3NfdG9famlmZmllcyg0MCoxMDAwKTsvL9HTs9k0MMPrCisJdGltZXIuZGF0YSA9IDA7CisJdGltZXIuZnVuY3Rpb24gPSBvc19zdGF0aXN0aWNfZGVsYXllZF93b3JrX3RpbWVyX2ZuOworCXNldHVwX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