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oKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICBTb21lIGFjY2VzcyBwcmltaXRpdmVzIGZvciB0aGUgQUxpIGNoaXA6ICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqLworCitzdGF0aWMgdm9pZCBhbGlfd3JpdGUodTggaW5kZXgsIHU4IHZhbHVlKQorewkKKwkvKiB3cml0ZSBhbiBhcmJpcmFyeSByZWdpc3RlciAqLworCW91dGIoaW5kZXgsIEFMSV9JTkRFWCk7CisJb3V0Yih2YWx1ZSwgQUxJX0RBVEEpOworfQorCisjaWYgMAorc3RhdGljIGludCBhbGlfcmVhZCh1OCBpbmRleCkKK3sKKwlvdXRiKGluZGV4LCBBTElfSU5ERVgpOworCXJldHVybiBpbmIoQUxJX0RBVEEpOworfQorI2VuZGlmCisKKyNkZWZpbmUgQUxJX09QRU4oKSBcCisJb3V0YigweDUxLCBBTElfSU5ERVgpOyBcCisJb3V0YigweDIzLCBBTElfSU5ERVgpCQorCisKKyNkZWZpbmUgQUxJX0NMT1NFKCkgXAorCW91dGIoMHhiYiwgQUxJX0lOREVYKQorCisvKiBTZWxlY3QgYSBsb2dpY2FsIGRldmljZSAqLworI2RlZmluZSBBTElfU0VMREVWKGRldikJXAorCWFsaV93cml0ZSgweDA3LCBkZXYpCQorCisKK3ZvaWQgYWxpNTEyeF9pbml0KHZvaWQpCit7CisJQUxJX09QRU4oKTsKKworCWFsaV93cml0ZSgweDAyLCAweDAxKTsJLyogc29mdCByZXNldCAqLworCWFsaV93cml0ZSgweDAzLCAweDAzKTsJLyogZGlzYWJsZSBhY2Nlc3MgdG8gQ0lPcyAqLworCWFsaV93cml0ZSgweDIyLCAweDAwKTsJLyogZGlzYWJsZSBkaXJlY3QgcG93ZXJkb3duICovCisJYWxpX3dyaXRlKDB4MjMsIDB4MD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G51bWJlcmVkCisgKiAxMC0xNworICogMjAtMjUKKyAqIDMwLTM3CisgKiAKKyAqIDIwLTI0IGFyZSBkZWRpY2F0ZWQgQ0lPIHBpbnMsIHRoZSBvdGhlciAxNyBhcmUgbXVsaXBsZXhlZCB3aXRoCisgKiBvdGhlciBmdW5jdGlvbnMuCisgKiAKKyAqICAgICAgICAgICBTZWNvbmRhcnkgCisgKiBDSU8gUGluICAgRnVuY3Rpb24gICAgRGVjcmlwdGlvbgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ0lPMTAgICAgIElSUUlOMSAgICAgIEludGVycnVwdCBpbnB1dCAxPworICogQ0lPMTEgICAgIElSUUlOMiAgICAgIEludGVycnVwdCBpbnB1dCAyPworICogQ0lPMTIgICAgIElSUlggICAgICAgIElyRGEgUmVjZWl2ZQorICogQ0lPMTMgICAgIElSVFggICAgICAgIElyRGEgVHJhbnNtaXQKKyAqIENJTzE0ICAgICBQMjEgICAgICAgICBLQkMgUDIxIGZ1Y250aW9uCisgKiBDSU8xNSAgICAgUDIwICAgICAgICAgS0JDIFAyMSBmdWNudGlvbgorICogQ0lPMTYgICAgIEkyQ19DTEsgICAgIEkyQyBDbG9jaworICogQ0lPMTcgICAgIEkyQ19EQVQgICAgIEkyQyBEYXRhCisgKiAKKyAqIENJTzIwICAgICAtCisgKiBDSU8yMSAgICAgLQorICogQ0lPMjIgICAgIC0KKyAqIENJTzIzICAgICAtCisgKiBDSU8yNCAgICAgLQorICogQ0lPMjUgICAgIExPQ0sgICAgICAgIEtleWxvY2sKKyAqIAorICogQ0lPMzAgICAgIEtCQ19DTEsgICAgIEtleWJhb3JkIENsb2NrCisgKiBDSU8zMSAgICAgQ1MwSiAgICAgICAgR2VuZXJhbCBDaGlwIFNlbGVjdCBkZWNvZGVyIENTMEoKKyAqIENJTzMyICAgICBDUzFKICAgICAgICBHZW5lcmFsIENoaXAgU2VsZWN0IGRlY29kZXIgQ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AweEVBIGRhdGEgPSAweEVCCisgKiAKKyAqIFRoZXJlIGFyZSB0aHJlZSBDSU8gSS9PIHJlZ2lzdGVyIGFjY2Vzc2VkIHZpYSBDSU8gaW5kZXggcG9ydCBhbmQgQ0lPIGRhdGEgcG9ydAorICogMHgwMSAgICAgQ0lPIDEwLTE3IGRhdGEKKyAqIDB4MDIgICAgIENJTyAyMC0yNSBkYXRhIChiaXRzIDctNiB1bnVzZWQpCisgKiAweDAzICAgICBDSU8gMzAtMzcgZGF0YQorICogCisgKiAKKyAqIFRoZSBwaW4gZnVuY3Rpb24gaXMgYWNjZXNzZWQgdGhyb3VnaCBub3JtYWwgCisgKiBTSU8gcmVnaXN0ZXJzLCBlYWNoIHJlZ2lzdGVyIGhhdmUgdGhlIHNhbWUgZm9ybWF0OgorICogCisgKiBCaXQgICBGdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgIFZhbHVlCisgKiAwICAgICBJbnB1dC9vdXRwdXQgICAgICAgICAgICAgICAgIDE9aW5wdXQgCisgKiAxICAgICBQb2xhcml0eSBvZiBzaWduYWwgICAgICAgICAgIDE9aW52ZXJ0ZWQKKyAqIDIgICAgIFVudXNlZCAgICAgICAgICAgICAgICAgICAgICAgPz8KKyAqIDMgICAgIEZ1bmN0aW9uIChub3JtYWwgb3Igc3BlY2lhbCkgMT1zcGVjaWFsCisgKiA3LTQgICBVbnVzZWQKKyAqIAorICogU0lPIFJFRworICogMHhlMCAgICAgQ0lPIDEwIENvbmZpZworICogMHhlMSAgICAgQ0lPIDExIENvbmZpZworICogMHhlMiAgICAgQ0lPIDEyIENvbmZpZworICogMHhlMyAgICAgQ0lPIDEzIENvbmZpZworICogMHhlNCAgICAgQ0lPIDE0IENvbmZpZworICogMHhlNSAgICAgQ0lPIDE1IENvbmZpZworICogMHhlNiAgICAgQ0lPIDE2IENvbmZpZworICogMHhlNyAgICAgQ0lPIDE2IENvbmZpZworICoKKyAqIDB4ZTggICAgIENJTyAyMCBDb25maWcKKyAqIDB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