I2lmbmRlZiBDT05GSUdfTUlOXzhNX1ZFUlNJT04KI2luY2x1ZGUgImV4dF9zb2NrZXRfZnVuYy5oIgojaW5jbHVkZSAiY2ZnX252X2RlZi5oIgojaW5jbHVkZSAiYXRfY29udGV4dC5oIgojaW5jbHVkZSAia3dhdGNoX21zZy5oIgoKaW50IG5ldGNvbl9leHRjaWQgPSAtMTsKY2hhciBuZXRjb25fY29uZmlnbmFtZVsxMF0gPSB7MH07CmludCBuZXRjb25fdmFsdWVfaW50ID0gMDsKY2hhciBuZXRjb25fdmFsdWVfY2hhcls3MF0gPSB7MH07CmV4dGVybiBjaGFyKiBub3JtYWxfZ2V0enZlcnNpb24oKTsKaW50IHVyY3N5c2luZm8gPSAwOwp0eXBlZGVmIHN0cnVjdCB7CglpbnQgbW9kZTsKCWludCBjcmVnOwoJaW50IGNncmVnOwoJaW50IGNlcmVnOwp9IEVYVF9ORVRTVEFURV9JTkZPOwpFWFRfTkVUU1RBVEVfSU5GTyB1cmNpbmZvID0gezB9OwovLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ly8KLy+5+rXnc29ja2V0t72wuLqvyv3Ktc/Wx/gKLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PS8vCnN0YXRpYyBpbnQgZ3NtYmFuZCA9IDA7CgpzdGF0aWMgdm9pZCBjb21tX3JzcG1zZ19wcm9jKHZvaWQgKnJzcF9tc2csIHZvaWQqKnJldCwgaW50ICpyZXRsZW4pCnsKCUFUX0NPTU1fUlNQTVNHICptc2cgPSAoQVRfQ09NTV9SU1BNU0cqKXJzcF9tc2c7CgljaGFyICphdF9zdHIgPSBOVUxMOwoJaW50IG9mZnNldCA9IDA7CgoJaWYgKG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RheSwmc2V0X3RtLnRtX2hvdXIsJnNldF90bS50bV9taW4sJnNldF90bS50bV9zZWMpOwoJYXRfcHJpbnQoMSwiZXh0X3RpbWVfc2V0X2Z1bmM6ICUyZC8lMmQvJTJkLCUyZDolMmQ6JTJkXG4iLHNldF90bS50bV95ZWFyLAoJCXNldF90bS50bV9tb24sc2V0X3RtLnRtX21kYXksc2V0X3RtLnRtX2hvdXIsc2V0X3RtLnRtX21pbixzZXRfdG0udG1fc2VjKTsKCiNpZiAxICAgLy8ga3cgMwogICAgaWYoc2V0X3RtLnRtX3llYXIgPCAwIHx8IHNldF90bS50bV95ZWFyID4gNTAwMCkKICAgIHsKICAgICAgICBzZXRfdG0udG1feWVhciA9IDE5NzA7CiAgICB9CgogICAgaWYoc2V0X3RtLnRtX21vbiA8IDAgfHwgc2V0X3RtLnRtX21vbiA+IDEzKQogICAgewogICAgICAgIHNldF90bS50bV9tb24gPSAxOwogICAgfQojZW5kaWYKCXNldF90bS50bV95ZWFyID0gc2V0X3RtLnRtX3llYXIgKyAxMDA7CglzZXRfdG0udG1fbW9uID0gc2V0X3RtLnRtX21vbiAtIDE7CQoKCXRpbWVfdHYudHZfc2VjID0gbWt0aW1lKCZzZXRfdG0pOwogICAgaWYodGltZV90di50dl9zZWMgPCAwKS8vIGNvdiBNCiAgICB7CiAgICAgICAgdGltZV90di50dl9zZWMgPSAwOwogICAgfQogICAgCi8vCXRpbWVfdHYudHZfc2VjID0gdGltZV90di50dl9zZWM7ICAvLyBjb3YgTQoJc3RydWN0IHRtICogbmV3X3RpbWUgPSBnbXRpbWUoJnRpbWVfdHYudHZfc2VjKTsKCWlmKG5ld190aW1lKQoJCXRpbWVfdHoudHpfbWludXRlc3dlc3QgPSAobWt0aW1lKG5ld190aW1lKSAtICh0aW1lX3R2LnR2X3NlYykpIC8gNjA7CgkKCWlmICgwICE9IHNldHRpbWVvZmRheSgmdGltZV90diwmdGltZV90eikpCgl7CgkJYXRfcHJpbnQoQVRfRVJSLCJ6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