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JlYXNtIFxuIik7CisKKyAgICAgICAgaWYgKHNrYi0+bmZjdF9yZWFzbSkgeworICAgICAgICAgICAgLy9wcmludGsoImZhc3Q2X2Z3IHJlYXNtXG4iKTsKICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAJLyogIGlmIChpcHY2X2hkcihza2IpLT5uZXh0aGRyICE9IElQUFJPVE9fVENQICYmIGlwdjZfaGRyKHNrYiktPm5leHRoZHIgIT0gSVBQUk9UT19VRFApewogICAgICAgICAvLyAgICBwcmludGsoIndyb25nIHByb3RvY29sIHY2ID0gJWRcbiIsIGlwdjZfaGRyKHNrYiktPm5leHRoZHIpOwogICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgIH0qLwotICAgICAgICAKKwogICAgICAgICBpZighZmFzdF9pcGhkcl9jaGVjayhza2IsIEVUSF9QX0lQVjYpKSAKICAgICAJewogCSAgICAJaXA2aGRyX2Vycl9udW0rKzsKZGlmZiAtLWdpdCBhL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L25ldC9jb3JlL2Zhc3Rwcm9jL2Zhc3RfdHJhY2suYyBiL2FwL29zL2xpbnV4L2xpbnV4LTMuNC54L25ldC9jb3JlL2Zhc3Rwcm9jL2Zhc3RfdHJhY2suYwppbmRleCBjMTE4NTI2Li41ZDU1NDI2IDEwMDc1NQotLS0gYS9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvY29yZS9mYXN0cHJvYy9mYXN0X3RyYWNrLmMKKysrIGIvYXAvb3MvbGludXgvbGludXgtMy40LngvbmV0L2NvcmUvZmFzdHByb2MvZmFzdF90cmFjay5jCkBAIC0xMTk2LDIwICsxMTk2LDYgQEAKIAkud3JpdGUgPSBza2JfZGVidWdfb2ZmX3NldCwNCiB9Ow0KIA0KLWV4dGVybiBpbnQgYnJfbXVsdGljYXN0X29mZjsNCi1zdGF0aWMgc3NpemVfdCBicl9tdWx0aWNhc3Rfb2ZmX3NldChzdHJ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b3MvbGludXgvbGludXgtMy40LngvbmV0L3NvY2tldF9ycG1zZy5jCm5ldyBmaWxlIG1vZGUgMTAwNzU1CmluZGV4IDAwMDAwMDAuLjg2N2I5NDMKLS0tIC9kZXYvbnVsbAorKysgYi9hcC9vcy9saW51eC9saW51eC0zLjQueC9uZXQvc29ja2V0X3JwbXNnLmMKQEAgLTAsMCArMSwyNjYyIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5jbHVkZSBoZWFkZXIgZmlsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisjaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+DQorI2luY2x1ZGUgPG5ldC9zb2NrLmg+DQorI2luY2x1ZGUgPG5ldC9hZl91bml4Lmg+DQorI2luY2x1ZGUgPGxpbnV4L3N5c2NhbGxzLmg+DQorI2luY2x1ZGUgPGxpbnV4L2ZpbGUuaD4NCisvLyNpbmNsdWRlICJyYW1fY29uZmlnLmgiDQorI2luY2x1ZGUgPGxpbnV4L3NvY2tldF9ycG1zZy5oPg0KKw0KKyNkZWZpbmUgU09DS19EQVRBX0FMSUdOKFgpCUFMSUdOKFgsIFNNUF9DQUNIRV9CWVRFUykNCisjZGVmaW5lIFNPQ0tfREFUQV9NQVhfTEVOIDgqMTAyNA0KKyNkZWZpbmUgIElDUF9DSE5fU09DS0VUIDMyDQorI2RlZmluZSBzb2NrX2luaXRfc2VtYSBzZW1hX2luaXQNCisjZGVmaW5lIHNvY2tfZ2V0X3NlbWEgZG93bl9pbnRlcnJ1cHRpYmxlDQorI2RlZmluZSBzb2NrX3B1dF9zZW1hIHVwDQorDQorc3RydWN0IHNvY2tfY2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