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CisjZGVmaW5lIFNJUzU1OTVfUkVHX0FMQVJNMiAweDQyCisjZGVmaW5lIFNJUzU1OTVfUkVHX0ZBTkRJViAweDQ3CisKKy8qIENvbnZlcnNpb25zLiBMaW1pdCBjaGVja2luZyBpcyBvbmx5IGRvbmUgb24gdGhlIFRPX1JFRworICAgdmFyaWFudHMuICovCisKKy8qIElOOiBtViwgKDBWIHRvIDQuMDhWKQorICAgUkVHOiAxNm1WL2JpdCAqLworc3RhdGljIGlubGluZSB1OCBJTl9UT19SRUcodW5zaWduZWQgbG9uZyB2YWwpCit7CisJdW5zaWduZWQgbG9uZyBudmFsID0gU0VOU09SU19MSU1JVCh2YWwsIDAsIDQwODApOworCXJldHVybiAobnZhbCArIDgpIC8gMTY7Cit9CisjZGVmaW5lIElOX0ZST01fUkVHKHZhbCkgKCh2YWwpICogIDE2KQorCitzdGF0aWMgaW5saW5lIHU4IEZBTl9UT19SRUcobG9uZyBycG0sIGludCBkaXYpCit7CisJaWYgKHJwbSA8PSAwKQorCQlyZXR1cm4gMjU1OworCXJldHVybiBTRU5TT1JTX0xJTUlUKCgxMzUwMDAwICsgcnBtICogZGl2IC8gMikgLyAocnBtICogZGl2KSwgMSwgMjU0KTsKK30KKworc3RhdGljIGlubGluZSBpbnQgRkFOX0ZST01fUkVHKHU4IHZhbCwgaW50IGRpdikKK3sKKwlyZXR1cm4gdmFsPT0wID8gLTEgOiB2YWw9PTI1NSA/IDAgOiAxMzUwMDAwLyh2YWwqZGl2KTsKK30KKworLyogVEVNUDogbUMgKC01NC4xMkMgdG8gKzE1Ny41M0MpCisgICBSRUc6IDAuODNDL2JpdCArIDUyLjEyLCB0d28ncyBjb21wbGVtZW50ICAqLworc3RhdGljIGlubGluZSBpbnQgVEVNUF9GUk9NX1JFRyhzOCB2YWwpCit7CisJcmV0dXJuIHZhbCAqIDgzMCArIDUyMTIwOworfQorc3RhdGljIGlubGluZSBzOCBURU1QX1RPX1JFRyhpbnQgdmFsKQoreworCWludCBudmFsID0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