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dHJhY2UuaCIKKyNpZmRlZiBDT05GSUdfQU5EUk9JRF9CSU5ERVJfUlBDCisjaW5jbHVkZSA8bGludXgvbW0uaD4KKyNpbmNsdWRlIDxsaW51eC9tbWFuLmg+CisjaW5jbHVkZSA8YXNtLWdlbmVyaWMvbW1hbi1jb21tb24uaD4KKworI2luY2x1ZGUgImJpbmRlcl9ycGMuaCIKKyNlbmRpZgogCiBzdGF0aWMgREVGSU5FX01VVEVYKGJpbmRlcl9tYWluX2xvY2spOwogc3RhdGljIERFRklORV9NVVRFWChiaW5kZXJfZGVmZXJyZWRfbG9jayk7CkBAIC01MSw3ICs1OCwzOCBAQAogc3RhdGljIHVpZF90IGJpbmRlcl9jb250ZXh0X21ncl91aWQgPSAtMTsKIHN0YXRpYyBpbnQgYmluZGVyX2xhc3RfaWQ7CiBzdGF0aWMgc3RydWN0IHdvcmtxdWV1ZV9zdHJ1Y3QgKmJpbmRlcl9kZWZlcnJlZF93b3JrcXVldWU7CisjaWZkZWYgQ09ORklHX0FORFJPSURfQklOREVSX1JQQworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgIEJJTkRFUiBSUEMgREVGSU5FIFNUQVJUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgQklOREVSX1JQQ19JR05PUkVfUFJJViAgKDB4RkZGRkZGRkYpCitzdHJ1Y3QgYmluZGVyX3RyYW5zYWN0aW9uOworc3RydWN0IGJpbmRlcl9wcm9jOworc3RydWN0IGJpbmRlcl90aHJlYWQ7CiAKK3N0cnVjdCBiaW5kZXJfdHJhbnNhY3Rpb25fZW50cnkgeworCXN0cnVjdCBsaXN0X2hlYWQgbGlzdDsKKwlzdHJ1Y3QgYmluZGVyX3RyYW5zYWN0aW9uICp0OworfTsKK3N0cnVjdCBiaW5kZXJf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AQCAtMzIwNiw2ICszNDkyLDg1NCBAQAogCX0KIAltdXRleF91bmxvY2soJmJpbmRlcl9kZWZlcnJlZF9sb2NrKTsKIH0KKyNpZmRlZiBDT05GSUdfQU5EUk9JRF9CSU5ERVJfUlBDCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgQklOREVSIFJQQyBBUEkgU1RBUlQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBiaW5kZXJfaW5pdF9ycGMoc3RydWN0IGJpbmRlcl9wcm9jICpvd25fcHJvYykKK3sKKwlzdHJ1Y3QgYmluZGVyX3Byb2MgKnByb2M7CisJdW5zaWduZWQgbG9uZyB1bnVzZWQ7CisJdW5zaWduZWQgbG9uZyBtbWFwX2Jhc2U7CisJdW5zaWduZWQgbG9uZyBtbWFwX3NpemU7CisKKwlzdHJ1Y3QgZmlsZSAqcGZpbGUgPSBmaWxwX29wZW4oIi9kZXYvYmluZGVyIixPX1JEV1IsMCk7CisJCisJaWYoTlVMTCA9PSBwZmlsZSkgeworCQliaW5kZXJfdXNlcl9lcnJvcigiJXM6IGZpbHBfb3BlbiBmYWlsLlxuIiwgX19mdW5jX18pOworCQlyZXR1cm4gLTE7CisJfQorCXByb2MgPSBwZmlsZS0+cHJpdmF0ZV9kYXRhOworCisJbW1hcF9zaXplID0gMTYqUEFHRV9TSVpFOworCW1tYXBfYmFzZSA9IGRvX21tYXAocGZpbGUsIDAsIG1tYXBfc2l6ZSwKKwkJCQkgICAgICAgUFJPVF9SRUFELAorCQkJCSAgICAgICBNQVBfUFJJVkFURSB8IE1BUF9OT1JFU0VSVkUsIDApOworCQorCXJwY19wcm9jID0gcHJvYzsKKwlycGNfb3duX3Byb2MgPSBvd25fcHJvYzsKKwlyZXR1cm4gYmluZGVyX3JwY19pbml0K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