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DUkVBVElPTiBEQVRFOiAgNi8wMi8yMDAwCisgKiAgSUQ6ICAgICAgICAgICAgICRJZDogZmNfbG9nLmgsdiA0LjYgMjAwMS8wNy8yNiAxNDo0MTozMyBzc2NocmVtbSBFeHAgJAorICovCisKKworLyoKKyAqIE1waUlvY0xvZ0luZm9fdCBlbnVtCisgKgorICogVGhlc2UgMzIgYml0IHZhbHVlcyBhcmUgdXNlZCBpbiB0aGUgSU9DTG9nSW5mbyBmaWVsZCBvZiB0aGUgTVBJIHJlcGx5CisgKiBtZXNzYWdlcy4KKyAqIFRoZSB2YWx1ZSBpcyAweGFiY2NjY2NjIHdoZXJlCisgKiAgICAgICAgICBhID0gVGhlIHR5cGUgb2YgbG9nIGluZm8gYXMgcGVyIHRoZSBNUEkgc3BlYy4gU2luY2UgdGhlc2UgY29kZXMgYXJlCisgKiAgICAgICAgICAgICAgYWxsIGZvciBGaWJyZSBDaGFubmVsIHRoaXMgdmFsdWUgd2lsbCBhbHdheXMgYmUgMi4KKyAqICAgICAgICAgIGIgPSBTcGVjaWZpZXMgYSBzdWJjbGFzcyBvZiB0aGUgZmlybXdhcmUgd2hlcmUKKyAqICAgICAgICAgICAgICAgICAgMCA9IEZDUCBJbml0aWF0b3IKKyAqICAgICAgICAgICAgICAgICAgMSA9IEZDUCBUYXJnZXQKKyAqICAgICAgICAgICAgICAgICAgMiA9IExBTgorICogICAgICAgICAgICAgICAgICAzID0gTVBJIE1lc3NhZ2UgTGF5ZXIKKyAqICAgICAgICAgICAgICAgICAgNCA9IEZDIExpbmsKKyAqICAgICAgICAgICAgICAgICAgNSA9IENvbnRleHQgTWFuYWdlcgorICogICAgICAgICAgICAgICAgICA2ID0gSW52YWxpZCBGaWVsZCBPZmZzZXQKKyAqICAgICAgICAgICAgICAgICAgNyA9IFN0YXRlIENoYW5nZSBJbmZvCisgKiAgICAgICAgICAgICAgICAgIGFsbCBvdGhlcnMgYXJlIHJlc2VydmVkIGZvciBmdXR1cmUgdXNlCisgKiAgIC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tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgTVBJX0gKKyNkZWZpbmUgTVBJX0gKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgIE0gUCBJICAgIFYgZSByIHMgaSBvIG4gICAgRCBlIGYgaSBuIGkgdCBpIG8gbiBzCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBNUElfVkVSU0lPTl9NQUpPUiAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1ZFUlNJT05fTUlOT1IgICAgICAgICAgICAgICAgICAgKDB4MDUpCisjZGVmaW5lIE1QSV9WRVJTSU9OX01BSk9SX01BU0sgICAgICAgICAgICAgICgweEZGMDApCisjZGVmaW5lIE1QSV9WRVJTSU9OX01BSk9SX1NISUZUICAgICAgICAgICAgICg4KQorI2RlZmluZSBNUElfVkVSU0lPTl9NSU5PUl9NQVNLICAgICAgICAgICAgICAoMHgwMEZGKQorI2RlZmluZSBNUElfVkVSU0lPTl9NSU5PUl9TSElGVCAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX1ZFUlNJT04gKChNUElfVkVSU0lPTl9NQUpPUiA8PCBNUElfVkVSU0lPTl9NQUpPUl9TSElGVCkgfCAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVBJX1ZFUlNJT05fTUlOT1IpCisKKyNkZWZpbmUgTVBJX1ZFUlNJT05fMDFfMDAgICAgICAgICAgICAgICAgICAgKDB4MDEwMCkKKyNkZWZpbmUgTVBJX1ZFUlNJT05fMDFfMDEgICAgICAgICAgICAgICAgICAgKDB4MDEwMSkKKyNkZWZpbmUgTVBJX1ZFUlNJT05fMDFfMDIgICAgICAgICAgICAgICAgICAgKDB4MDEwMikKKyNkZWZpbmUgTVBJX1ZFUlNJT05fMDFfMDMgICAgICAgICAgICAgICAgICAgKDB4MDEwMykKKyNkZWZpbmUgTVBJX1ZFUlNJT05fMDFfMDUgICAgICAgICAgICAgICAgICAgKDB4MDEwNSkKKy8qIE5vdGU6IFRoZSBtYWpvciB2ZXJzaW9ucyBvZiAweGUwIHRocm91Z2ggMHhmZiBhcmUgcmVzZXJ2ZWQgKi8KKworLyogdmVyc2lvbmluZyBmb3IgdGhpcyBNUEkgaGVhZGVyIHNldCAqLworI2RlZmluZSBNUElfSEVBREVSX1ZFUlNJT05fVU5JVCAgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX0hFQURFUl9WRVJTSU9OX0RFViAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9IRUFERVJfVkVSU0lPTl9VTklUX01BU0sgICAgICAgICgweEZGMDApCisjZGVmaW5lIE1QSV9IRUFERVJfVkVSU0lPTl9VTklUX1NISUZUICAgICAgICg4KQorI2RlZmluZSBNUElfSEVBREVSX1ZFUlNJT05fREVWX01BU0sgICAgICAgICAoMHgwMEZGKQorI2RlZmluZSBNUElfSEVBREVSX1ZFUlNJT05fREVWX1NISUZUICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX0hFQURFUl9WRVJTSU9OICgoTVBJX0hFQURFUl9WRVJTSU9OX1VOSVQgPDwgOCkgfCBNUElfSEVBREVSX1ZFUlNJT05fREVWKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgIEkgTyBDICAgIFMgdCBhIHQgZSAgICBEIGUgZiBpIG4gaSB0IGkgbyBuIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NfU1RBVE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RkFVTFRfREFUQV9SRUNFSVZFX1BDSV9CVVNfRkFVTFQgICAgICAgICgweDgxMTgpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICBQIEMgSSAgICBTIHkgcyB0IGUgbSAgICBJIG4gdCBlIHIgZiBhIGMgZSAgICBSIGUgZyBpIHMgdCBlIHIgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIFMgeSBzIHQgZSBtICAgIEQgbyBvIHIgYiBlIGwgbCAqLworI2RlZmluZSBNUElfRE9PUkJFTExfT0ZGU0VUICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMCkKKyNkZWZpbmUgTVBJX0RPT1JCRUxMX0FDVElWRSAgICAgICAgICAgICAgICAgKDB4MDgwMDAwMDApIC8qIERvb3JiZWxsVXNlZCAqLworI2RlZmluZSBNUElfRE9PUkJFTExfVVNFRCAgICAgICAgICAgICAgICAgICAoTVBJX0RPT1JCRUxMX0FDVElWRSkKKyNkZWZpbmUgTVBJX0RPT1JCRUxMX0FDVElWRV9TSElGVCAgICAgICAgICAgKDI3KQorI2RlZmluZSBNUElfRE9PUkJFTExfV0hPX0lOSVRfTUFTSyAgICAgICAgICAoMHgwNzAwMDAwMCkKKyNkZWZpbmUgTVBJX0RPT1JCRUxMX1dIT19JTklUX1NISUZUICAgICAgICAgKDI0KQorI2RlZmluZSBNUElfRE9PUkJFTExfRlVOQ1RJT05fTUFTSyAgICAgICAgICAoMHhGRjAwMDAwMCkKKyNkZWZpbmUgTVBJX0RPT1JCRUxMX0ZVTkNUSU9OX1NISUZUICAgICAgICAgKDI0KQorI2RlZmluZSBNUElfRE9PUkJFTExfQUREX0RXT1JEU19NQVNLICAgICAgICAoMHgwMEZGMDAwMCkKKyNkZWZpbmUgTVBJX0RPT1JCRUxMX0FERF9EV09SRFNfU0hJRlQgICAgICAgKDE2KQorI2RlZmluZSBNUElfRE9PUkJFTExfREFUQV9NQVNLICAgICAgICAgICAgICAoMHgwMDAwRkZGRikKKworCisjZGVmaW5lIE1QSV9XUklURV9TRVFVRU5DRV9PRkZTRVQgICAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfV1JTRVFfS0VZX1ZBTFVFX01BU0sgICAgICAgICAgICAoMHgwMDAwMDAwRikKKyNkZWZpbmUgTVBJX1dSU0VRXzFTVF9LRVlfVkFMVUUgICAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9XUlNFUV8yTkRfS0VZX1ZBTFVFICAgICAgICAgICAgICgweDBCKQorI2RlZmluZSBNUElfV1JTRVFfM1JEX0tFWV9WQUxVRSAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX1dSU0VRXzRUSF9LRVlfVkFMVUUgICAgICAgICAgICAgKDB4MDcpCisjZGVmaW5lIE1QSV9XUlNFUV81VEhfS0VZX1ZBTFVFICAgICAgICAgICAgICgweDBEKQorCisjZGVmaW5lIE1QSV9ESUFHTk9TVElDX09GRlNFVCAgICAgICAgICAgICAgICgweDAwMDAwMDA4KQorI2RlZmluZSBNUElfRElBR19DTEVBUl9GTEFTSF9CQURfU0lHICAgICAgICAoMHgwMDAwMDQwMCkKKyNkZWZpbmUgTVBJX0RJQUdfUFJFVkVOVF9JT0NfQk9PVCAgICAgICAgICAgKDB4MDAwMDAyMDApCisjZGVmaW5lIE1QSV9ESUFHX0RSV0UgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDgwKQorI2RlZmluZSBNUElfRElBR19GTEFTSF9CQURfU0lHICAgICAgICAgICAgICAoMHgwMDAwMDA0MCkKKyNkZWZpbmUgTVBJX0RJQUdfUkVTRVRfSElTVE9SWSAgICAgICAgICAgICAgKDB4MDAwMDAwMjApCisjZGVmaW5lIE1QSV9ESUFHX1JXX0VOQUJMRSAgICAgICAgICAgICAgICAgICgweDAwMDAwMDEwKQorI2RlZmluZSBNUElfRElBR19SRVNFVF9BREFQVEVSICAgICAgICAgICAgICAoMHgwMDAwMDAwNCkKKyNkZWZpbmUgTVBJX0RJQUdfRElTQUJMRV9BUk0gICAgICAgICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9ESUFHX01FTV9FTkFCTEUgICAgICAgICAgICAgICAgICgweDAwMDAwMDAxKQorCisjZGVmaW5lIE1QSV9URVNUX0JBU0VfQUREUkVTU19PRkZTRVQgICAgICAgICgweDAwMDAwMDBDKQorCisjZGVmaW5lIE1QSV9ESUFHX1JXX0RBVEFfT0ZGU0VUICAgICAgICAgICAgICgweDAwMDAwMDEwKQorCisjZGVmaW5lIE1QSV9ESUFHX1JXX0FERFJFU1NfT0ZGU0VUICAgICAgICAgICgweDAwMDAwMDE0KQorCisjZGVmaW5lIE1QSV9IT1NUX0lOVEVSUlVQVF9TVEFUVVNfT0ZGU0VUICAgICgweDAwMDAwMDMwKQorI2RlZmluZSBNUElfSElTX0lPUF9ET09SQkVMTF9TVEFUVVMgICAgICAgICAoMHg4MDAwMDAwMCkKKyNkZWZpbmUgTVBJX0hJU19SRVBMWV9NRVNTQUdFX0lOVEVSUlVQVCAgICAgKDB4MDAwMDAwMDgpCisjZGVmaW5lIE1QSV9ISVNfRE9PUkJFTExfSU5URVJSVVBUICAgICAgICAgICgweDAwMDAwMDAxKQorCisjZGVmaW5lIE1QSV9IT1NUX0lOVEVSUlVQVF9NQVNLX09GRlNFVCAgICAgICgweDAwMDAwMDM0KQorI2RlZmluZSBNUElfSElNX1JJTSAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwOCkKKyNkZWZpbmUgTVBJX0hJTV9ESU0gICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDEpCisKKyNkZWZpbmUgTVBJX1JFUVVFU1RfUVVFVUVfT0ZGU0VUICAgICAgICAgICAgKDB4MDAwMDAwNDApCisjZGVmaW5lIE1QSV9SRVFVRVNUX1BPU1RfRklGT19PRkZTRVQgICAgICAgICgweDAwMDAwMDQwKQorCisjZGVmaW5lIE1QSV9SRVBMWV9RVUVVRV9PRkZTRVQgICAgICAgICAgICAgICgweDAwMDAwMDQ0KQorI2RlZmluZSBNUElfUkVQTFlfUE9TVF9GSUZPX09GRlNFVCAgICAgICAgICAoMHgwMDAwMDA0NCkKKyNkZWZpbmUgTVBJX1JFUExZX0ZSRUVfRklGT19PRkZTRVQgICAgICAgICAgKDB4MDAwMDAwNDQpCisKKyNkZWZpbmUgTVBJX0hJX1BSSV9SRVFVRVNUX1FVRVVFX09GRlNFVCAgICAgKDB4MDAwMDAwNDgpCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgIE0gZSBzIHMgYSBnIGUgICAgRiByIGEgbSBlICAgIEQgZSBzIGMgciBpIHAgdCBvIHIgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX1JFUV9NRl9ERVNDUklQVE9SX05CX01BU0sgICAgICAgKDB4MDAwMDAwMDMpCisjZGVmaW5lIE1QSV9SRVFfTUZfREVTQ1JJUFRPUl9GX0JJVCAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfUkVRX01GX0RFU0NSSVBUT1JfQUREUkVTU19NQVNLICAoMHhGRkZGRkZGOCkKKworI2RlZmluZSBNUElfQUREUkVTU19SRVBMWV9BX0JJVCAgICAgICAgICAgICAoMHg4MDAwMDAwMCkKKyNkZWZpbmUgTVBJX0FERFJFU1NfUkVQTFlfQUREUkVTU19NQVNLICAgICAgKDB4N0ZGRkZGRkYpCisKKyNkZWZpbmUgTVBJX0NPTlRFWFRfUkVQTFlfQV9CSVQgICAgICAgICAgICAgKDB4ODAwMDAwMDApCisjZGVmaW5lIE1QSV9DT05URVhUX1JFUExZX1RZUEVfTUFTSyAgICAgICAgICgweDYwMDAwMDAwKQorI2RlZmluZSBNUElfQ09OVEVYVF9SRVBMWV9UWVBFX1NDU0lfSU5JVCAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX0NPTlRFWFRfUkVQTFlfVFlQRV9TQ1NJX1RBUkdFVCAgKDB4MDEpCisjZGVmaW5lIE1QSV9DT05URVhUX1JFUExZX1RZUEVfTEFOICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfQ09OVEVYVF9SRVBMWV9UWVBFX1NISUZUICAgICAgICAoMjkpCisjZGVmaW5lIE1QSV9DT05URVhUX1JFUExZX0NPTlRFWFRfTUFTSyAgICAgICgweDFGRkZGRkZGKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogQ29udGV4dCBSZXBseSBtYWNyb3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBNUElfR0VUX0NPTlRFWFRfUkVQTFlfVFlQRSh4KSAgKCgoeCkgJiBNUElfQ09OVEVYVF9SRVBMWV9UWVBFX01BU0spIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4+IE1QSV9DT05URVhUX1JFUExZX1RZUEVfU0hJRlQpCisKKyNkZWZpbmUgTVBJX1NFVF9DT05URVhUX1JFUExZX1RZUEUoeCwgdHlwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAoKHgpID0gKCh4KSAmIH5NUElfQ09OVEVYVF9SRVBMWV9UWVBFX01BU0spIHwgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHR5cCkgPDwgTVBJX0NPTlRFWFRfUkVQTFlfVFlQRV9TSElGVCkgJiAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNUElfQ09OVEVYVF9SRVBMWV9UWVBFX01BU0spKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgTSBlIHMgcyBhIGcgZSAgICBGIHUgbiBjIHQgaSBvIG4gcworKiAgICAgICAgICAgICAgMHg4MCAtPiAweDhGIHJlc2VydmVkIGZvciBwcml2YXRlIG1lc3NhZ2UgdXNlIHBlciBwcm9kdWN0CisqCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBNUElfRlVOQ1RJT05fU0NTSV9JT19SRVFVRVNUICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfRlVOQ1RJT05fU0NTSV9UQVNLX01HTVQgICAgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfRlVOQ1RJT05fSU9DX0lOSVQgICAgICAgICAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfRlVOQ1RJT05fSU9DX0ZBQ1RTICAgICAgICAgICAgICAgICAgICAgICgweDAzKQorI2RlZmluZSBNUElfRlVOQ1RJT05fQ09ORklHICAgICAgICAgICAgICAgICAgICAgICAgICgweDA0KQorI2RlZmluZSBNUElfRlVOQ1RJT05fUE9SVF9GQUNUUyAgICAgICAgICAgICAgICAgICAgICgweDA1KQorI2RlZmluZSBNUElfRlVOQ1RJT05fUE9SVF9FTkFCTEUgICAgICAgICAgICAgICAgICAgICgweDA2KQorI2RlZmluZSBNUElfRlVOQ1RJT05fRVZFTlRfTk9USUZJQ0FUSU9OICAgICAgICAgICAgICgweDA3KQorI2RlZmluZSBNUElfRlVOQ1RJT05fRVZFTlRfQUNLICAgICAgICAgICAgICAgICAgICAgICgweDA4KQorI2RlZmluZSBNUElfRlVOQ1RJT05fRldfRE9XTkxPQUQgICAgICAgICAgICAgICAgICAgICgweDA5KQorI2RlZmluZSBNUElfRlVOQ1RJT05fVEFSR0VUX0NNRF9CVUZGRVJfUE9TVCAgICAgICAgICgweDBBKQorI2RlZmluZSBNUElfRlVOQ1RJT05fVEFSR0VUX0FTU0lTVCAgICAgICAgICAgICAgICAgICgweDBCKQorI2RlZmluZSBNUElfRlVOQ1RJT05fVEFSR0VUX1NUQVRVU19TRU5EICAgICAgICAgICAgICgweDBDKQorI2RlZmluZSBNUElfRlVOQ1RJT05fVEFSR0VUX01PREVfQUJPUlQgICAgICAgICAgICAgICgweDBEKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfTElOS19TUlZDX0JVRl9QT1NUICAgICAgICAgICgweDBFKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfTElOS19TUlZDX1JTUCAgICAgICAgICAgICAgICgweDBGKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfRVhfTElOS19TUlZDX1NFTkQgICAgICAgICAgICgweDEwKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfQUJPUlQgICAgICAgICAgICAgICAgICAgICAgICgweDExKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRldfVVBMT0FEICAgICAgICAgICAgICAgICAgICAgICgweDEyKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfQ09NTU9OX1RSQU5TUE9SVF9TRU5EICAgICAgICgweDEzKQorI2RlZmluZSBNUElfRlVOQ1RJT05fRkNfUFJJTUlUSVZFX1NFTkQgICAgICAgICAgICAgICgweDE0KQorCisjZGVmaW5lIE1QSV9GVU5DVElPTl9SQUlEX0FDVElPTiAgICAgICAgICAgICAgICAgICAgKDB4MTUpCisjZGVmaW5lIE1QSV9GVU5DVElPTl9SQUlEX1NDU0lfSU9fUEFTU1RIUk9VR0ggICAgICAgKDB4MTYpCisKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX1RPT0xCT1ggICAgICAgICAgICAgICAgICAgICAgICAoMHgxNykKKworI2RlZmluZSBNUElfRlVOQ1RJT05fU0NTSV9FTkNMT1NVUkVfUFJPQ0VTU09SICAgICAgICgweDE4KQorCisjZGVmaW5lIE1QSV9GVU5DVElPTl9NQUlMQk9YICAgICAgICAgICAgICAgICAgICAgICAgKDB4MTkpCisKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX1NNUF9QQVNTVEhST1VHSCAgICAgICAgICAgICAgICAoMHgxQSkKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX1NBU19JT19VTklUX0NPTlRST0wgICAgICAgICAgICAoMHgxQikKKworI2RlZmluZSBNUElfRElBR19CVUZGRVJfUE9TVCAgICAgICAgICAgICAgICAgICAgICAgICgweDFEKQorI2RlZmluZSBNUElfRElBR19SRUxFQVNFICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDFFKQorCisjZGVmaW5lIE1QSV9GVU5DVElPTl9TQ1NJX0lPXzMyICAgICAgICAgICAgICAgICAgICAgKDB4MUYpCisKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX0xBTl9TRU5EICAgICAgICAgICAgICAgICAgICAgICAoMHgyMCkKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX0xBTl9SRUNFSVZFICAgICAgICAgICAgICAgICAgICAoMHgyMSkKKyNkZWZpbmUgTVBJX0ZVTkNUSU9OX0xBTl9SRVNFVCAgICAgICAgICAgICAgICAgICAgICAoMHgyMikKKworI2RlZmluZSBNUElfRlVOQ1RJT05fSU5CQU5EX0JVRkZFUl9QT1NUICAgICAgICAgICAgICgweDI4KQorI2RlZmluZSBNUElfRlVOQ1RJT05fSU5CQU5EX1NFTkQgICAgICAgICAgICAgICAgICAgICgweDI5KQorI2RlZmluZSBNUElfRlVOQ1RJT05fSU5CQU5EX1JTUCAgICAgICAgICAgICAgICAgICAgICgweDJBKQorI2RlZmluZSBNUElfRlVOQ1RJT05fSU5CQU5EX0FCT1JUICAgICAgICAgICAgICAgICAgICgweDJCKQorCisjZGVmaW5lIE1QSV9GVU5DVElPTl9JT0NfTUVTU0FHRV9VTklUX1JFU0VUICAgICAgICAgKDB4NDApCisjZGVmaW5lIE1QSV9GVU5DVElPTl9JT19VTklUX1JFU0VUICAgICAgICAgICAgICAgICAgKDB4NDEpCisjZGVmaW5lIE1QSV9GVU5DVElPTl9IQU5EU0hBS0UgICAgICAgICAgICAgICAgICAgICAgKDB4NDIpCisjZGVmaW5lIE1QSV9GVU5DVElPTl9SRVBMWV9GUkFNRV9SRU1PVkFMICAgICAgICAgICAgKDB4NDMpCisKKworLyogc3RhbmRhcmQgdmVyc2lvbiBmb3JtYXQgKi8KK3R5cGVkZWYgc3RydWN0IF9NUElfVkVSU0lPTl9TVFJVQ1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBEZXY7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVW5pdDsgICAgICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1pbm9yOyAgICAgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNYWpvcjsgICAgICAgICAgICAgICAgICAgICAgLyogMDNoICovCit9IE1QSV9WRVJTSU9OX1NUUlVDVCwgTVBJX1BPSU5URVIgUFRSX01QSV9WRVJTSU9OX1NUUlVDVCwKKyAgTXBpVmVyc2lvblN0cnVjdF90LCBNUElfUE9JTlRFUiBwTXBpVmVyc2lvblN0cnVjdDsKKwordHlwZWRlZiB1bmlvbiBfTVBJX1ZFUlNJT05fRk9STUFUCit7CisgICAgTVBJX1ZFUlNJT05fU1RSVUNUICAgICAgU3RydWN0OworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFdvcmQ7Cit9IE1QSV9WRVJTSU9OX0ZPUk1BVCwgTVBJX1BPSU5URVIgUFRSX01QSV9WRVJTSU9OX0ZPUk1BVCwKKyAgTXBpVmVyc2lvbkZvcm1hdF90LCBNUElfUE9JTlRFUiBwTXBpVmVyc2lvbkZvcm1hdF90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgUyBjIGEgdCB0IGUgciAgICBHIGEgdCBoIGUgciAgICBFIGwgZSBtIGUgbiB0IHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBTaW1wbGUgZWxlbWVudCBzdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9TR0VfU0lNUExFMzIKK3sKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBGbGFnc0xlbmd0aDsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBBZGRyZXNzOworfSBTR0VfU0lNUExFMzIsIE1QSV9QT0lOVEVSIFBUUl9TR0VfU0lNUExFMzIsCisgIFNHRVNpbXBsZTMyX3QsIE1QSV9QT0lOVEVSIHBTR0VTaW1wbGUzMl90OworCit0eXBlZGVmIHN0cnVjdCBfU0dFX1NJTVBMRTY0Cit7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgRmxhZ3NMZW5ndGg7CisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgQWRkcmVzczsKK30gU0dFX1NJTVBMRTY0LCBNUElfUE9JTlRFUiBQVFJfU0dFX1NJTVBMRTY0LAorICBTR0VTaW1wbGU2NF90LCBNUElfUE9JTlRFUiBwU0dFU2ltcGxlNjRfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX1NHRV9TSU1QTEVfVU5JT04KK3sKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBGbGFnc0xlbmd0aDsKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBBZGRyZXNzMzI7CisgICAgICAgIFU2NCAgICAgICAgICAgICAgICAgQWRkcmVzczY0OworICAgIH11OworfSBTR0VTaW1wbGVVbmlvbl90LCBNUElfUE9JTlRFUiBwU0dFU2ltcGxlVW5pb25fdCwKKyAgU0dFX1NJTVBMRV9VTklPTiwgTVBJX1BPSU5URVIgUFRSX1NHRV9TSU1QTEVfVU5JT047CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIENoYWluIGVsZW1lbnQgc3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX1NHRV9DSEFJTjMyCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgTGVuZ3RoOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE5leHRDaGFpbk9mZnNldDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBBZGRyZXNzOworfSBTR0VfQ0hBSU4zMiwgTVBJX1BPSU5URVIgUFRSX1NHRV9DSEFJTjMyLAorICBTR0VDaGFpbjMyX3QsIE1QSV9QT0lOVEVSIHBTR0VDaGFpbjMyX3Q7CisKK3R5cGVkZWYgc3RydWN0IF9TR0VfQ0hBSU42NAoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIExlbmd0aDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBOZXh0Q2hhaW5PZmZzZXQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7CisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgQWRkcmVzczsKK30gU0dFX0NIQUlONjQsIE1QSV9QT0lOVEVSIFBUUl9TR0VfQ0hBSU42NCwKKyAgU0dFQ2hhaW42NF90LCBNUElfUE9JTlRFUiBwU0dFQ2hhaW42NF90OworCit0eXBlZGVmIHN0cnVjdCBfU0dFX0NIQUlOX1VOSU9OCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgTGVuZ3RoOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE5leHRDaGFpbk9mZnNldDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBBZGRyZXNzMzI7CisgICAgICAgIFU2NCAgICAgICAgICAgICAgICAgQWRkcmVzczY0OworICAgIH11OworfSBTR0VfQ0hBSU5fVU5JT04sIE1QSV9QT0lOVEVSIFBUUl9TR0VfQ0hBSU5fVU5JT04sCisgIFNHRUNoYWluVW5pb25fdCwgTVBJX1BPSU5URVIgcFNHRUNoYWluVW5pb25fdDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgVHJhbnNhY3Rpb24gQ29udGV4dCBlbGVtZW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfU0dFX1RSQU5TQUNUSU9OMzIKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDb250ZXh0U2l6ZTsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBEZXRhaWxzTGVuZ3RoOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zYWN0aW9uQ29udGV4dFsxXTsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkRldGFpbHNbMV07Cit9IFNHRV9UUkFOU0FDVElPTjMyLCBNUElfUE9JTlRFUiBQVFJfU0dFX1RSQU5TQUNUSU9OMzIsCisgIFNHRVRyYW5zYWN0aW9uMzJfdCwgTVBJX1BPSU5URVIgcFNHRVRyYW5zYWN0aW9uMzJfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX1NHRV9UUkFOU0FDVElPTjY0Cit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29udGV4dFNpemU7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRGV0YWlsc0xlbmd0aDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHRbMl07CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNhY3Rpb25EZXRhaWxzWzFdOworfSBTR0VfVFJBTlNBQ1RJT042NCwgTVBJX1BPSU5URVIgUFRSX1NHRV9UUkFOU0FDVElPTjY0LAorICBTR0VUcmFuc2FjdGlvbjY0X3QsIE1QSV9QT0lOVEVSIHBTR0VUcmFuc2FjdGlvbjY0X3Q7CisKK3R5cGVkZWYgc3RydWN0IF9TR0VfVFJBTlNBQ1RJT045NgoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENvbnRleHRTaXplOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIERldGFpbHNMZW5ndGg7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNhY3Rpb25Db250ZXh0WzNdOworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zYWN0aW9uRGV0YWlsc1sxXTsKK30gU0dFX1RSQU5TQUNUSU9OOTYsIE1QSV9QT0lOVEVSIFBUUl9TR0VfVFJBTlNBQ1RJT045NiwKKyAgU0dFVHJhbnNhY3Rpb245Nl90LCBNUElfUE9JTlRFUiBwU0dFVHJhbnNhY3Rpb245Nl90OworCit0eXBlZGVmIHN0cnVjdCBfU0dFX1RSQU5TQUNUSU9OMTI4Cit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29udGV4dFNpemU7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRGV0YWlsc0xlbmd0aDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHRbNF07CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNhY3Rpb25EZXRhaWxzWzFdOworfSBTR0VfVFJBTlNBQ1RJT04xMjgsIE1QSV9QT0lOVEVSIFBUUl9TR0VfVFJBTlNBQ1RJT04xMjgsCisgIFNHRVRyYW5zYWN0aW9uX3QxMjgsIE1QSV9QT0lOVEVSIHBTR0VUcmFuc2FjdGlvbl90MTI4OworCit0eXBlZGVmIHN0cnVjdCBfU0dFX1RSQU5TQUNUSU9OX1VOSU9OCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29udGV4dFNpemU7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRGV0YWlsc0xlbmd0aDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHQzMlsxXTsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHQ2NFsyXTsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHQ5NlszXTsKKyAgICAgICAgVTMyICAgICAgICAgICAgICAgICBUcmFuc2FjdGlvbkNvbnRleHQxMjhbNF07CisgICAgfXU7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNhY3Rpb25EZXRhaWxzWzFdOworfSBTR0VfVFJBTlNBQ1RJT05fVU5JT04sIE1QSV9QT0lOVEVSIFBUUl9TR0VfVFJBTlNBQ1RJT05fVU5JT04sCisgIFNHRVRyYW5zYWN0aW9uVW5pb25fdCwgTVBJX1BPSU5URVIgcFNHRVRyYW5zYWN0aW9uVW5pb25fdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBTR0UgSU8gdHlwZXMgdW5pb24gIGZvciBJTyBTR0wncyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9TR0VfSU9fVU5JT04KK3sKKyAgICB1bmlvbgorICAgIHsKKyAgICAgICAgU0dFX1NJTVBMRV9VTklPTiAgICBTaW1wbGU7CisgICAgICAgIFNHRV9DSEFJTl9VTklPTiAgICAgQ2hhaW47CisgICAgfSB1OworfSBTR0VfSU9fVU5JT04sIE1QSV9QT0lOVEVSIFBUUl9TR0VfSU9fVU5JT04sCisgIFNHRUlPVW5pb25fdCwgTVBJX1BPSU5URVIgcFNHRUlPVW5pb25fdDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgU0dFIHVuaW9uIGZvciBTR0wncyB3aXRoIFNpbXBsZSBhbmQgVHJhbnNhY3Rpb24gZWxlbWVudHMgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfU0dFX1RSQU5TX1NJTVBMRV9VTklPTgoreworICAgIHVuaW9uCisgICAgeworICAgICAgICBTR0VfU0lNUExFX1VOSU9OICAgICAgICBTaW1wbGU7CisgICAgICAgIFNHRV9UUkFOU0FDVElPTl9VTklPTiAgIFRyYW5zYWN0aW9uOworICAgIH0gdTsKK30gU0dFX1RSQU5TX1NJTVBMRV9VTklPTiwgTVBJX1BPSU5URVIgUFRSX1NHRV9UUkFOU19TSU1QTEVfVU5JT04sCisgIFNHRVRyYW5zU2ltcGxlVW5pb25fdCwgTVBJX1BPSU5URVIgcFNHRVRyYW5zU2ltcGxlVW5pb25fdDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgQWxsIFNHRSB0eXBlcyB1bmlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfU0dFX01QSV9VTklPTgoreworICAgIHVuaW9uCisgICAgeworICAgICAgICBTR0VfU0lNUExFX1VOSU9OICAgICAgICBTaW1wbGU7CisgICAgICAgIFNHRV9DSEFJTl9VTklPTiAgICAgICAgIENoYWluOworICAgICAgICBTR0VfVFJBTlNBQ1RJT05fVU5JT04gICBUcmFuc2FjdGlvbjsKKyAgICB9IHU7Cit9IFNHRV9NUElfVU5JT04sIE1QSV9QT0lOVEVSIFBUUl9TR0VfTVBJX1VOSU9OLAorICBNUElfU0dFX1VOSU9OX3QsIE1QSV9QT0lOVEVSIHBNUElfU0dFX1VOSU9OX3QsCisgIFNHRUFsbFVuaW9uX3QsIE1QSV9QT0lOVEVSIHBTR0VBbGxVbmlvbl90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIFNHRSBmaWVsZCBkZWZpbml0aW9uIGFuZCBtYXNrcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogRmxhZ3MgZmllbGQgYml0IGRlZmluaXRpb25zICovCisKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU19MQVNUX0VMRU1FTlQgICAgICAgICAgICAgICgweDgwKQorI2RlZmluZSBNUElfU0dFX0ZMQUdTX0VORF9PRl9CVUZGRVIgICAgICAgICAgICAgKDB4NDApCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfRUxFTUVOVF9UWVBFX01BU0sgICAgICAgICAoMHgzMCkKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU19MT0NBTF9BRERSRVNTICAgICAgICAgICAgICgweDA4KQorI2RlZmluZSBNUElfU0dFX0ZMQUdTX0RJUkVDVElPTiAgICAgICAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfQUREUkVTU19TSVpFICAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU19FTkRfT0ZfTElTVCAgICAgICAgICAgICAgICgweDAxKQorCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfU0hJRlQgICAgICAgICAgICAgICAgICAgICAoMjQpCisKKyNkZWZpbmUgTVBJX1NHRV9MRU5HVEhfTUFTSyAgICAgICAgICAgICAgICAgICAgICgweDAwRkZGRkZGKQorI2RlZmluZSBNUElfU0dFX0NIQUlOX0xFTkdUSF9NQVNLICAgICAgICAgICAgICAgKDB4MDAwMEZGRkYpCisKKy8qIEVsZW1lbnQgVHlwZSAqLworCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfVFJBTlNBQ1RJT05fRUxFTUVOVCAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU19TSU1QTEVfRUxFTUVOVCAgICAgICAgICAgICgweDEwKQorI2RlZmluZSBNUElfU0dFX0ZMQUdTX0NIQUlOX0VMRU1FTlQgICAgICAgICAgICAgKDB4MzApCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfRUxFTUVOVF9NQVNLICAgICAgICAgICAgICAoMHgzMCkKKworLyogQWRkcmVzcyBsb2NhdGlvbiAqLworCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfU1lTVEVNX0FERFJFU1MgICAgICAgICAgICAoMHgwMCkKKworLyogRGlyZWN0aW9uICovCisKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU19JT0NfVE9fSE9TVCAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfU0dFX0ZMQUdTX0hPU1RfVE9fSU9DICAgICAgICAgICAgICAgKDB4MDQpCisKKy8qIEFkZHJlc3MgU2l6ZSAqLworCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfMzJfQklUX0FERFJFU1NJTkcgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU182NF9CSVRfQUREUkVTU0lORyAgICAgICAgICgweDAyKQorCisvKiBDb250ZXh0IFNpemUgKi8KKworI2RlZmluZSBNUElfU0dFX0ZMQUdTXzMyX0JJVF9DT05URVhUICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9TR0VfRkxBR1NfNjRfQklUX0NPTlRFWFQgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX1NHRV9GTEFHU185Nl9CSVRfQ09OVEVYVCAgICAgICAgICAgICgweDA0KQorI2RlZmluZSBNUElfU0dFX0ZMQUdTXzEyOF9CSVRfQ09OVEVYVCAgICAgICAgICAgKDB4MDYpCisKKyNkZWZpbmUgTVBJX1NHRV9DSEFJTl9PRkZTRVRfTUFTSyAgICAgICAgICAgICAgICgweDAwRkYwMDAwKQorI2RlZmluZSBNUElfU0dFX0NIQUlOX09GRlNFVF9TSElGVCAgICAgICAgICAgICAgKDE2KQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIFNHRSBvcGVyYXRpb24gTWFjcm9zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworICAgICAgICAgLyogU0lNUExFIEZsYWdzTGVuZ3RoIG1hbmlwdWxhdGlvbnMuLi4gKi8KKyNkZWZpbmUgIE1QSV9TR0VfU0VUX0ZMQUdTKGYpICAgICAgICAgICAoKFUzMikoZikgPDwgTVBJX1NHRV9GTEFHU19TSElGVCkKKyNkZWZpbmUgIE1QSV9TR0VfR0VUX0ZMQUdT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gKCh4Jk1QSV9TR0VfQ0hBSU5fT0ZGU0VUX01BU0spPj5NUElfU0dFX0NIQUlOX09GRlNFVF9TSElGVCkKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgUyB0IGEgbiBkIGEgciBkICAgIE0gZSBzIHMgYSBnIGUgICAgUyB0IHIgdSBjIHQgdSByIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogU3RhbmRhcmQgbWVzc2FnZSByZXF1ZXN0IGhlYWRlciBmb3IgYWxsIHJlcXVlc3QgbWVzc2FnZXMgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19SRVFVRVNUX0hFQURFUgoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkWzJdOyAgICAgIC8qIGZ1bmN0aW9uIHNwZWNpZmljICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxWzNdOyAgICAgLyogZnVuY3Rpb24gc3BlY2lmaWMgKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OworfSBNU0dfUkVRVUVTVF9IRUFERVIsIE1QSV9QT0lOVEVSIFBUUl9NU0dfUkVRVUVTVF9IRUFERVIsCisgIE1QSUhlYWRlcl90LCBNUElfUE9JTlRFUiBwTVBJSGVhZGVyX3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgRGVmYXVsdCBSZXBseSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0RFRkFVTFRfUkVQTFkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZFsyXTsgICAgICAvKiBmdW5jdGlvbiBzcGVjaWZpYyAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbM107ICAgICAvKiBmdW5jdGlvbiBzcGVjaWZpYyAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyWzJdOyAgICAgLyogZnVuY3Rpb24gc3BlY2lmaWMgKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsKK30gTVNHX0RFRkFVTFRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfREVGQVVMVF9SRVBMWSwKKyAgTVBJRGVmYXVsdFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBNUElEZWZhdWx0UmVwbHlfdDsKKworCisvKiBNc2dGbGFncyBkZWZpbml0aW9uIGZvciBhbGwgcmVwbGllcyAqLworCisjZGVmaW5lIE1QSV9NU0dGTEFHU19DT05USU5VQVRJT05fUkVQTFkgICAgICAgICAoMHg4MCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgICAgICAgICBJIE8gQyAgICBTIHQgYSB0IHUgcyAgIFYgYSBsIHUgZSBzCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgQ29tbW9uIElPQ1N0YXR1cyB2YWx1ZXMgZm9yIGFsbCByZXBsaWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU1VDQ0VTUyAgICAgICAgICAgICAgICAgICAoMHgwMDAwKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0lOVkFMSURfRlVOQ1RJT04gICAgICAgICAgKDB4MDAwMSkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19CVVNZICAgICAgICAgICAgICAgICAgICAgICgweDAwMDIpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfSU5WQUxJRF9TR0wgICAgICAgICAgICAgICAoMHgwMDAzKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0lOVEVSTkFMX0VSUk9SICAgICAgICAgICAgKDB4MDAwNCkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19SRVNFUlZFRCAgICAgICAgICAgICAgICAgICgweDAwMDUpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfSU5TVUZGSUNJRU5UX1JFU09VUkNFUyAgICAoMHgwMDA2KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0lOVkFMSURfRklFTEQgICAgICAgICAgICAgKDB4MDAwNykKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19JTlZBTElEX1NUQVRFICAgICAgICAgICAgICgweDAwMDgpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfT1BfU1RBVEVfTk9UX1NVUFBPUlRFRCAgICAoMHgwMDA5KQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBDb25maWcgSU9DU3RhdHVzIHZhbHVlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19DT05GSUdfSU5WQUxJRF9BQ1RJT04gICAgICgweDAwMjApCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfQ09ORklHX0lOVkFMSURfVFlQRSAgICAgICAoMHgwMDIxKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0NPTkZJR19JTlZBTElEX1BBR0UgICAgICAgKDB4MDAyMikKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19DT05GSUdfSU5WQUxJRF9EQVRBICAgICAgICgweDAwMjMpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfQ09ORklHX05PX0RFRkFVTFRTICAgICAgICAoMHgwMDI0KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0NPTkZJR19DQU5UX0NPTU1JVCAgICAgICAgKDB4MDAyNSkKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgU0NTSUlPIFJlcGx5IChTUEkgJiBGQ1ApIGluaXRpYXRvciB2YWx1ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0NTSV9SRUNPVkVSRURfRVJST1IgICAgICAoMHgwMDQwKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1NDU0lfSU5WQUxJRF9CVVMgICAgICAgICAgKDB4MDA0MSkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19TQ1NJX0lOVkFMSURfVEFSR0VUSUQgICAgICgweDAwNDIpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0NTSV9ERVZJQ0VfTk9UX1RIRVJFICAgICAoMHgwMDQzKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1NDU0lfREFUQV9PVkVSUlVOICAgICAgICAgKDB4MDA0NCkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19TQ1NJX0RBVEFfVU5ERVJSVU4gICAgICAgICgweDAwNDUpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0NTSV9JT19EQVRBX0VSUk9SICAgICAgICAoMHgwMDQ2KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1NDU0lfUFJPVE9DT0xfRVJST1IgICAgICAgKDB4MDA0NykKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19TQ1NJX1RBU0tfVEVSTUlOQVRFRCAgICAgICgweDAwNDgpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0NTSV9SRVNJRFVBTF9NSVNNQVRDSCAgICAoMHgwMDQ5KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1NDU0lfVEFTS19NR01UX0ZBSUxFRCAgICAgKDB4MDA0QSkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19TQ1NJX0lPQ19URVJNSU5BVEVEICAgICAgICgweDAwNEIpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0NTSV9FWFRfVEVSTUlOQVRFRCAgICAgICAoMHgwMDRDKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBGb3IgdXNlIGJ5IFNDU0kgSW5pdGlhdG9yIGFuZCBTQ1NJIFRhcmdldCBlbmQtdG8tZW5kIGRhdGEgcHJvdGVjdGlvbiAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19FRURQX0NSQ19FUlJPUiAgICAgICAgICAgICgweDAwNEQpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfRUVEUF9MQkFfVEFHX0VSUk9SICAgICAgICAoMHgwMDRFKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0VFRFBfQVBQX1RBR19FUlJPUiAgICAgICAgKDB4MDA0RikKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBTQ1NJIChTUEkgJiBGQ1ApIHRhcmdldCB2YWx1ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19UQVJHRVRfUFJJT1JJVFlfSU8gICAgICAgICAoMHgwMDYwKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1RBUkdFVF9JTlZBTElEX1BPUlQgICAgICAgICgweDAwNjEpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfVEFSR0VUX0lOVkFMSURfSU9DSU5ERVggICAgKDB4MDA2MikgICAvKiBvYnNvbGV0ZSAqLworI2RlZmluZSBNUElfSU9DU1RBVFVTX1RBUkdFVF9JTlZBTElEX0lPX0lOREVYICAgICgweDAwNjIpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfVEFSR0VUX0FCT1JURUQgICAgICAgICAgICAgKDB4MDA2MykKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19UQVJHRVRfTk9fQ09OTl9SRVRSWUFCTEUgICAoMHgwMDY0KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX1RBUkdFVF9OT19DT05ORUNUSU9OICAgICAgICgweDAwNjUpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfVEFSR0VUX1hGRVJfQ09VTlRfTUlTTUFUQ0ggKDB4MDA2QSkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19UQVJHRVRfU1RTX0RBVEFfTk9UX1NFTlQgICAoMHgwMDZCKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBBZGRpdGlvbmFsIEZDUCB0YXJnZXQgdmFsdWVzIChvYnNvbGV0ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19UQVJHRVRfRkNfQUJPUlRFRCAgICAgICAgICgweDAwNjYpICAgIC8qIG9ic29sZXRlICovCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfVEFSR0VUX0ZDX1JYX0lEX0lOVkFMSUQgICAoMHgwMDY3KSAgICAvKiBvYnNvbGV0ZSAqLworI2RlZmluZSBNUElfSU9DU1RBVFVTX1RBUkdFVF9GQ19ESURfSU5WQUxJRCAgICAgKDB4MDA2OCkgICAgLyogb2Jzb2xldGUgKi8KKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19UQVJHRVRfRkNfTk9ERV9MT0dHRURfT1VUICgweDAwNjkpICAgIC8qIG9ic29sZXRlICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIEZpYnJlIENoYW5uZWwgRGlyZWN0IEFjY2VzcyB2YWx1ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBNUElfSU9DU1RBVFVTX0ZDX0FCT1JURUQgICAgICAgICAgICAgICAgKDB4MDA2NikKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19GQ19SWF9JRF9JTlZBTElEICAgICAgICAgICgweDAwNjcpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfRkNfRElEX0lOVkFMSUQgICAgICAgICAgICAoMHgwMDY4KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0ZDX05PREVfTE9HR0VEX09VVCAgICAgICAgKDB4MDA2OSkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19GQ19FWENIQU5HRV9DQU5DRUxFRCAgICAgICgweDAwNkMpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIExBTiB2YWx1ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBNUElfSU9DU1RBVFVTX0xBTl9ERVZJQ0VfTk9UX0ZPVU5EICAgICAgKDB4MDA4MCkKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19MQU5fREVWSUNFX0ZBSUxVUkUgICAgICAgICgweDAwODEpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfTEFOX1RSQU5TTUlUX0VSUk9SICAgICAgICAoMHgwMDgyKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0xBTl9UUkFOU01JVF9BQk9SVEVEICAgICAgKDB4MDA4MykKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19MQU5fUkVDRUlWRV9FUlJPUiAgICAgICAgICgweDAwODQpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfTEFOX1JFQ0VJVkVfQUJPUlRFRCAgICAgICAoMHgwMDg1KQorI2RlZmluZSBNUElfSU9DU1RBVFVTX0xBTl9QQVJUSUFMX1BBQ0tFVCAgICAgICAgKDB4MDA4NikKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19MQU5fQ0FOQ0VMRUQgICAgICAgICAgICAgICgweDAwODcpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIFNlcmlhbCBBdHRhY2hlZCBTQ1NJIHZhbHVlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfU0FTX1NNUF9SRVFVRVNUX0ZBSUxFRCAgICAoMHgwMDkwKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBJbmJhbmQgdmFsdWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19JTkJBTkRfQUJPUlRFRCAgICAgICAgICAgICgweDAwOTgpCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfSU5CQU5EX05PX0NPTk5FQ1RJT04gICAgICAoMHgwMDk5KQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBEaWFnbm9zdGljIFRvb2xzIHZhbHVlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBJX0lPQ1NUQVRVU19ESUFHTk9TVElDX1JFTEVBU0VEICAgICAgICgweDAwQTApCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgSU9DU3RhdHVzIGZsYWcgdG8gaW5kaWNhdGUgdGhhdCBsb2cgaW5mbyBpcyBhdmFpbGFibGUgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NTVEFUVVNfRkxBR19MT0dfSU5GT19BVkFJTEFCTEUgICAoMHg4MDAwKQorI2RlZmluZSBNUElfSU9DU1RBVFVTX01BU0sgICAgICAgICAgICAgICAgICAgICAgKDB4N0ZGRikKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgTG9nSW5mbyBUeXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9JT0NMT0dJTkZPX1RZUEVfTUFTSyAgICAgICAgICAgICAgICAoMHhGMDAwMDAwMCkKKyNkZWZpbmUgTVBJX0lPQ0xPR0lORk9fVFlQRV9TSElGVCAgICAgICAgICAgICAgICgyOCkKKyNkZWZpbmUgTVBJX0lPQ0xPR0lORk9fVFlQRV9OT05FICAgICAgICAgICAgICAgICgweDApCisjZGVmaW5lIE1QSV9JT0NMT0dJTkZPX1RZUEVfU0NTSSAgICAgICAgICAgICAgICAoMHgxKQorI2RlZmluZSBNUElfSU9DTE9HSU5GT19UWVBFX0ZDICAgICAgICAgICAgICAgICAgKDB4MikKKyNkZWZpbmUgTVBJX0lPQ0xPR0lORk9fVFlQRV9TQVMgICAgICAgICAgICAgICAgICgweDMpCisjZGVmaW5lIE1QSV9JT0NMT0dJTkZPX1RZUEVfSVNDU0kgICAgICAgICAgICAgICAoMHg0KQorI2RlZmluZSBNUElfSU9DTE9HSU5GT19MT0dfREFUQV9NQVNLICAgICAgICAgICAgKDB4MEZGRkZGRkYpCisKKworI2VuZGlmCmRpZmYgLS1naXQgYS9kcml2ZXJzL21lc3NhZ2UvZnVzaW9uL2xzaS9tcGlfY25mZy5oIGIvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX2NuZmcuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hNTY4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GVkIHVzaW5nIE1QSV9QT0lOVEVSLgorICogIDAyLTI3LTAxICAwMS4wMS4wOSAgUmVwbGFjZWQgTVBJX0NPTkZJR19QQUdFVFlQRV9TQ1NJX0xVTiB3aXRoCisgKiAgICAgICAgICAgICAgICAgICAgICBNUElfQ09ORklHX1BBR0VUWVBFX1JBSURfVk9MVU1FLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgZGVmaW5pdGlvbnMgYW5kIHN0cnVjdHVyZXMgZm9yIElPQyBQYWdlIDIgYW5kCisgKiAgICAgICAgICAgICAgICAgICAgICBSQUlEIFZvbHVtZSBQYWdlIDIuCisgKiAgMDMtMjctMDEgIDAxLjAxLjEwICBBZGRlZCBDT05GSUdfUEFHRV9GQ19QT1JUXzggYW5kIENPTkZJR19QQUdFX0ZDX1BPUlRfOS4KKyAqICAgICAgICAgICAgICAgICAgICAgIENPTkZJR19QQUdFX0ZDX1BPUlRfMyBub3cgc3VwcG9ydHMgcGVyc2lzdGVudCBieSBESUQuCisgKiAgICAgICAgICAgICAgICAgICAgICBBZGRlZCBWZW5kb3JJZCBhbmQgUHJvZHVjdFJldkxldmVsIGZpZWxkcyB0bworICogICAgICAgICAgICAgICAgICAgICAgUkFJRFZPTDJfSU1fUEhZU19JRCBzdHJ1Y3QuCisgKiAgICAgICAgICAgICAgICAgICAgICBNb2RpZmllZCB2YWx1ZXMgZm9yIE1QSV9GQ1BPUlRQQUdFMF9GTEFHU19BVFRBQ0hfCisgKiAgICAgICAgICAgICAgICAgICAgICBkZWZpbmVzIHRvIG1ha2UgdGhlbSBjb21wYXRpYmxlIHRvIE1QSSB2ZXJzaW9uIDEuMC4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIHN0cnVjdHVyZSBvZmZzZXQgY29tbWVudHMuCisgKiAgMDQtMDktMDEgIDAxLjAxLjExICBBZGRlZCBzb21lIG5ldyBkZWZpbmVzIGZvciB0aGUgUGFnZUFkZHJlc3MgZmllbGQgYW5kCisgKiAgICAgICAgICAgICAgICAgICAgICByZW1vdmVkIHNvbWUgb2Jzb2xldGUgb25lcy4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIElPIFVuaXQgUGFnZSAzLgorICogICAgICAgICAgICAgICAgICAgICAgTW9kaWZpZWQgZGVmaW5lcyBmb3IgU2NzaSBQb3J0IFBhZ2UgMi4KKyAqICAgICAgICAgICAgICAgICAgICAgIE1vZGlmaWVkIFJBSUQgVm9sdW1lIFBhZ2VzLgorICogIDA4LTA4LTAxICAwMS4wMi4wMSAgT3JpZ2luYWwgcmVsZWFzZSBmb3IgdjEuMiB3b3JrLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgU2VwSUQgYW5kIFNlcEJ1cyB0byBSVlAyIElNUGh5c2ljYWxEaXNrIHN0cnVjdC4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRlZmluZXMgZm9yIHRoZSBTRVAgYml0cyBpbiBSVlAyIFZvbHVtZVNldHRpbmdzLgorICogICAgICAgICAgICAgICAgICAgICAgTW9kaWZpZWQgdGhlIERldmljZVNldHRpbmdzIGZpZWxkIGluIFJWUDIgdG8gdXNlIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgcHJvcGVyIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRlZmluZXMgZm9yIFNFUywgU0FGLVRFLCBhbmQgY3Jvc3MgY2hhbm5lbCBmb3IKKyAqICAgICAgICAgICAgICAgICAgICAgIElPQ1BhZ2UyIENhcGFiaWxpdGllc0ZsYWdzLgorICogICAgICAgICAgICAgICAgICAgICAgUmVtb3ZlZCBkZWZpbmUgZm9yIE1QSV9JT1VOSVRQQUdFMl9GTEFHU19SQUlEX0RJU0FCTEUuCisgKiAgICAgICAgICAgICAgICAgICAgICBSZW1vdmVkIGRlZmluZSBmb3IKKyAqICAgICAgICAgICAgICAgICAgICAgIE1QSV9TQ1NJUE9SVFBBR0UyX1BPUlRfRkxBR1NfUEFSSVRZX0VOQUJMRS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRlZmluZSBmb3IgTVBJX0NPTkZJR19QQUdFQVRUUl9ST19QRVJTSVNURU5ULgorICogIDA4LTI5LTAxIDAxLjAyLjAyICAgRml4ZWQgdmFsdWUgZm9yIE1QSV9NQU5VRkFDVFBBR0VfREVWSURfNTNDMTAzNS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRlZmluZXMgZm9yIE1QSV9GQ1BPUlRQQUdFMV9GTEFHU19IQVJEX0FMUEFfT05MWQorICogICAgICAgICAgICAgICAgICAgICAgYW5kIE1QSV9GQ1BPUlRQQUdFMV9GTEFHU19JTU1FRElBVEVfRVJST1JfUkVQTFkuCisgKiAgICAgICAgICAgICAgICAgICAgICBSZW1vdmVkIE1QSV9TQ1NJUE9SVFBBR0UwX0NBUF9QQUNJTkdfVFJBTlNGRVJTLAorICogICAgICAgICAgICAgICAgICAgICAgTVBJX1NDU0lERVZQQUdFMF9OUF9QQUNJTkdfVFJBTlNGRVJTLCBhbmQKKyAqICAgICAgICAgICAgICAgICAgICAgIE1QSV9TQ1NJREVWUEFHRTFfUlBfUEFDSU5HX1RSQU5TRkVSUywgYW5kCisgKiAgICAgICAgICAgICAgICAgICAgICBNUElfU0NTSURFVlBBR0UxX0NPTkZfUFBSX0FMTE9XRUQuCisgKiAgICAgICAgICAgICAgICAgICAgICBBZGRlZCBkZWZpbmVzIGZvciBNUElfU0NTSURFVlBBR0UxX0NPTkZfV0RUUl9ESVNBTExPV0VECisgKiAgICAgICAgICAgICAgICAgICAgICBhbmQgTVBJX1NDU0lERVZQQUdFMV9DT05GX1NEVFJfRElTQUxMT1dFRC4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIE9uQnVzVGltZXJWYWx1ZSB0byBDT05GSUdfUEFHRV9TQ1NJX1BPUlRfMS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIHJlamVjdGVkIGJpdHMgdG8gU0NTSSBEZXZpY2UgUGFnZSAwIEluZm9ybWF0aW9uLgorICogICAgICAgICAgICAgICAgICAgICAgSW5jcmVhc2VkIHNpemUgb2YgQUxQQSBhcnJheSBpbiBGQyBQb3J0IFBhZ2UgMiBieSBvbmUKKyAqICAgICAgICAgICAgICAgICAgICAgIGFuZCByZW1vdmVkIGEgb25lIGJ5dGUgcmVzZXJ2ZWQgZmllbGQuCisgKiAgMDktMjgtMDEgMDEuMDIuMDMgICBTd2FwcGVkIE5lZ1dpcmVTcGVlZExvdyBhbmQgTmVnV2lyZVNwZWVkTG93IGluCisgKiAgICAgICAgICAgICAgICAgICAgICBDT05GSUdfUEFHRV9MQU5fMSB0byBtYXRjaCBwcmVmZXJyZWQgNjQtYml0IG9yZGVyaW5nLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgc3RydWN0dXJlcyBmb3IgTWFudWZhY3R1cmluZyBQYWdlIDQsIElPIFVuaXQKKyAqICAgICAgICAgICAgICAgICAgICAgIFBhZ2UgMywgSU9DIFBhZ2UgMywgSU9DIFBhZ2UgNCwgUkFJRCBWb2x1bWUgUGFnZSAwLCBhbmQKKyAqICAgICAgICAgICAgICAgICAgICAgIFJBSUQgUGh5c0Rpc2sgUGFnZSAwLgorICogIDEwLTA0LTAxIDAxLjAyLjA0ICAgQWRkZWQgZGVmaW5lIGZvciBNUElfQ09ORklHX1BBR0VUWVBFX1JBSURfUEhZU0RJU0suCisgKiAgICAgICAgICAgICAgICAgICAgICBNb2RpZmllZCBzb21lIG9mIHRoZSBuZXcgZGVmaW5lcyB0byBtYWtlIHRoZW0gMzIKKyAqICAgICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlciB1bmlxdWUuCisgKiAgICAgICAgICAgICAgICAgICAgICBNb2RpZmllZCBob3cgdmFyaWFibGUgbGVuZ3RoIHBhZ2VzIChhcnJheXMpIGFyZSBkZWZpbmVkLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgZ2VuZXJpYyBkZW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xhZ3MgZGVmaW5lcyBmb3IgQ09ORklHX1BBR0VfRkNfREVWSUNFXzAuCisgKiAgMDQtMDEtMDMgMDEuMDIuMTEgICBBZGRlZCBSUl9UT1YgZmllbGQgYW5kIGFkZGl0aW9uYWwgRmxhZ3MgZGVmaW5lcyBmb3IKKyAqICAgICAgICAgICAgICAgICAgICAgIENPTkZJR19QQUdFX0ZDX1BPUlRfMS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIGRlZmluZSBNUElfRkNQT1JUUEFHRTVfRkxBR1NfRElTQUJMRSB0byBkaXNhYmxlCisgKiAgICAgICAgICAgICAgICAgICAgICBhbiBhbGlhcy4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIG1vcmUgZGV2aWNlIGlkIGRlZmluZXMuCisgKiAgMDYtMjYtMDMgMDEuMDIuMTIgICBBZGRlZCBNUElfSU9VTklUUEFHRTFfSVJfVVNFX1NUQVRJQ19WT0xVTUVfSUQgZGVmaW5lLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgVGFyZ2V0Q29uZmlnIGFuZCBJRENvbmZpZyBmaWVsZHMgdG8KKyAqICAgICAgICAgICAgICAgICAgICAgIENPTkZJR19QQUdFX1NDU0lfUE9SVF8xLgorICogICAgICAgICAgICAgICAgICAgICAgQWRkZWQgbW9yZSBQb3J0RmxhZ3MgZGVmaW5lcyBmb3IgQ09ORklHX1BBR0VfU0NTSV9QT1JUXzIKKyAqICAgICAgICAgICAgICAgICAgICAgIHRvIGNvbnRyb2wgRFYuCisgKiAgICAgICAgICAgICAgICAgICAgICBBZGRlZCBtb3JlIEZsYWdzIGRlZmluZXMgZm9yIENPTkZJR19QQUdFX0ZDX1BPUlRfMS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEluIENPTkZJR19QQUdFX0ZDX0RFVklDRV8wLCByZXBsYWNlZCBSZXNlcnZlZDEgZmllbGQKKyAqICAgICAgICAgICAgICAgICAgICAgIHdpdGggQURJU0NIYXJkQUxQQS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIE1QSV9GQ19ERVZJQ0VfUEFHRTBfUFJPVF9GQ1BfUkVUUlkgZGVmaW5lLgorICogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKi8KKworI2lmbmRlZiBNUElfQ05GR19ICisjZGVmaW5lIE1QSV9DTkZHX0gKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgQyBvIG4gZiBpIGcgICAgTSBlIHMgcyBhIGcgZSAgICBhIG4gZCAgICBTIHQgciB1IGMgdCB1IHIgZSBzCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0hFQURFUgoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBhZ2VWZXJzaW9uOyAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQYWdlTGVuZ3RoOyAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUGFnZU51bWJlcjsgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBhZ2VUeXBlOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KK30gZkNPTkZJR19QQUdFX0hFQURFUiwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0hFQURFUiwKKyAgQ29uZmlnUGFnZUhlYWRlcl90LCBNUElfUE9JTlRFUiBwQ29uZmlnUGFnZUhlYWRlcl90OworCit0eXBlZGVmIHVuaW9uIF9DT05GSUdfUEFHRV9IRUFERVJfVU5JT04KK3sKKyAgIENvbmZpZ1BhZ2VIZWFkZXJfdCAgU3RydWN0OworICAgVTggICAgICAgICAgICAgICAgICBCeXRlc1s0XTsKKyAgIFUxNiAgICAgICAgICAgICAgICAgV29yZDE2WzJdOworICAgVTMyICAgICAgICAgICAgICAgICBXb3JkMzI7Cit9IENvbmZpZ1BhZ2VIZWFkZXJVbmlvbiwgTVBJX1BPSU5URVIgcENvbmZpZ1BhZ2VIZWFkZXJVbmlvbiwKKyAgZkNPTkZJR19QQUdFX0hFQURFUl9VTklPTiwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0hFQURFUl9VTklPTjsKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19FWFRFTkRFRF9QQUdFX0hFQURFUgoreworICAgIFU4ICAgICAgICAgICAgICAgICAgUGFnZVZlcnNpb247ICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgUGFnZU51bWJlcjsgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgUGFnZVR5cGU7ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgRXh0UGFnZUxlbmd0aDsgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgRXh0UGFnZVR5cGU7ICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworfSBmQ09ORklHX0VYVEVOREVEX1BBR0VfSEVBREVSLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX0VYVEVOREVEX1BBR0VfSEVBREVSLAorICBDb25maWdFeHRlbmRlZFBhZ2VIZWFkZXJfdCwgTVBJX1BPSU5URVIgcENvbmZpZ0V4dGVuZGVkUGFnZUhlYWRlcl90OworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICBQYWdlVHlwZSBmaWVsZCB2YWx1ZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIE1QSV9DT05GSUdfUEFHRUFUVFJfUkVBRF9PTkxZICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9DT05GSUdfUEFHRUFUVFJfQ0hBTkdFQUJMRSAgICAgICAgICAgICAgKDB4MTApCisjZGVmaW5lIE1QSV9DT05GSUdfUEFHRUFUVFJfUEVSU0lTVEVOVCAgICAgICAgICAgICAgKDB4MjApCisjZGVmaW5lIE1QSV9DT05GSUdfUEFHRUFUVFJfUk9fUEVSU0lTVEVOVCAgICAgICAgICAgKDB4MzApCisjZGVmaW5lIE1QSV9DT05GSUdfUEFHRUFUVFJfTUFTSyAgICAgICAgICAgICAgICAgICAgKDB4RjApCisKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9JT19VTklUICAgICAgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9JT0MgICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9CSU9TICAgICAgICAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9TQ1NJX1BPUlQgICAgICAgICAgICAgICAoMHgwMykKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9TQ1NJX0RFVklDRSAgICAgICAgICAgICAoMHgwNCkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9GQ19QT1JUICAgICAgICAgICAgICAgICAoMHgwNSkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9GQ19ERVZJQ0UgICAgICAgICAgICAgICAoMHgwNikKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9MQU4gICAgICAgICAgICAgICAgICAgICAoMHgwNykKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9SQUlEX1ZPTFVNRSAgICAgICAgICAgICAoMHgwOCkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9NQU5VRkFDVFVSSU5HICAgICAgICAgICAoMHgwOSkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9SQUlEX1BIWVNESVNLICAgICAgICAgICAoMHgwQSkKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9JTkJBTkQgICAgICAgICAgICAgICAgICAoMHgwQikKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9FWFRFTkRFRCAgICAgICAgICAgICAgICAoMHgwRikKKyNkZWZpbmUgTVBJX0NPTkZJR19QQUdFVFlQRV9NQVNLICAgICAgICAgICAgICAgICAgICAoMHgwRikKKworI2RlZmluZSBNUElfQ09ORklHX1RZUEVOVU1fTUFTSyAgICAgICAgICAgICAgICAgICAgICgweDBGRkYpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICBFeHRQYWdlVHlwZSBmaWVsZCB2YWx1ZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIE1QSV9DT05GSUdfRVhUUEFHRVRZUEVfU0FTX0lPX1VOSVQgICAgICAgICAgKDB4MTApCisjZGVmaW5lIE1QSV9DT05GSUdfRVhUUEFHRVRZUEVfU0FTX0VYUEFOREVSICAgICAgICAgKDB4MTEpCisjZGVmaW5lIE1QSV9DT05GSUdfRVhUUEFHRVRZUEVfU0FTX0RFVklDRSAgICAgICAgICAgKDB4MTIpCisjZGVmaW5lIE1QSV9DT05GSUdfRVhUUEFHRVRZUEVfU0FTX1BIWSAgICAgICAgICAgICAgKDB4MTMpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICBQYWdlQWRkcmVzcyBmaWVsZCB2YWx1ZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIE1QSV9TQ1NJX1BPUlRfUEdBRF9QT1JUX01BU0sgICAgICAgICAgICAgICAgKDB4MDAwMDAwRkYpCisKKyNkZWZpbmUgTVBJX1NDU0lfREVWSUNFX1RBUkdFVF9JRF9NQVNLICAgICAgICAgICAgICAoMHgwMDAwMDBGRikKKyNkZWZpbmUgTVBJX1NDU0lfREVWSUNFX1RBUkdFVF9JRF9TSElGVCAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX1NDU0lfREVWSUNFX0JVU19NQVNLICAgICAgICAgICAgICAgICAgICAoMHgwMDAwRkYwMCkKKyNkZWZpbmUgTVBJX1NDU0lfREVWSUNFX0JVU19TSElGVCAgICAgICAgICAgICAgICAgICAoOCkKKworI2RlZmluZSBNUElfRkNfUE9SVF9QR0FEX1BPUlRfTUFTSyAgICAgICAgICAgICAgICAgICgweEYwMDAwMDAwKQorI2RlZmluZSBNUElfRkNfUE9SVF9QR0FEX1BPUlRfU0hJRlQgICAgICAgICAgICAgICAgICgyOCkKKyNkZWZpbmUgTVBJX0ZDX1BPUlRfUEdBRF9GT1JNX01BU0sgICAgICAgICAgICAgICAgICAoMHgwRjAwMDAwMCkKKyNkZWZp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NBU19ERVZJQ0VfUEdBRF9CVF9CVVNfU0hJRlQgICAgICAgICAgICAoOCkKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfUEdBRF9CVF9USURfTUFTSyAgICAgICAgICAgICAoMHgwMDAwMDBGRikKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfUEdBRF9CVF9USURfU0hJRlQgICAgICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfUEdBRF9IX0hBTkRMRV9NQVNLICAgICAgICAgICAoMHgwMDAwRkZGRikKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfUEdBRF9IX0hBTkRMRV9TSElGVCAgICAgICAgICAoMCkKKworI2RlZmluZSBNUElfU0FTX1BIWV9QR0FEX1BIWV9OVU1CRVJfTUFTSyAgICAgICAgICAgICgweDAwRkYwMDAwKQorI2RlZmluZSBNUElfU0FTX1BIWV9QR0FEX1BIWV9OVU1CRVJfU0hJRlQgICAgICAgICAgICgxNikKKyNkZWZpbmUgTVBJX1NBU19QSFlfUEdBRF9ERVZIQU5ETEVfTUFTSyAgICAgICAgICAgICAoMHgwMDAwRkZGRikKKyNkZWZpbmUgTVBJX1NBU19QSFlfUEdBRF9ERVZIQU5ETEVfU0hJRlQgICAgICAgICAgICAoMCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIENvbmZpZyBSZXF1ZXN0IE1lc3NhZ2UKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0NPTkZJRworeworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFjdGlvbjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBFeHRQYWdlTGVuZ3RoOyAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRXh0UGFnZVR5cGU7ICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyWzhdOyAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMTRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUGFnZUFkZHJlc3M7ICAgICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFNHRV9JT19VTklPTiAgICAgICAgICAgIFBhZ2VCdWZmZXJTR0U7ICAgICAgICAgICAgICAvKiAxQ2ggKi8KK30gTVNHX0NPTkZJRywgTVBJX1BPSU5URVIgUFRSX01TR19DT05GSUcsCisgIENvbmZpZ190LCBNUElfUE9JTlRFUiBwQ29uZmlnX3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICBBY3Rpb24gZmllbGQgdmFsdWVzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX0hFQURFUiAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX1JFQURfQ1VSUkVOVCAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX1dSSVRFX0NVUlJFTlQgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX0RFRkFVTFQgICAgICAgICAgICAgICgweDAzKQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX1dSSVRFX05WUkFNICAgICAgICAgICgweDA0KQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX1JFQURfREVGQVVMVCAgICAgICAgICgweDA1KQorI2RlZmluZSBNUElfQ09ORklHX0FDVElPTl9QQUdFX1JFQURfTlZSQU0gICAgICAgICAgICgweDA2KQorCisKKy8qIENvbmZpZyBSZXBseSBNZXNzYWdlICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0NPTkZJR19SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFjdGlvbjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBFeHRQYWdlTGVuZ3RoOyAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRXh0UGFnZVR5cGU7ICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyWzJdOyAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KK30gTVNHX0NPTkZJR19SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19DT05GSUdfUkVQTFksCisgIENvbmZpZ1JlcGx5X3QsIE1QSV9QT0lOVEVSIHBDb25maWdSZXBseV90OworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgQyBvIG4gZiBpIGcgdSByIGEgdCBpIG8gbiAgICBQIGEgZyBlIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIE1hbnVmYWN0dXJpbmcgQ29uZmlnIHBhZ2VzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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SURfU0FTMTA2NCAgICAgICAgICAgICAgKDB4MDA1MCkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR18wCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGlwTmFtZVsxNl07ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hpcFJldmlzaW9uWzhdOyAgICAgICAgICAgIC8qIDE0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJvYXJkTmFtZVsxNl07ICAgICAgICAgICAgICAvKiAxQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCb2FyZEFzc2VtYmx5WzE2XTsgICAgICAgICAgLyogMkNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQm9hcmRUcmFjZXJOdW1iZXJbMTZdOyAgICAgIC8qIDNDaCAqLworCit9IGZDT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzAsCisgIE1hbnVmYWN0dXJpbmdQYWdlMF90LCBNUElfUE9JTlRFUiBwTWFudWZhY3R1cmluZ1BhZ2UwX3Q7CisKKyNkZWZpbmUgTVBJX01BTlVGQUNUVVJJTkcwX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAoMHgwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR18xCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWUERbMjU2XTsgICAgICAgICAgICAgICAgICAgLyogM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0NPTkZJR19QQUdFX01BTlVGQUNUVVJJTkdfMgoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgTVBJX0NISVBfUkVWSVNJT05fSUQgICAgQ2hpcElkOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEh3U2V0dGluZ3NbTVBJX01BTl9QQUdFXzJfSFdfU0VUVElOR1NfV09SRFNdOy8qIDA4aCAqLworfSBmQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR18yLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR18yLAorICBNYW51ZmFjdHVyaW5nUGFnZTJfdCwgTVBJX1BPSU5URVIgcE1hbnVmYWN0dXJpbmdQYWdlMl90OworCisjZGVmaW5lIE1QSV9NQU5VRkFDVFVSSU5HMl9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICgweDAwKQorCisKKy8qCisgKiBIb3N0IGNvZGUgKGRyaXZlcnMsIEJJT1MsIHV0aWxpdGllcywgZXRjLikgc2hvdWxkIGxlYXZlIHRoaXMgZGVmaW5lIHNldCB0bworICogb25lIGFuZCBjaGVjayBIZWFkZXIuUGFnZUxlbmd0aCBhdCBydW50aW1lLgorICovCisjaWZuZGVmIE1QSV9NQU5fUEFHRV8zX0lORk9fV09SRFMKKyNkZWZpbmUgTVBJX01BTl9QQUdFXzNfSU5GT19XT1JEUyAgICAgICAgICAgKDEpCisjZW5kaWYKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX01BTlVGQUNUVVJJTkdfMworeworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgICAgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgTVBJX0NISVBfUkVWSVNJT05fSUQgICAgICAgICAgICAgICAgQ2hpcElkOyAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZm9bTVBJX01BTl9QQUdFXzNfSU5GT19XT1JEU107LyogMDhoICovCit9IGZDT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzMsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzMsCisgIE1hbnVmYWN0dXJpbmdQYWdlM190LCBNUElfUE9JTlRFUiBwTWFudWZhY3R1cmluZ1BhZ2UzX3Q7CisKKyNkZWZpbmUgTVBJX01BTlVGQUNUVVJJTkczX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgKDB4MDApCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX01BTlVGQUNUVVJJTkdfNAoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgICAgICAgIEhlYWRlcjsgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5mb09mZnNldDA7ICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZm9TaXplMDsgICAgICAgICAgLyogMDloICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmZvT2Zmc2V0MTsgICAgICAgIC8qIDBBaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5mb1NpemUxOyAgICAgICAgICAvKiAwQmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucXVpcnlTaXplOyAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucXVpcnlEYXRhWzU2XTsgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJU1ZvbHVtZVNldHRpbmdzOyAgIC8qIDQ4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSU1FVm9sdW1lU2V0dGluZ3M7ICAvKiA0Q2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElNVm9sdW1lU2V0dGluZ3M7ICAgLyogNTBoICovCit9IGZDT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzQsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzQsCisgIE1hbnVmYWN0dXJpbmdQYWdlNF90LCBNUElfUE9JTlRFUiBwTWFudWZhY3R1cmluZ1BhZ2U0X3Q7CisKKyNkZWZpbmUgTVBJX01BTlVGQUNUVVJJTkc0X1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgKDB4MDEpCisKKy8qIGRlZmluZXMgZm9yIHRoZSBGbGFncyBmaWVsZCAqLworI2RlZmluZSBNUElfTUFOUEFHRTRfSVJfTk9fTUlYX1NBU19TQVRBICAgICAgICAgICAgICAgICAoMHgwMSkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR181Cit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgICAgICAgICAgSGVhZGVyOyAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VXV0lEOyAgICAgICAgICAgLyogMDRoICovCit9IGZDT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzUsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzUsCisgIE1hbnVmYWN0dXJpbmdQYWdlNV90LCBNUElfUE9JTlRFUiBwTWFudWZhY3R1cmluZ1BhZ2U1X3Q7CisKKyNkZWZpbmUgTVBJX01BTlVGQUNUVVJJTkc1X1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgKDB4MDApCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX01BTlVGQUNUVVJJTkdfNgoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgICAgICAgIEhlYWRlcjsgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9kdWN0U3BlY2lmaWNJbmZvOy8qIDA0aCAqLworfSBmQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR182LCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfTUFOVUZBQ1RVUklOR182LAorICBNYW51ZmFjdHVyaW5nUGFnZTZfdCwgTVBJX1BPSU5URVIgcE1hbnVmYWN0dXJpbmdQYWdlNl90OworCisjZGVmaW5lIE1QSV9NQU5VRkFDVFVSSU5HNl9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICgweDAwKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgSU8gVW5pdCBDb25maWcgUGFnZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9JT19VTklUXzAKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFVuaXF1ZVZhbHVlOyAgICAgICAgICAgICAgICAvKiAwNGggKi8KK30gZkNPTkZJR19QQUdFX0lPX1VOSVRfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPX1VOSVRfMCwKKyAgSU9Vbml0UGFnZTBfdCwgTVBJX1BPSU5URVIgcElPVW5pdFBhZ2UwX3Q7CisKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UwX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0lPX1VOSVRfMQoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworfSBmQ09ORklHX1BBR0VfSU9fVU5JVF8xLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfSU9fVU5JVF8xLAorICBJT1VuaXRQYWdlMV90LCBNUElfUE9JTlRFUiBwSU9Vbml0UGFnZTFfdDsKKworI2RlZmluZSBNUElfSU9VTklUUEFHRTFfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKworLyogSU8gVW5pdCBQYWdlIDEgRmxhZ3MgZGVmaW5lcyAqLworI2RlZmluZSBNUElfSU9VTklUUEFHRTFfTVVMVElfRlVOQ1RJT04gICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMCkKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UxX1NJTkdMRV9GVU5DVElPTiAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDEpCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFMV9NVUxUSV9QQVRISU5HICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAyKQorI2RlZmluZSBNUElfSU9VTklUUEFHRTFfU0lOR0xFX1BBVEhJTkcgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMCkKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UxX0lSX1VTRV9TVEFUSUNfVk9MVU1FX0lEICAgICAgICAgKDB4MDAwMDAwMDQpCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFMV9ESVNBQkxFX1FVRVVFX0ZVTExfSEFORExJTkcgICAgICgweDAwMDAwMDIwKQorI2RlZmluZSBNUElfSU9VTklUUEFHRTFfRElTQUJMRV9JUiAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDA0MCkKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UxX0ZPUkNFXzMyICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwODApCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFMV9OQVRJVkVfQ09NTUFORF9RX0RJU0FCTEUgICAgICAgICgweDAwMDAwMTAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9NUElfQURBUFRFUl9JTkZPCit7CisgICAgVTggICAgICBQY2lCdXNOdW1iZXI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgUGNpRGV2aWNlQW5kRnVuY3Rpb25OdW1iZXI7ICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgIEFkYXB0ZXJGbGFnczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDJoICovCit9IE1QSV9BREFQVEVSX0lORk8sIE1QSV9QT0lOVEVSIFBUUl9NUElfQURBUFRFUl9JTkZPLAorICBNcGlBZGFwdGVySW5mb190LCBNUElfUE9JTlRFUiBwTXBpQWRhcHRlckluZm9fdDsKKworI2RlZmluZSBNUElfQURBUFRFUl9JTkZPX0ZMQUdTX0VNQkVEREVEICAgICAgICAgICAgICAgICAoMHgwMDAxKQorI2RlZmluZSBNUElfQURBUFRFUl9JTkZPX0ZMQUdTX0lOSVRfU1RBVFVTICAgICAgICAgICAgICAoMHgwMDAyKQorCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfSU9fVU5JVF8yCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQmlvc1ZlcnNpb247ICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIE1QSV9BREFQVEVSX0lORk8gICAgICAgIEFkYXB0ZXJPcmRlcls0XTsgICAgICAgICAgICAvKiAwQ2ggKi8KK30gZkNPTkZJR19QQUdFX0lPX1VOSVRfMiwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPX1VOSVRfMiwKKyAgSU9Vbml0UGFnZTJfdCwgTVBJX1BPSU5URVIgcElPVW5pdFBhZ2UyX3Q7CisKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UyX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UyX0ZMQUdTX1BBVVNFX09OX0VSUk9SICAgICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFMl9GTEFHU19WRVJCT1NFX0VOQUJMRSAgICAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfSU9VTklUUEFHRTJfRkxBR1NfQ09MT1JfVklERU9fRElTQUJMRSAgICAgICAoMHgwMDAwMDAwOCkKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UyX0ZMQUdTX0RPTlRfSE9PS19JTlRfNDAgICAgICAgICAgKDB4MDAwMDAwMTApCisKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UyX0ZMQUdTX0RFVl9MSVNUX0RJU1BMQVlfTUFTSyAgICAgKDB4MDAwMDAwRTApCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFMl9GTEFHU19JTlNUQUxMRURfREVWX0RJU1BMQVkgICAgICgweDAwMDAwMDAwKQorI2RlZmluZSBNUElfSU9VTklUUEFHRTJfRkxBR1NfQURBUFRFUl9ESVNQTEFZICAgICAgICAgICAoMHgwMDAwMDAyMCkKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UyX0ZMQUdTX0FEQVBURVJfREVWX0RJU1BMQVkgICAgICAgKDB4MDAwMDAwNDApCisKKworLyoKKyAqIEhvc3QgY29kZSAoZHJpdmVycywgQklPUywgdXRpbGl0aWVzLCBldGMuKSBzaG91bGQgbGVhdmUgdGhpcyBkZWZpbmUgc2V0IHRvCisgKiBvbmUgYW5kIGNoZWNrIEhlYWRlci5QYWdlTGVuZ3RoIGF0IHJ1bnRpbWUuCisgKi8KKyNpZm5kZWYgTVBJX0lPX1VOSVRfUEFHRV8zX0dQSU9fVkFMX01BWAorI2RlZmluZSBNUElfSU9fVU5JVF9QQUdFXzNfR1BJT19WQUxfTUFYICAgICAoMSkKKyNlbmRpZgorCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfSU9fVU5JVF8zCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEdQSU9Db3VudDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIEdQSU9WYWxbTVBJX0lPX1VOSVRfUEFHRV8zX0dQSU9fVkFMX01BWF07IC8qIDA4aCAqLworfSBmQ09ORklHX1BBR0VfSU9fVU5JVF8zLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfSU9fVU5JVF8zLAorICBJT1VuaXRQYWdlM190LCBNUElfUE9JTlRFUiBwSU9Vbml0UGFnZTNfdDsKKworI2RlZmluZSBNUElfSU9VTklUUEFHRTNfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKworI2RlZmluZSBNUElfSU9VTklUUEFHRTNfR1BJT19GVU5DVElPTl9NQVNLICAgICAgICAgICAgICAoMHhGQykKKyNkZWZpbmUgTVBJX0lPVU5JVFBBR0UzX0dQSU9fRlVOQ1RJT05fU0hJRlQgICAgICAgICAgICAgKDIpCisjZGVmaW5lIE1QSV9JT1VOSVRQQUdFM19HUElPX1NFVFRJTkdfT0ZGICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfSU9VTklUUEFHRTNfR1BJT19TRVRUSU5HX09OICAgICAgICAgICAgICAgICAoMHgwMSkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIElPQyBDb25maWcgUGFnZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9JT0NfMAoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVG90YWxOVlN0b3JlOyAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEZyZWVOVlN0b3JlOyAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBWZW5kb3JJRDsgICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgRGV2aWNlSUQ7ICAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJldmlzaW9uSUQ7ICAgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZFszXTsgICAgICAgICAgICAgICAgLyogMTFoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ2xhc3NDb2RlOyAgICAgICAgICAgICAgICAgIC8qIDE0aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFN1YnN5c3RlbVZlbmRvcklEOyAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBTdWJzeXN0ZW1JRDsgICAgICAgICAgICAgICAgLyogMUFoICovCit9IGZDT05GSUdfUEFHRV9JT0NfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPQ18wLAorICBJT0NQYWdlMF90LCBNUElfUE9JTlRFUiBwSU9DUGFnZTBfdDsKKworI2RlZmluZSBNUElfSU9DUEFHRTBfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfSU9DXzEKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDb2FsZXNjaW5nVGltZW91dDsgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29hbGVzY2luZ0RlcHRoOyAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBDSVNsb3ROdW07ICAgICAgICAgICAgICAgICAvKiAwRGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZFsyXTsgICAgICAgICAgICAgICAgLyogMEVoICovCit9IGZDT05GSUdfUEFHRV9JT0NfMSwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPQ18xLAorICBJT0NQYWdlMV90LCBNUElfUE9JTlRFUiBwSU9DUGFnZTFfdDsKKworI2RlZmluZSBNUElfSU9DUEFHRTFfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKworLyogZGVmaW5lcyBmb3IgdGhlIEZsYWdzIGZpZWxkICovCisjZGVmaW5lIE1QSV9JT0NQQUdFMV9FRURQX0hPU1RfU1VQUE9SVFNfRElGICAgICAgICAgICAgICgweDA4MDAwMDAwKQorI2RlZmluZSBNUElfSU9DUEFHRTFfRUVEUF9NT0RFX01BU0sgICAgICAgICAgICAgICAgICAgICAoMHgwNzAwMDAwMCkKKyNkZWZpbmUgTVBJX0lPQ1BBR0UxX0VFRFBfTU9ERV9PRkYgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDApCisjZGVmaW5lIE1QSV9JT0NQQUdFMV9FRURQX01PREVfVDEwICAgICAgICAgICAgICAgICAgICAgICgweDAxMDAwMDAwKQorI2RlZmluZSBNUElfSU9DUEFHRTFfRUVEUF9NT0RFX0xTSV8xICAgICAgICAgICAgICAgICAgICAoMHgwMjAwMDAwMCkKKyNkZWZpbmUgTVBJX0lPQ1BBR0UxX1JFUExZX0NPQUxFU0NJTkcgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDEpCisKKyNkZWZpbmUgTVBJX0lPQ1BBR0UxX1BDSVNMT1ROVU1fVU5LTk9XTiAgICAgICAgICAgICAgICAgKDB4RkYpCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0lPQ18yX1JBSURfVk9MCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZUlEOyAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVCdXM7ICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgVm9sdW1lSU9DOyAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZVBhZ2VOdW1iZXI7ICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVUeXBlOyAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgLyogMDVoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgIC8qIDA2aCAqLworfSBmQ09ORklHX1BBR0VfSU9DXzJfUkFJRF9WT0wsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9JT0NfMl9SQUlEX1ZPTCwKKyAgQ29uZmlnUGFnZUlvYzJSYWlkVm9sX3QsIE1QSV9QT0lOVEVSIHBDb25maWdQYWdlSW9jMlJhaWRWb2xfdDsKKworLyogSU9DIFBhZ2UgMiBWb2x1bWUgUkFJRCBUeXBlIHZhbHVlcywgYWxzbyB1c2VkIGluIFJBSUQgVm9sdW1lIHBhZ2VzICovCisKKyNkZWZpbmUgTVBJX1JBSURfVk9MX1RZUEVfSVMgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1JBSURfVk9MX1RZUEVfSU1FICAgICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1JBSURfVk9MX1RZUEVfSU0gICAgICAgICAgICAgICAgICAgICAgICAoMHgwMikKKworLyogSU9DIFBhZ2UgMiBWb2x1bWUgRmxhZ3MgdmFsdWVzICovCisKKyNkZWZpbmUgTVBJX0lPQ1BBR0UyX0ZMQUdfVk9MVU1FX0lOQUNUSVZFICAgICAgICAgICAoMHgwOCkKKworLyoKKyAqIEhvc3QgY29kZSAoZHJpdmVycywgQklPUywgdXRpbGl0aWVzLCBldGMuKSBzaG91bGQgbGVhdmUgdGhpcyBkZWZpbmUgc2V0IHRvCisgKiBvbmUgYW5kIGNoZWNrIEhlYWRlci5QYWdlTGVuZ3RoIGF0IHJ1bnRpbWUuCisgKi8KKyNpZm5kZWYgTVBJX0lPQ19QQUdFXzJfUkFJRF9WT0xVTUVfTUFYCisjZGVmaW5lIE1QSV9JT0NfUEFHRV8yX1JBSURfVk9MVU1FX01BWCAgICAgICgxKQorI2VuZGlmCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9JT0NfMgoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBDYXBhYmlsaXRpZXNGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIE51bUFjdGl2ZVZvbHVtZXM7ICAgICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgTWF4Vm9sdW1lczsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA5aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1BY3RpdmVQaHlzRGlza3M7ICAgICAgIC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lPQ18zX1BIWVNfRElTSworeworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza0lEOyAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgUGh5c0Rpc2tCdXM7ICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFBoeXNEaXNrSU9DOyAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza051bTsgICAgICAgICAgICAvKiAwM2ggKi8KK30gSU9DXzNfUEhZU19ESVNLLCBNUElfUE9JTlRFUiBQVFJfSU9DXzNfUEhZU19ESVNLLAorICBJb2MzUGh5c0Rpc2tfdCwgTVBJX1BPSU5URVIgcElvYzNQaHlzRGlza190OworCisvKgorICogSG9zdCBjb2RlIChkcml2ZXJzLCBCSU9TLCB1dGlsaXRpZXMsIGV0Yy4pIHNob3VsZCBsZWF2ZSB0aGlzIGRlZmluZSBzZXQgdG8KKyAqIG9uZSBhbmQgY2hlY2sgSGVhZGVyLlBhZ2VMZW5ndGggYXQgcnVudGltZS4KKyAqLworI2lmbmRlZiBNUElfSU9DX1BBR0VfM19QSFlTRElTS19NQVgKKyNkZWZpbmUgTVBJX0lPQ19QQUdFXzNfUEhZU0RJU0tfTUFYICAgICAgICAgKDEpCisjZW5kaWYKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0lPQ18zCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtUGh5c0Rpc2tzOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBJT0NfM19QSFlTX0RJU0sgICAgICAgICAgICAgUGh5c0Rpc2tbTVBJX0lPQ19QQUdFXzNfUEhZU0RJU0tfTUFYXTsgLyogMDhoICovCit9IGZDT05GSUdfUEFHRV9JT0NfMywgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPQ18zLAorICBJT0NQYWdlM190LCBNUElfUE9JTlRFUiBwSU9DUGFnZTNfdDsKKworI2RlZmluZSBNUElfSU9DUEFHRTNfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfSU9DXzRfU0VQCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFNFUFRhcmdldElEOyAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBTRVBCdXM7ICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgLyogMDJoICovCit9IElPQ180X1NFUCwgTVBJX1BPSU5URVIgUFRSX0lPQ180X1NFUCwKKyAgSW9jNFNlcF90LCBNUElfUE9JTlRFUiBwSW9jNFNlcF90OworCisvKgorICogSG9zdCBjb2RlIChkcml2ZXJzLCBCSU9TLCB1dGlsaXRpZXMsIGV0Yy4pIHNob3VsZCBsZWF2ZSB0aGlzIGRlZmluZSBzZXQgdG8KKyAqIG9uZSBhbmQgY2hlY2sgSGVhZGVyLlBhZ2VMZW5ndGggYXQgcnVudGltZS4KKyAqLworI2lmbmRlZiBNUElfSU9DX1BBR0VfNF9TRVBfTUFYCisjZGVmaW5lIE1QSV9JT0NfUEFHRV80X1NFUF9NQVggICAgICAgICAgICAgICgxKQorI2VuZGlmCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9JT0NfNAoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgQWN0aXZlU0VQOyAgICAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgTWF4U0VQOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwNWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBJT0NfNF9TRVAgICAgICAgICAgICAgICAgICAgU0VQW01QSV9JT0NfUEFHRV80X1NFUF9NQVhdOyAgICAvKiAwOGggKi8KK30gZkNPTkZJR19QQUdFX0lPQ180LCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfSU9DXzQsCisgIElPQ1BhZ2U0X3QsIE1QSV9QT0lOVEVSIHBJT0NQYWdlNF90OworCisjZGVmaW5lIE1QSV9JT0NQQUdFNF9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICAgICgweDAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9JT0NfNV9IT1RfU1BBUkUKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgUGh5c0Rpc2tOdW07ICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBIb3RTcGFyZVBvb2w7ICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworfSBJT0NfNV9IT1RfU1BBUkUsIE1QSV9QT0lOVEVSIFBUUl9JT0NfNV9IT1RfU1BBUkUsCisgIElvYzVIb3RTcGFyZV90LCBNUElfUE9JTlRFUiBwSW9jNUhvdFNwYXJlX3Q7CisKKy8qIElPQyBQYWdlIDUgSG90U3BhcmUgRmxhZ3MgKi8KKyNkZWZpbmUgTVBJX0lPQ19QQUdFXzVfSE9UX1NQQVJFX0FDVElWRSAgICAgICAgICAgICAgICAgKDB4MDEpCisKKy8qCisgKiBIb3N0IGNvZGUgKGRyaXZlcnMsIEJJT1MsIHV0aWxpdGllcywgZXRjLikgc2hvdWxkIGxlYXZlIHRoaXMgZGVmaW5lIHNldCB0bworICogb25lIGFuZCBjaGVjayBIZWFkZXIuUGFnZUxlbmd0aCBhdCBydW50aW1lLgorICovCisjaWZuZGVmIE1QSV9JT0NfUEFHRV81X0hPVF9TUEFSRV9NQVgKKyNkZWZpbmUgTVBJX0lPQ19QQUdFXzVfSE9UX1NQQVJFX01BWCAgICAgICAgKDEpCisjZW5kaWYKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0lPQ181Cit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1Ib3RTcGFyZXM7ICAgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgICAgIC8qIDA5aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAgICAgICAgIC8qIDBBaCAqLworICAgIElPQ181X0hPVF9TUEFSRSAgICAgICAgICAgICBIb3RTcGFyZVtNUElfSU9DX1BBR0VfNV9IT1RfU1BBUkVfTUFYXTsgLyogMENoICovCit9IGZDT05GSUdfUEFHRV9JT0NfNSwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lPQ181LAorICBJT0NQYWdlNV90LCBNUElfUE9JTlRFUiBwSU9DUGFnZTVfdDsKKworI2RlZmluZSBNUElfSU9DUEFHRTVfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIEJJT1MgUG9ydCBDb25maWcgUGFnZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9CSU9TXzEKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEJpb3NPcHRpb25zOyAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NTZXR0aW5nczsgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERldmljZVNldHRpbmdzOyAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBOdW1iZXJPZkRldmljZXM7ICAgICAgICAgICAgLyogMTRoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgIC8qIDE2aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPVGltZW91dEJsb2NrRGV2aWNlc05vblJNOyAvKiAxOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT1RpbWVvdXRTZXF1ZW50aWFsOyAgICAgICAgLyogMUFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9UaW1lb3V0T3RoZXI7ICAgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPVGltZW91dEJsb2NrRGV2aWNlc1JNOyAgICAvKiAxRWggKi8KK30gZkNPTkZJR19QQUdFX0JJT1NfMSwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0JJT1NfMSwKKyAgQklPU1BhZ2UxX3QsIE1QSV9QT0lOVEVSIHBCSU9TUGFnZTFfdDsKKworI2RlZmluZSBNUElfQklPU1BBR0UxX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKworLyogdmFsdWVzIGZvciB0aGUgQmlvc09wdGlvbnMgZmllbGQgKi8KKyNkZWZpbmUgTVBJX0JJT1NQQUdFMV9PUFRJT05TX1NQSV9FTkFCTEUgICAgICAgICAgICAgICAgKDB4MDAwMDA0MDApCisjZGVmaW5lIE1QSV9CSU9TUEFHRTFfT1BUSU9OU19GQ19FTkFCTEUgICAgICAgICAgICAgICAgICgweDAwMDAwMjAwKQorI2RlZmluZSBNUElfQklPU1BBR0UxX09QVElPTlNfU0FTX0VOQUJMRSAgICAgICAgICAgICAgICAoMHgwMDAwMDEwMCkKKyNkZWZpbmUgTVBJX0JJT1NQQUdFMV9PUFRJT05TX0RJU0FCTEVfQklPUyAgICAgICAgICAgICAgKDB4MDAwMDAwMDEpCisKKy8qIHZhbHVlcyBmb3IgdGhlIElPQ1NldHRpbmdzIGZpZWxkICovCisjZG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KKy8qIHZhbHVlcyBmb3IgdGhlIERldmljZVNldHRpbmdzIGZpZWxkICovCisjZGVmaW5lIE1QSV9CSU9TUEFHRTFfREVWU0VUX0RJU0FCTEVfU0VRX0xVTiAgICAgICAgICAgICgweDAwMDAwMDA4KQorI2RlZmluZSBNUElfQklPU1BBR0UxX0RFVlNFVF9ESVNBQkxFX1JNX0xVTiAgICAgICAgICAgICAoMHgwMDAwMDAwNCkKKyNkZWZpbmUgTVBJX0JJT1NQQUdFMV9ERVZTRVRfRElTQUJMRV9OT05fUk1fTFVOICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9CSU9TUEFHRTFfREVWU0VUX0RJU0FCTEVfT1RIRVJfTFVOICAgICAgICAgICgweDAwMDAwMDAxKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgU0NTSSBQb3J0IENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NDU0lfUE9SVF8wCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDYXBhYmlsaXRpZXM7ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUGh5c2ljYWxJbnRlcmZhY2U7ICAgICAgICAgIC8qIDA4aCAqLworfSBmQ09ORklHX1BBR0VfU0NTSV9QT1JUXzAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9TQ1NJX1BPUlRfMCwKKyAgU0NTSVBvcnRQYWdlMF90LCBNUElfUE9JTlRFUiBwU0NTSVBvcnRQYWdlMF90OworCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICgweDAxKQorCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX0NBUF9JVSAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMF9DQVBfRFQgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfQ0FQX1FBUyAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDQpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX0NBUF9NSU5fU1lOQ19QRVJJT0RfTUFTSyAgICAgICgweDAwMDBGRjAwKQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMF9TWU5DX0FTWU5DICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfU1lOQ181ICAgICAgICAgICAgICAgICAgICAgICAgKDB4MzIpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1NZTkNfMTAgICAgICAgICAgICAgICAgICAgICAgICgweDE5KQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMF9TWU5DXzIwICAgICAgICAgICAgICAgICAgICAgICAoMHgwQykKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfU1lOQ18zM18zMyAgICAgICAgICAgICAgICAgICAgKDB4MEIpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1NZTkNfNDAgICAgICAgICAgICAgICAgICAgICAgICgweDBBKQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMF9TWU5DXzgwICAgICAgICAgICAgICAgICAgICAgICAoMHgwOSkKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfU1lOQ18xNjAgICAgICAgIC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TSVBPUlRQQUdFMF9QSFlfU0lHTkFMX1RZUEVfTUFTSyAgICAgICAgICAoMHgwMDAwMDAwMykKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfUEhZX1NJR05BTF9IVkQgICAgICAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1BIWV9TSUdOQUxfU0UgICAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMF9QSFlfU0lHTkFMX0xWRCAgICAgICAgICAgICAgICAoMHgwMykKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfUEhZX01BU0tfQ09OTkVDVEVEX0lEICAgICAgICAgKDB4RkYwMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1BIWV9TSElGVF9DT05ORUNURURfSUQgICAgICAgICgyNCkKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTBfUEhZX0JVU19GUkVFX0NPTk5FQ1RFRF9JRCAgICAgKDB4RkUpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UwX1BIWV9VTktOT1dOX0NPTk5FQ1RFRF9JRCAgICAgICgweEZGKQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9TQ1NJX1BPUlRfMQoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ29uZmlndXJhdGlvbjsgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE9uQnVzVGltZXJWYWx1ZTsgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUYXJnZXRDb25maWc7ICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZ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ovCisgICAgVTE2ICAgICBEZXZpY2VGbGFnczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworfSBNUElfREVWSUNFX0lORk8sIE1QSV9QT0lOVEVSIFBUUl9NUElfREVWSUNFX0lORk8sCisgIE1waURldmljZUluZm9fdCwgTVBJX1BPSU5URVIgcE1waURldmljZUluZm9fdDsKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NDU0lfUE9SVF8yCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgIFBvcnRGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICBQb3J0U2V0dGluZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIE1QSV9ERVZJQ0VfSU5GTyAgICAgRGV2aWNlU2V0dGluZ3NbMTZdOyAgICAgICAgICAgICAvKiAwQ2ggKi8KK30gZkNPTkZJR19QQUdFX1NDU0lfUE9SVF8yLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0NTSV9QT1JUXzIsCisgIFNDU0lQb3J0UGFnZTJfdCwgTVBJX1BPSU5URVIgcFNDU0lQb3J0UGFnZTJfdDsKKworI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMl9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICAgKDB4MDIpCisKKy8qIFBvcnRGbGFncyB2YWx1ZXMgKi8KKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTJfUE9SVF9GTEFHU19TQ0FOX0hJR0hfVE9fTE9XICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMl9QT1JUX0ZMQUdTX0FWT0lEX1NDU0lfUkVTRVQgICAgICAgKDB4MDAwMDAwMDQpCis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worI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMl9ERVZJQ0VfRElTQ09OTkVDVF9FTkFCTEUgICAgICAgICAgKDB4MDAwMSkKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTJfREVWSUNFX0lEX1NDQU5fRU5BQkxFICAgICAgICAgICAgICgweDAwMDIpCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UyX0RFVklDRV9MVU5fU0NBTl9FTkFCTEUgICAgICAgICAgICAoMHgwMDA0KQorI2RlZmluZSBNUElfU0NTSVBPUlRQQUdFMl9ERVZJQ0VfVEFHX1FVRVVFX0VOQUJMRSAgICAgICAgICAgKDB4MDAwOCkKKyNkZWZpbmUgTVBJX1NDU0lQT1JUUEFHRTJfREVWSUNFX1dJREVfRElTQUJMRSAgICAgICAgICAgICAgICgweDAwMTApCisjZGVmaW5lIE1QSV9TQ1NJUE9SVFBBR0UyX0RFVklDRV9CT09UX0NIT0lDRSAgICAgICAgICAgICAgICAoMHgwMDIwKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgU0NTSSBUYXJnZXQgRGV2aWNlIENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NDU0lfREVWSUNFXzAKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE5lZ290aWF0ZWRQYXJhbWV0ZXJzOyAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJbmZvcm1hdGlvbjsgICAgICAgICAgICAgICAgLyogMDhoICovCit9IGZDT05GSUdfUEFHRV9TQ1NJX0RFVklDRV8wLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0NTSV9ERVZJQ0VfMCwKKyAgU0NTSURldmljZVBhZ2UwX3QsIE1QSV9QT0lOVEVSIHBTQ1NJRGV2aWNlUGFnZTBfdDsKKworI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICAoMHgwMykKKworI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX05QX0lVICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMSkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9OUF9EVCAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfTlBfUUFTICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX05QX0hPTERfTUNTICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwOCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9OUF9XUl9GTE9XICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMTApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfTlBfUkRfU1RSTSAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDIwKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX05QX1JUSSAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDA0MCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9OUF9QQ09NUF9FTiAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwODApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfTlBfTkVHX1NZTkNfUEVSSU9EX01BU0sgICAgICAgICgweDAwMDBGRjAwKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX05QX1NISUZUX1NZTkNfUEVSSU9EICAgICAgICAgICAoOCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9OUF9ORUdfU1lOQ19PRkZTRVRfTUFTSyAgICAgICAgKDB4MDBGRjAwMDApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfTlBfU0hJRlRfU1lOQ19PRkZTRVQgICAgICAgICAgICgxNikKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9OUF9XSURFICAgICAgICAgICAgICAgICAgICAgICAgKDB4MjAwMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfTlBfQUlQICAgICAgICAgICAgICAgICAgICAgICAgICgweDgwMDAwMDAwKQorCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfSU5GT19QQVJBTVNfTkVHT1RJQVRFRCAgICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UwX0lORk9fU0RUUl9SRUpFQ1RFRCAgICAgICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMF9JTkZPX1dEVFJfUkVKRUNURUQgICAgICAgICAgICAgKDB4MDAwMDAwMDQpCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTBfSU5GT19QUFJfUkVKRUNURUQgICAgICAgICAgICAgICgweDAwMDAwMDA4KQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9TQ1NJX0RFVklDRV8xCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXF1ZXN0ZWRQYXJhbWV0ZXJzOyAgICAgICAgLyogMDRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb247ICAgICAgICAgICAgICAvKiAwQ2ggKi8KK30gZkNPTkZJR19QQUdFX1NDU0lfREVWSUNFXzEsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9TQ1NJX0RFVklDRV8xLAorICBTQ1NJRGV2aWNlUGFnZTFfdCwgTVBJX1BPSU5URVIgcFNDU0lEZXZpY2VQYWdlMV90OworCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICgweDA0KQorCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfUlBfSVUgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX1JQX0RUICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9SUF9RQVMgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDQpCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfUlBfSE9MRF9NQ1MgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDA4KQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX1JQX1dSX0ZMT1cgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAxMCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9SUF9SRF9TVFJNICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMjApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfUlBfUlRJICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDQwKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX1JQX1BDT01QX0VOICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDA4MCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9SUF9NSU5fU1lOQ19QRVJJT0RfTUFTSyAgICAgICAgKDB4MDAwMEZGMDApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfUlBfU0hJRlRfTUlOX1NZTkNfUEVSSU9EICAgICAgICg4KQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX1JQX01BWF9TWU5DX09GRlNFVF9NQVNLICAgICAgICAoMHgwMEZGMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9SUF9TSElGVF9NQVhfU1lOQ19PRkZTRVQgICAgICAgKDE2KQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX1JQX1dJREUgICAgICAgICAgICAgICAgICAgICAgICAoMHgyMDAwMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9SUF9BSVAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4ODAwMDAwMDApCisKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9DT05GX1dEVFJfRElTQUxMT1dFRCAgICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTFfQ09ORl9TRFRSX0RJU0FMTE9XRUQgICAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UxX0NPTkZfRVhURU5ERURfUEFSQU1TX0VOQUJMRSAgICAoMHgwMDAwMDAwOCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMV9DT05GX0ZPUkNFX1BQUl9NU0cgICAgICAgICAgICAgKDB4MDAwMDAwMTApCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NDU0lfREVWSUNFXzIKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERvbWFpblZhbGlkYXRpb247ICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICA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QTF9TRUxFQ1RfTUFTSyAgICAgICAoMHgwMDBDMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMl9EUFNfQklUXzEwX1BMX1NFTEVDVF9NQVNLICAgICAgKDB4MDAzMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTJfRFBTX0JJVF8xMV9QTF9TRUxFQ1RfTUFTSyAgICAgICgweDAwQzAwMDAwKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UyX0RQU19CSVRfMTJfUExfU0VMRUNUX01BU0sgICAgICAoMHgwMzAwMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFMl9EUFNfQklUXzEzX1BMX1NFTEVDVF9NQVNLICAgICAgKDB4MEMwMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJREVWUEFHRTJfRFBTX0JJVF8xNF9QTF9TRUxFQ1RfTUFTSyAgICAgICgweDMwMDAwMDAwKQorI2RlZmluZSBNUElfU0NTSURFVlBBR0UyX0RQU19CSVRfMTVfUExfU0VMRUNUX01BU0sgICAgICAoMHhDMDAwMDAwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfU0NTSV9ERVZJQ0VfMworeworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgTXNnUmVqZWN0Q291bnQ7ICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFBoYXNlRXJyb3JDb3VudDsgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBQYXJpdHlFcnJvckNvdW50OyAgICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDBBaCAqLworfSBmQ09ORklHX1BBR0VfU0NTSV9ERVZJQ0VfMywgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX1NDU0lfREVWSUNFXzMsCisgIFNDU0lEZXZpY2VQYWdlM190LCBNUElfUE9JTlRFUiBwU0NTSURldmljZVBhZ2UzX3Q7CisKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFM19QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgKDB4MDApCisKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFM19NQVhfQ09VTlRFUiAgICAgICAgICAgICAgICAgICAgKDB4RkZGRSkKKyNkZWZpbmUgTVBJX1NDU0lERVZQQUdFM19VTlNVUFBPUlRFRF9DT1VOVEVSICAgICAgICAgICAgKDB4RkZGRikKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIEZDIFBvcnQgQ29uZmlnIFBhZ2VzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfRkNfUE9SVF8wCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTVBJUG9ydE51bWJlcjsgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExpbmtUeXBlOyAgICAgICAgICAgICAgICAgICAvKiAwOWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQb3J0U3RhdGU7ICAgICAgICAgICAgICAgICAgLyogMEFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDBCaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFBvcnRJZGVudGlmaWVyOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBXV05OOyAgICAgICAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgV1dQTjsgICAgICAgICAgICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFN1cHBvcnRlZFNlcnZpY2VDbGFzczsgICAgICAvKiAyMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBTdXBwb3J0ZWRTcGVlZHM7ICAgICAgICAgICAgLyogMjRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ3VycmVudFNwZWVkOyAgICAgICAgICAgICAgIC8qIDI4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1heEZyYW1lU2l6ZTsgICAgICAgICAgICAgICAvKiAyQ2ggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBGYWJyaWNXV05OOyAgICAgICAgICAgICAgICAgLyogMzBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgRmFicmljV1dQTjsgICAgICAgICAgICAgICAgIC8qIDM4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERpc2NvdmVyZWRQb3J0c0NvdW50OyAgICAgICAvKiA0MGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNYXhJbml0aWF0b3JzOyAgICAgICAgICAgICAgLyogNDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTWF4QWxpYXNlc1N1cHBvcnRlZDsgICAgICAgIC8qIDQ4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1heEhhcmRBbGlhc2VzU3VwcG9ydGVkOyAgICA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CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIE5vU0VFUFJPTVdXTk47ICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBOb1NFRVBST01XV1BOOyAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSGFyZEFMUEE7ICAgICAgICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExpbmtDb25maWc7ICAgICAgICAgICAgICAgICAvKiAxOWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUb3BvbG9neUNvbmZpZzsgICAgICAgICAgICAgLyogMUFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWx0Q29ubmVjdG9yOyAgICAgICAgICAgICAgIC8qIDFCaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE51bVJlcXVlc3RlZEFsaWFzZXM7ICAgICAgICAvKiAxQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSUl9UT1Y7ICAgICAgICAgICAgICAgICAgICAgLyogMURoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSW5pdGlhdG9yRGV2aWNlVGltZW91dDsgICAgIC8qIDFFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEluaXRpYXRvcklvUGVuZFRpbWVvdXQ7ICAgICAvKiAxRmggKi8KK30gZkNPTkZJR19QQUdFX0ZDX1BPUlRfMSwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0ZDX1BPUlRfMSwKKyAgRkNQb3J0UGFnZTFfdCwgTVBJX1BPSU5URVIgcEZDUG9ydFBhZ2UxX3Q7CisKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UxX1BBR0VWRVJTSU9OICAg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xKQorI2RlZmluZSBNUElfRkNQT1JUUEFHRTFfVE9QT0xPR1lfTlBPUlQgICAgICAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UxX1RPUE9MT0dZX0FVVE8gICAgICAgICAgICAgICAgICAgKDB4MEYpCisKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UxX0FMVF9DT05OX1VOS05PV04gICAgICAgICAgICAgICAgKDB4MDApCisKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UxX0lOSVRJQVRPUl9ERVZfVElNRU9VVF9NQVNLICAgICAgKDB4N0YpCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0ZDX1BPUlRfMgoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTnVtYmVyQWN0aXZlOyAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFMUEFbMTI3XTsgICAgICAgICAgICAgICAgICAvKiAwNWggKi8KK30gZkNPTkZJR19QQUdFX0ZDX1BPUlRfMiwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0ZDX1BPUlRfMiwKKyAgRkNQb3J0UGFnZTJfdCwgTVBJX1BPSU5URVIgcEZDUG9ydFBhZ2UyX3Q7CisKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UyX1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgICAgKDB4MDEpCisKKwordHlwZWRlZiBzdHJ1Y3QgX1dXTl9GT1JNQVQKK3sKKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBXV05OOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgV1dQTjsgICAgICAgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworfSBXV05fRk9STUFULCBNUElfUE9JTlRFUiBQVFJfV1dOX0ZPUk1BVCwKKyAgV1dORm9ybWF0LCBNUElfUE9JTlRFUiBwV1dORm9ybWF0OworCit0eXBlZGVmIHVuaW9uIF9GQ19QT1JUX1BFUlNJU1RFTlRfUEhZU0lDQUxfSUQKK3sKKyAgICBXV05fRk9STUFUICAgICAgICAgICAgICBXV047CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgRGlkOworfSBGQ19QT1JUX1BFUlNJU1RFTlRfUEhZU0lDQUxfSUQsIE1QSV9QT0lOVEVSIFBUUl9GQ19QT1JUX1BFUlNJU1RFTlRfUEhZU0lDQUxfSUQsCisgIFBlcnNpc3RlbnRQaHlzaWNhbElkX3QsIE1QSV9QT0lOVEVSIHBQZXJzaXN0ZW50UGh5c2ljYWxJZF90OworCit0eXBlZGVmIHN0cnVjdCBfRkNfUE9SVF9QRVJTSVNURU5UCit7CisgICAgRkNfUE9SVF9QRVJTSVNURU5UX1BIWVNJQ0FMX0lEICBQaHlzaWNhbElkZW50aWZpZXI7IC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ1czsgICAgICAgICAgICAgICAgLyogMTFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgIC8qIDEyaCAqLworfSBGQ19QT1JUX1BFUlNJU1RFTlQsIE1QSV9QT0lOVEVSIFBUUl9GQ19QT1JUX1BFUlNJU1RFTlQsCisgIFBlcnNpc3RlbnREYXRhX3QsIE1QSV9QT0lOVEVSIHBQZXJzaXN0ZW50RGF0YV90OworCisjZGVmaW5lIE1QSV9QRVJTSVNURU5UX0ZMQUdTX1NISUZUICAgICAgICAgICAgICAgICAgICAgICgxNikKKyNkZWZpbmUgTVBJX1BFUlNJ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RfSEJBICAgICAgICAgICAgICAgICgweDAwMDAwMDIwKQorI2RlZmluZSBNUElfRkNQT1JUUEFHRTRfUE9SVF9CSU9TX09TX0lOSVRfSEJBICAgICAgICAgICAoMHgwMDAwMDAzMCkKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0U0X1BPUlRfUkVNT1ZBQkxFX01FRElBICAgICAgICAgICAgKDB4MDAwMDAwQzApCisjZGVmaW5lIE1QSV9GQ1BPUlRQQUdFNF9QT1JUX1NQSU5VUF9ERUxBWV9NQVNLICAgICAgICAgICgweDAwMDAwRjAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9GQ19QT1JUXzVfQUxJQVNfSU5GTworeworICAgIFU4ICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgIEFsaWFzQWxwYTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTE2ICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU2NCAgICAgQWxpYXNXV05OOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVNjQgICAgIEFsaWFzV1dQTjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMENoICovCit9IGZDT05GSUdfUEFHRV9GQ19QT1JUXzVfQUxJQVNfSU5GTywKKyAgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0ZDX1BPUlRfNV9BTElBU19JTkZPLAorICBGY1BvcnRQYWdlNUFsaWFzSW5mb190LCBNUElfUE9JTlRFUiBwRmNQb3J0UGFnZTVBbGlhc0luZm9fdDsKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0ZDX1BPUlRfNQoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICAgIC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aCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFR4RnJhbWVzOyAgICAgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBSeEZyYW1lczsgICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgVHhXb3JkczsgICAgICAgICAgICAgICAgICAgIC8qIDIwaCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFJ4V29yZHM7ICAgICAgICAgICAgICAgICAgICAvKiAyOGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBMaXBDb3VudDsgICAgICAgICAgICAgICAgICAgLyogMzBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgTm9zQ291bnQ7ICAgICAgICAgICAgICAgICAgIC8qIDM4aCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIEVycm9yRnJhbWVzOyAgICAgICAgICAgICAgICAvKiA0MGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBEdW1wZWRGcmFtZXM7ICAgICAgICAgICAgICAgLyogNDhoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgTGlua0ZhaWx1cmVDb3VudDsgICAgICAgICAgIC8qIDUwaCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIExvc3NPZlN5bmNDb3VudDsgICAgICAgICAgICAvKiA1OGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBMb3NzT2ZTaWduYWxDb3VudDsgICAgICAgICAgLyogNjBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgUHJpbWF0aXZlU2VxRXJyQ291bnQ7ICAgICAgIC8qIDY4aCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIEludmFsaWRUeFdvcmRDb3VudDsgICAgICAgICAvKiA3MGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBJbnZhbGlkQ3JjQ291bnQ7ICAgICAgICAgICAgLyogNzhoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgRmNwSW5pdGlhdG9ySW9Db3VudDsgICAgICAgIC8qIDgwaCAqLworfSBmQ09ORklHX1BBR0VfRkNfUE9SVF82LCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfRkNfUE9SVF82LAorICBGQ1BvcnRQYWdlNl90LCBNUElfUE9JTlRFUiBwRkNQb3J0UGFnZTZfdDsKKworI2RlZmluZSBNUElfRkNQT1JUUEFHRTZfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfRkNfUE9SVF83Cit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUG9ydFN5bWJvbGljTmFtZVsyNTZdOyAgICAgIC8qIDA4aCAqLworfSBmQ09ORklHX1BBR0VfRkNfUE9SVF83LCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfRkNfUE9SVF83LAorICBGQ1BvcnRQYWdlN190LCBNUElfUE9JTlRFUiBwRkNQb3J0UGFnZTdfdDsKKworI2RlZmluZSBNUElfRkNQT1JUUEFHRTdfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAoMHgwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfRkNfUE9SVF84Cit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBCaXRWZWN0b3JbOF07ICAgICAgICAgICAgICAgLyogMDRoICovCit9IGZDT05GSUdfUEFHRV9GQ19QT1JUXzgsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9GQ19QT1JUXzgsCisgIEZDUG9ydFBhZ2U4X3QsIE1QSV9QT0lOVEVSIHBGQ1BvcnRQYWdlOF90OworCisjZGVmaW5lIE1QSV9GQ1BPUlRQQUdFOF9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICgweDAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9GQ19QT1JUXzkKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBHbG9iYWxXV1BOOyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgR2xvYmFsV1dOTjsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFVuaXRUeXBlOyAgICAgICAgICAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBQaHlzaWNhbFBvcnROdW1iZXI7ICAgICAgICAgLyogMUNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTnVtQXR0YWNoZWROb2RlczsgICAgICAgICAgIC8qIDIwaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElQVmVyc2lvbjsgICAgICAgICAgICAgICAgICAvKiAyNGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBVRFBQb3J0TnVtYmVyOyAgICAgICAgICAgICAgLyogMjZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSVBBZGRyZXNzWzE2XTsgICAgICAgICAgICAgIC8qIDI4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAzOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBUb3BvbG9neURpc2NvdmVyeUZsYWdzOyAgICAgLyogM0FoICovCit9IGZDT05GSUdfUEFHRV9GQ19QT1JUXzksIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9GQ19QT1JUXzksCisgIEZDUG9ydFBhZ2U5X3QsIE1QSV9QT0lOVEVSIHBGQ1BvcnRQYWdlOV90OworCisjZGVmaW5lIE1QSV9GQ1BPUlRQQUdFOV9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICgweDAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9GQ19QT1JUXzEwX0JBU0VfU0ZQX0RBVEEKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBJZDsgICAgICAgICAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRXh0SWQ7ICAgICAgICAgICAgICAgICAgICAgIC8qIDExaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENvbm5lY3RvcjsgICAgICAgICAgICAgICAgICAvKiAxMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUcmFuc2NlaXZlcls4XTsgICAgICAgICAgICAgLyogMTNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRW5jb2Rpbmc7ICAgICAgICAgICAgICAgICAgIC8qIDFCaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJpdFJhdGVfMTAwbWJzOyAgICAgICAgICAgICAvKiAxQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMURoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTGVuZ3RoOXVfa207ICAgICAgICAgICAgICAgIC8qIDFFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExlbmd0aDl1XzEwMG07ICAgICAgICAgICAgICAvKiAxRmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBMZW5ndGg1MHVfMTBtOyAgICAgICAgICAgICAgLyogMjBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTGVuZ3RoNjJwNXVfMTBtOyAgICAgICAgICAgIC8qIDIxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExlbmd0aENvcHBlcl9tOyAgICAgICAgICAgICAvKiAyMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNldmVydmVkMjsgICAgICAgICAgICAgICAgLyogMjJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVmVuZG9yTmFtZVsxNl07ICAgICAgICAgICAgIC8qIDI0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgICAgICAvKiAzNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWZW5kb3JPVUlbM107ICAgICAgICAgICAgICAgLyogMzVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVmVuZG9yUE5bMTZdOyAgICAgICAgICAgICAgIC8qIDM4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZlbmRvclJldls0XTsgICAgICAgICAgICAgICAvKiA0OGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgICAgICAgICAgLyogNENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ1OyAgICAgICAgICAgICAgICAgIC8qIDRFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENDX0JBU0U7ICAgICAgICAgICAgICAgICAgICAvKiA0RmggKi8KK30gZkNPTkZJR19QQUdFX0ZDX1BPUlRfMTBfQkFTRV9TRlBf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ICAvKiA1M2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWZW5kb3JTTlsxNl07ICAgICAgICAgICAgICAgLyogNTRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRGF0ZUNvZGVbOF07ICAgICAgICAgICAgICAgIC8qIDY0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNVszXTsgICAgICAgICAgICAgICAvKiA2Q2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDQ19FWFQ7ICAgICAgICAgICAgICAgICAgICAgLyogNkZoICovCit9IGZDT05GSUdfUEFHRV9GQ19QT1JUXzEwX0VYVEVOREVEX1NGUF9EQVRBLAorICBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfRkNfUE9SVF8xMF9FWFRFTkRFRF9TRlBfREFUQSwKKyAgRkNQb3J0UGFnZTEwRXh0ZW5kZWRTZnBEYXRhX3QsIE1QSV9QT0lOVEVSIHBGQ1BvcnRQYWdlMTBFeHRlbmRlZFNmcERhdGFfdDsKKworI2RlZmluZSBNUElfRkNQT1JUMTBfRVhUX09QVElPTjFfUkFURVNFTCAgICAoMHgyMCkKKyNkZWZpbmUgTVBJX0ZDUE9SVDEwX0VYVF9PUFRJT04xX1RYX0RJU0FCTEUgKDB4MTApCisjZGVmaW5lIE1QSV9GQ1BPUlQxMF9FWFRfT1BUSU9OMV9UWF9GQVVMVCAgICgweDA4KQorI2RlZmluZSBNUElfRkNQT1JUMTBfRVhUX09QVElPTjFfTE9TX0lOVkVSVCAoMHgwNCkKKyNkZWZpbmUgTVBJX0ZDUE9SVDEwX0VYVF9PUFRJT04xX0xPUyAgICAgICAgKDB4MDIpCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0ZDX1BPUlRfMTAKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgICAgICAgICAgICAgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDVoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSHdDb25maWcxOyAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEh3Q29uZmlnMjsgICAgICAgICAgLyogMENoICovCisgICAgZkNPTkZJR19QQUdFX0ZDX1BPUlRfMTBfQkFTRV9TRlBfREFUQSAgICAgICAgQmFzZTsgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBmQ09ORklHX1BBR0VfRkNfUE9SVF8xMF9FWFRFTkRFRF9TRlBfREFUQSAgICBFeHRlbmRlZDsgICAgICAgICAgIC8qIDUwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmVuZG9yU3BlY2lmaWNbMzJdOyAvKiA3MGggKi8KK30gZkNPTkZJR19QQUdFX0ZDX1BPUlRfMTAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9GQ19QT1JUXzEwLAorICBGQ1BvcnRQYWdlMTBfdCwgTVBJX1BPSU5URVIgcEZDUG9ydFBhZ2UxMF90OworCisjZGVmaW5lIE1QSV9GQ1BPUlRQQUdFMTBfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICgweDAwKQorCisvKiBzdGFuZGFyZCBNT0RERUYgcGluIGRlZmluaXRpb25zIChmcm9tIEdCSUMgc3BlYy4pICovCisjZGVm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DB4MDAwMDAwMDApCisKKyNkZWZpbmUgTVBJX0ZDUE9SVFBBR0UxMF9GTEFHU19DQ19CQVNFX09LICAgICAgICAgICAgICAgKDB4MDAwMDAwMTApCisjZGVmaW5lIE1QSV9GQ1BPUlRQQUdFMTBfRkxBR1NfQ0NfRVhUX09LICAgICAgICAgICAgICAgICgweDAwMDAwMDIwKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgRkMgRGV2aWNlIENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0ZDX0RFVklDRV8wCit7CisgICAgZkNPTkZJR19QQUdFX0hFQURFUiAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBXV05OOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgV1dQTjsgICAgICAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFBvcnRJZGVudGlmaWVyOyAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQcm90b2NvbDsgICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgIC8qIDE5aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIEJCQ3JlZGl0OyAgICAgICAgICAgICAgICAgICAvKiAxQWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBNYXhSeEZyYW1lU2l6ZTsgICAgICAgICAgICAgLyogMUNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQURJU0NIYXJkQUxQQTsgICAgICAgICAgICAgIC8qIDFFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgICAgICAgICAvKiAxRmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGY1BoTG93ZXN0VmVyc2lvbjsgICAgICAgICAgLyogMjBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRmNQaEhpZ2hlc3RWZXJzaW9uOyAgICAgICAgIC8qIDIxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEN1cnJlbnRUYXJnZXRJRDsgICAgICAgICAgICAvKiAyMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDdXJyZW50QnVzOyAgICAgICAgICAgICAgICAgLyogMjNoICovCit9IGZDT05GSUdfUEFHRV9GQ19ERVZJQ0VfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0ZDX0RFVklDRV8wLAorICBGQ0RldmljZVBhZ2UwX3QsIE1QSV9QT0lOVEVSIHBGQ0RldmljZVBhZ2UwX3Q7CisKKyNkZWZpbmUgTVBJX0ZDX0RFVklDRV9QQUdFMF9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgKDB4MDMpCisKKyNkZWZpbmUgTVBJX0ZDX0RFVklDRV9QQUdFMF9GTEFHU19UQVJHRVRJRF9CVVNfVkFMSUQgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9GQ19ERVZJQ0VfUEFHRTBfRkxBR1NfUExPR0lfSU5WQUxJRCAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfRkNfREVWSUNFX1BBR0UwX0ZMQUdTX1BSTElfSU5WQUxJRCAgICAgICAgICAoMHgwNCkKKworI2RlZmluZSBNUElfRkNfREVWSUNFX1BBR0UwX1BST1RfSVAgICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZW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RkNfREVWSUNFX1BHQURfQlRfVElEX01BU0spCisKKyNkZWZpbmUgTVBJX0ZDX0RFVklDRV9QQUdFMF9IQVJEX0FMUEFfVU5LTk9XTiAgICgweEZGKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIFJBSUQgVm9sdW1lIENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfVk9MMF9QSFlTX0RJU0sKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFBoeXNEaXNrTWFwOyAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza051bTsgICAgICAgICAgICAvKiAwM2ggKi8KK30gUkFJRF9WT0wwX1BIWVNfRElTSywgTVBJX1BPSU5URVIgUFRSX1JBSURfVk9MMF9QSFlTX0RJU0ssCisgIFJhaWRWb2wwUGh5c0Rpc2tfdCwgTVBJX1BPSU5URVIgcFJhaWRWb2wwUGh5c0Rpc2tfdDsKKworI2RlZmluZSBNUElfUkFJRFZPTDBfUEhZU0RJU0tfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1JBSURWT0wwX1BIWVNESVNLX1NFQ09OREFSWSAgICAgICAgICAgICAgICAgKDB4MDIpCisKK3R5cGVkZWYgc3RydWN0IF9SQUlEX1ZPTDBfU1RBVFVTCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBTdGF0ZTsgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgLyogMDJoICovCit9IFJBSURfVk9MMF9TVEFUVVMsIE1QSV9QT0lOVEVSIFBUUl9SQUlEX1ZPTDBfU1RBVFVTLAorICBSYWlkVm9sMFN0YXR1c190LCBNUElfUE9JTlRFUiBwUmFpZFZvbDBTdGF0dXNfdDsKKworLyogUkFJRCBWb2x1bWUgUGFnZSAwIFZvbHVtZVN0YXR1cyBkZWZpbmVzICovCisKKyNkZWZpbmUgTVBJX1JBSURWT0wwX1NUQVRVU19GTEFHX0VOQUJMRUQgICAgICAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9SQUlEVk9MMF9TVEFUVVNfRkxBR19RVUlFU0NFRCAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfUkFJRFZPTDBfU1RBVFVTX0ZMQUdfUkVTWU5DX0lOX1BST0dSRVNTICAgICAoMHgwNCkKKyNkZWZpbmUgTVBJX1JBSURWT0wwX1NUQVRVU19GTEFHX1ZPTFVNRV9JTkFDVElWRSAgICAgICAgKDB4MDgpCisKKyNkZWZpbmUgTVBJX1JBSURWT0wwX1NUQVRVU19TVEFURV9PUFRJTUFMICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9SQUlEVk9MMF9TVEFUVVNfU1RBVEVfREVHUkFERUQgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfUkFJRFZPTDBfU1RBVFVTX1NUQVRFX0ZBSUxFRCAgICAgICAgICAgICAgICAoMHgwMikKKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfVk9MMF9TRVRUSU5HUworeworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICBTZXR0aW5nczsgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIEhvdFNwYXJlUG9vbDsgICAvKiAwMWggKi8gLyogTVBJX1JBSURfSE9UX1NQQVJFX1BPT0xfICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAvKiAwMmggKi8KK30gUkFJRF9WT0wwX1NFVFRJTkdTLCBNUElfUE9JTlRFUiBQVFJfUkFJRF9WT0wwX1NFVFRJTkdTLAorICBSYWlkVm9sMFNldHRpbmdzLCBNUElfUE9JTlRFUiBwUmFpZFZvbDBTZXR0aW5nczsKKworLyogUkFJRCBWb2x1bWUgUGFnZSAwIFZvbHVtZVNldHRpbmdzIGRlZmluZXMgKi8KKworI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19XUklURV9DQUNISU5HX0VOQUJMRSAgICAgICAoMHgwMDAxKQorI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19PRkZMSU5FX09OX1NNQVJUICAgICAgICAgICAoMHgwMDAyKQorI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19BVVRPX0NPTkZJR1VSRSAgICAgICAgICAgICAoMHgwMDA0KQorI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19QUklPUklUWV9SRVNZTkMgICAgICAgICAgICAoMHgwMDA4KQorI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19VU0VfUFJPRFVDVF9JRF9TVUZGSVggICAgICAoMHgwMDEwKQorI2RlZmluZSBNUElfUkFJRFZPTDBfU0VUVElOR19VU0VfREVGQVVMVFMgICAgICAgICAgICAgICAoMHg4MDAwKQorCisvKiBSQUlEIFZvbHVtZSBQYWdlIDAgSG90U3BhcmVQb29sIGRlZmluZXMsIGFsc28gdXNlZCBpbiBSQUlEIFBoeXNpY2FsIERpc2sgKi8KKyNkZWZpbmUgTVBJX1JBSURfSE9UX1NQQVJFX1BPT0xfMCAgICAgICAgICAgICAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9SQUlEX0hPVF9TUEFSRV9QT09MXzEgICAgICAgICAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfUkFJRF9IT1RfU1BBUkVfUE9PTF8yICAgICAgICAgICAgICAgICAgICAgICAoMHgwNCkKKyNkZWZpbmUgTVBJX1JBSURfSE9UX1NQQVJFX1BPT0xfMyAgICAgICAgICAgICAgICAgICAgICAgKDB4MDgpCisjZGVmaW5lIE1QSV9SQUlEX0hPVF9TUEFSRV9QT09MXzQgICAgICAgICAgICAgICAgICAgICAgICgweDEwKQorI2RlZmluZSBNUElfUkFJRF9IT1RfU1BBUkVfUE9PTF81ICAgICAgICAgICAgICAgICAgICAgICAoMHgyMCkKKyNkZWZpbmUgTVBJX1JBSURfSE9UX1NQQVJFX1BPT0xfNiAgICAgICAgICAgICAgICAgICAgICAgKDB4NDApCisjZGVmaW5lIE1QSV9SQUlEX0hPVF9TUEFSRV9QT09MXzcgICAgICAgICAgICAgICAgICAgICAgICgweDgwKQorCisvKgorICogSG9zdCBjb2RlIChkcml2ZXJzLCBCSU9TLCB1dGlsaXRpZXMsIGV0Yy4pIHNob3VsZCBsZWF2ZSB0aGlzIGRlZmluZSBzZXQgdG8KKyAqIG9uZSBhbmQgY2hlY2sgSGVhZGVyLlBhZ2VMZW5ndGggYXQgcnVudGltZS4KKyAqLworI2lmbmRlZiBNUElfUkFJRF9WT0xfUEFHRV8wX1BIWVNESVNLX01BWAorI2RlZmluZSBNUElfUkFJRF9WT0xfUEFHRV8wX1BIWVNESVNLX01BWCAgICAgICAgKDEpCisjZW5kaWYKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1JBSURfVk9MXzAKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZUlEOyAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVCdXM7ICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lSU9DOyAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZVR5cGU7ICAgICAvKiAwN2ggKi8gLyogTVBJX1JBSURfVk9MX1RZUEVfICovCisgICAgUkFJRF9WT0wwX1NUQVRVUyAgICAgICAgVm9sdW1lU3RhdHVzOyAgIC8qIDA4aCAqLworICAgIFJBSURfVk9MMF9TRVRUSU5HUyAgICAgIFZvbHVtZVNldHRpbmdzOyAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNYXhMQkE7ICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgIC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFN0cmlwZVNpemU7ICAgICAvKiAxOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgLyogMUNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgIC8qIDIwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE51bVBoeXNEaXNrczsgICAvKiAyNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgLyogMjVoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ1OyAgICAgIC8qIDI2aCAqLworICAgIFJBSURfVk9MMF9QSFlTX0RJU0sgICAgIFBoeXNEaXNrW01QSV9SQUlEX1ZPTF9QQUdFXzBfUEhZU0RJU0tfTUFYXTsvKiAyOGggKi8KK30gZkNPTkZJR19QQUdFX1JBSURfVk9MXzAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9SQUlEX1ZPTF8wLAorICBSYWlkVm9sdW1lUGFnZTBfdCwgTVBJX1BPSU5URVIgcFJhaWRWb2x1bWVQYWdlMF90OworCisjZGVmaW5lIE1QSV9SQUlEVk9MUEFHRTBfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICgweDAxKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgUkFJRCBQaHlzaWNhbCBEaXNrIENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfUEhZU19ESVNLMF9FUlJPUl9EQVRBCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRXJyb3JDZGJCeXRlOyAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEVycm9yU2Vuc2VLZXk7ICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgRXJyb3JDb3VudDsgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEVycm9yQVNDOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBFcnJvckFTQ1E7ICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgU21hcnRDb3VudDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNtYXJ0QVNDOyAgICAgICAgICAgICAgICAgICAvKiAwQWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTbWFydEFTQ1E7ICAgICAgICAgICAgICAgICAgLyogMEJoICovCit9IFJBSURfUEhZU19ESVNLMF9FUlJPUl9EQVRBLCBNUElfUE9JTlRFUiBQVFJfUkFJRF9QSFlTX0RJU0swX0VSUk9SX0RBVEEsCisgIFJhaWRQaHlzRGlzazBFcnJvckRhdGFfdCwgTVBJX1BPSU5URVIgcFJhaWRQaHlzRGlzazBFcnJvckRhdGFfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfUEhZU19ESVNLX0lOUVVJUllfREFUQQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBWZW5kb3JJRFs4XTsgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvZHVjdElEWzE2XTsgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFByb2R1Y3RSZXZMZXZlbFs0XTsgICAgIC8qIDE4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBJbmZvWzMyXTsgICAgICAgICAgICAgICAvKiAxQ2ggKi8KK30gUkFJRF9QSFlTX0RJU0swX0lOUVVJUllfREFUQSwgTVBJX1BPSU5URVIgUFRSX1JBSURfUEhZU19ESVNLMF9JTlFVSVJZX0RBVEEsCisgIFJhaWRQaHlzRGlzazBJbnF1aXJ5RGF0YSwgTVBJX1BPSU5URVIgcFJhaWRQaHlzRGlzazBJbnF1aXJ5RGF0YTsKKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfUEhZU19ESVNLMF9TRVRUSU5HUworeworICAgIFU4ICAgICAgICAgICAgICBTZXBJRDsgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICBTZXBCdXM7ICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICBIb3RTcGFyZVBvb2w7ICAgICAgIC8qIDAyaCAqLyAvKiBNUElfUkFJRF9IT1RfU1BBUkVfUE9PTF8gKi8KKyAgICBVOCAgICAgICAgICAgICAgUGh5c0Rpc2tTZXR0aW5nczsgICAvKiAwM2ggKi8KK30gUkFJRF9QSFlTX0RJU0swX1NFVFRJTkdTLCBNUElfUE9JTlRFUiBQVFJfUkFJRF9QSFlTX0RJU0swX1NFVFRJTkdTLAorICBSYWlkUGh5c0Rpc2tTZXR0aW5nc190LCBNUElfUE9JTlRFUiBwUmFpZFBoeXNEaXNrU2V0dGluZ3NfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX1JBSURfUEhZU19ESVNLMF9TVEFUVVMKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdGF0ZTsgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMmggKi8KK30gUkFJRF9QSFlTX0RJU0swX1NUQVRVUywgTVBJX1BPSU5URVIgUFRSX1JBSURfUEhZU19ESVNLMF9TVEFUVVMsCisgIFJhaWRQaHlzRGlza1N0YXR1c190LCBNUElfUE9JTlRFUiBwUmFpZFBoeXNEaXNrU3RhdHVzX3Q7CisKKy8qIFJBSUQgVm9sdW1lIDIgSU0gUGh5c2ljYWwgRGlzayBEaXNrU3RhdHVzIGZsYWdzICovCisKKyNkZWZpbmUgTVBJX1BIWVNESVNLMF9TVEFUVVNfRkxBR19PVVRfT0ZfU1lOQyAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9QSFlTRElTSzBfU1RBVFVTX0ZMQUdfUVVJRVNDRUQgICAgICAgICAgICAgICgweDAyKQorCisjZGVmaW5lIE1QSV9QSFlTRElTSzBfU1RBVFVTX09OTElORSAgICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfUEhZU0RJU0swX1NUQVRVU19NSVNTSU5HICAgICAgICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1BIWVNESVNLMF9TVEFUVVNfTk9UX0NPTVBBVElCTEUgICAgICAgICAgICAgKDB4MDIpCisjZGVmaW5lIE1QSV9QSFlTRElTSzBfU1RBVFVTX0ZBSUxFRCAgICAgICAgICAgICAgICAgICAgICgweDAzKQorI2RlZmluZSBNUElfUEhZU0RJU0swX1NUQVRVU19JTklUSUFMSVpJTkcgICAgICAgICAgICAgICAoMHgwNCkKKyNkZWZpbmUgTVBJX1BIWVNESVNLMF9TVEFUVVNfT0ZGTElORV9SRVFVRVNURUQgICAgICAgICAgKDB4MDUpCisjZGVmaW5lIE1QSV9QSFlTRElTSzBfU1RBVFVTX0ZBSUxFRF9SRVFVRVNURUQgICAgICAgICAgICgweDA2KQorI2RlZmluZSBNUElfUEhZU0RJU0swX1NUQVRVU19PVEhFUl9PRkZMSU5FICAgICAgICAgICAgICAoMHhGRikKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1JBSURfUEhZU19ESVNLXzAKK3sKKyAgICBmQ09ORklHX1BBR0VfSEVBREVSICAgICAgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGh5c0Rpc2tJRDsgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBoeXNEaXNrQnVzOyAgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza0lPQzsgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGh5c0Rpc2tOdW07ICAgICAgICAvKiAwN2ggKi8KKyAgICBSQUlEX1BIWVNfRElTSzBfU0VUVElOR1MgICAgICAgIFBoeXNEaXNrU2V0dGluZ3M7ICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMTRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaXNrSWRlbnRpZmllclsxNl07IC8qIDE4aCAqLworICAgIFJBSURfUEhZU19ESVNLMF9JTlFVSVJZX0RBVEEgICAgSW5xdWlyeURhdGE7ICAgICAgICAvKiAyOGggKi8KKyAgICBSQUlEX1BIWVNfRElTSzBfU1RBVFVTICAgICAgICAgIFBoeXNEaXNrU3RhdHVzOyAgICAgLyogNjRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXhMQkE7ICAgICAgICAgICAgIC8qIDY4aCAqLworICAgIFJBSURfUEhZU19ESVNLMF9FUlJPUl9EQVRBICAgICAgRXJyb3JEYXRhOyAgICAgICAgICAvKiA2Q2ggKi8KK30gZkNPTkZJR19QQUdFX1JBSURfUEhZU19ESVNLXzAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9SQUlEX1BIWVNfRElTS18wLAorICBSYWlkUGh5c0Rpc2tQYWdlMF90LCBNUElfUE9JTlRFUiBwUmFpZFBoeXNEaXNrUGFnZTBfdDsKKworI2RlZmluZSBNUElfUkFJRFBIWVNESVNLUEFHRTBfUEFHRVZFUlNJT04gICAgICAgICAgICgweDAwKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgTEFOIENvbmZpZyBQYWdlcworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0xBTl8wCit7CisgICAgQ29uZmlnUGFnZUhlYWRlcl90ICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFR4UnhNb2RlczsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUGFja2V0UHJlUGFkOyAgICAgICAgICAgICAgIC8qIDA4aCAqLworfSBmQ09ORklHX1BBR0VfTEFOXzAsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9MQU5fMCwKKyAgTEFOUGFnZTBfdCwgTVBJX1BPSU5URVIgcExBTlBhZ2UwX3Q7CisKKyNkZWZpbmUgTVBJX0xBTl9QQUdFMF9QQUdFVkVSU0lPTiAgICAgICAgICAgICAgICAgICAgICAgKDB4MDEpCisKKyNkZWZpbmUgTVBJX0xBTl9QQUdFMF9SRVRVUk5fTE9PUEJBQ0sgICAgICAgICAgICAgICAgICAgKDB4MDAwMCkKKyNkZWZpbmUgTVBJX0xBTl9QQUdFMF9TVVBQUkVTU19MT09QQkFDSyAgICAgICAgICAgICAgICAgKDB4MDAwMSkKKyNkZWZpbmUgTVBJX0xBTl9QQUdFMF9MT09QQkFDS19NQVNLICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMSkKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX0xBTl8xCit7CisgICAgQ29uZmlnUGFnZUhlYWRlcl90ICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDdXJyZW50RGV2aWNlU3RhdGU7ICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1pblBhY2tldFNpemU7ICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNYXhQYWNrZXRTaXplOyAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSGFyZHdhcmVBZGRyZXNzTG93OyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEhhcmR3YXJlQWRkcmVzc0hpZ2g7ICAgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNYXhXaXJlU3BlZWRMb3c7ICAgICAgICAgICAgLyogMThoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTWF4V2lyZVNwZWVkSGlnaDsgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEJ1Y2tldHNSZW1haW5pbmc7ICAgICAgICAgICAvKiAyMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNYXhSZXBseVNpemU7ICAgICAgICAgICAgICAgLyogMjRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTmVnV2lyZVNwZWVkTG93OyAgICAgICAgICAgIC8qIDI4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE5lZ1dpcmVTcGVlZEhpZ2g7ICAgICAgICAgICAvKiAyQ2ggKi8KK30gZkNPTkZJR19QQUdFX0xBTl8xLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfTEFOXzEsCisgIExBTlBhZ2UxX3QsIE1QSV9QT0lOVEVSIHBMQU5QYWdlMV90OworCisjZGVmaW5lIE1QSV9MQU5fUEFHRTFfUEFHRVZFUlNJT04gICAgICAgICAgICAgICAgICAgICAgICgweDAzKQorCisjZGVmaW5lIE1QSV9MQU5fUEFHRTFfREVWX1NUQVRFX1JFU0VUICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfTEFOX1BBR0UxX0RFVl9TVEFURV9PUEVSQVRJT05BTCAgICAgICAgICAgICAoMHgwMSkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIEluYmFuZCBDb25maWcgUGFnZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9JTkJBTkRfMAoreworICAgIGZDT05GSUdfUEFHRV9IRUFERVIgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgTVBJX1ZFUlNJT05fRk9STUFUICAgICAgSW5iYW5kVmVyc2lvbjsgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIE1heGltdW1CdWZmZXJzOyAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMEFoICovCit9IGZDT05GSUdfUEFHRV9JTkJBTkRfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX0lOQkFORF8wLAorICBJbmJhbmRQYWdlMF90LCBNUElfUE9JTlRFUiBwSW5iYW5kUGFnZTBfdDsKKworI2RlZmluZSBNUElfSU5CQU5EX1BBR0VWRVJTSU9OICAgICAgICAgICgweDAwKQorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogICBTQVMgSU8gVW5pdCBDb25maWcgUGFnZXMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NUElfU0FTX0lPX1VOSVQwX1BIWV9EQVRBCit7CisgICAgVTggICAgICAgICAgUG9ydDsgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgUG9ydEZsYWdzOyAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgUGh5RmxhZ3M7ICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgTmVnb3RpYXRlZExpbmtSYXRlOyAgICAgLyogMDNoICovCisgICAgVTMyICAgICAgICAgQ29udHJvbGxlclBoeURldmljZUluZm87LyogMDRoICovCisgICAgVTE2ICAgICAgICAgQXR0YWNoZWREZXZpY2VIYW5kbGU7ICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgQ29udHJvbGxlckRldkhhbmRsZTsgICAgLyogMEFoICovCisgICAgVTMyICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgLyogMENoICovCit9IE1QSV9TQVNfSU9fVU5JVDBfUEhZX0RBVEEsIE1QSV9QT0lOVEVSIFBUUl9NUElfU0FTX0lPX1VOSVQwX1BIWV9EQVRBLAorICBTYXNJT1VuaXQwUGh5RGF0YSwgTVBJX1BPSU5URVIgcFNhc0lPVW5pdDBQaHlEYXRhOworCisvKgorICogSG9zdCBjb2RlIChkcml2ZXJzLCBCSU9TLCB1dGlsaXRpZXMsIGV0Yy4pIHNob3VsZCBsZWF2ZSB0aGlzIGRlZmluZSBzZXQgdG8KKyAqIG9uZSBhbmQgY2hlY2sgSGVhZGVyLlBhZ2VMZW5ndGggYXQgcnVudGltZS4KKyAqLworI2lmbmRlZiBNUElfU0FTX0lPVU5JVDBfUEhZX01BWAorI2RlZmluZSBNUElfU0FTX0lPVU5JVDBfUEhZX01BWCAgICAgICAgICgxKQorI2VuZGlmCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9TQVNfSU9fVU5JVF8wCit7CisgICAgZkNPTkZJR19FWFRFTkRFRF9QQUdFX0hFQURFUiAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bVBoeXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMERoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBNUElfU0FTX0lPX1VOSVQwX1BIWV9EQVRBICAgICAgIFBoeURhdGFbTVBJX1NBU19JT1VOSVQwX1BIWV9NQVhdOyAgIC8qIDEwaCAqLworfSBmQ09ORklHX1BBR0VfU0FTX0lPX1VOSVRfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX1NBU19JT19VTklUXzAsCisgIFNhc0lPVW5pdFBhZ2UwX3QsIE1QSV9QT0lOVEVSIHBTYXNJT1VuaXRQYWdlMF90OworCisjZGVmaW5lIE1QSV9TQVNJT1VOSVRQQUdFMF9QQUdFVkVSU0lPTiAgICAgICgweDAwKQorCisvKiB2YWx1ZXMgZm9yIFNBUyBJTyBVbml0IFBhZ2UgMCBQb3J0RmxhZ3MgKi8KKyNkZWZpbmUgTVBJX1NB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DAyKQorI2RlZmluZSBNUElfU0FTX0lPVU5JVDBfUkFURV9TQVRBX09PQl9DT01QTEVURSAgICAgICAgICAgICAgKDB4MDMpCisjZGVmaW5lIE1QSV9TQVNfSU9VTklUMF9SQVRFXzFfNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwOCkKKyNkZWZpbmUgTVBJX1NBU19JT1VOSVQwX1JBVEVfM18wICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDA5KQorCisvKiBzZWUgbXBpX3Nhcy5oIGZvciB2YWx1ZXMgZm9yIFNBUyBJTyBVbml0IFBhZ2UgMCBDb250cm9sbGVyUGh5RGV2aWNlSW5mbyB2YWx1ZXMgKi8KKworCit0eXBlZGVmIHN0cnVjdCBfTVBJX1NBU19JT19VTklUMV9QSFlfREFUQQoreworICAgIFU4ICAgICAgICAgIFBvcnQ7ICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgIFBvcnRGbGFnczsgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgIFBoeUZsYWdzOyAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgIE1heE1pbkxpbmtSYXRlOyAgICAgICAgIC8qIDAzaCAqLworICAgIFUzMiAgICAgICAgIENvbnRyb2xsZXJQaHlEZXZpY2VJbmZvOy8qIDA0aCAqLworICAgIFUzMiAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgIC8qIDA4aCAqLworfSBNUElfU0FTX0lPX1VOSVQxX1BIWV9EQVRBLCBNUElfUE9JTlRFUiBQVFJfTVBJX1NBU19JT19VTklUMV9QSFlfREFUQSwKKyAgU2FzSU9Vbml0MVBoeURhdGEsIE1QSV9QT0lOVEVSIHBTYXNJT1VuaXQxUGh5RGF0YTsKKworLyoKKyAqIEhvc3QgY29kZSAoZHJpdmVycywgQklPUywgdXRpbGl0aWVzLCBldGMuKSBzaG91bGQgbGVhdmUgdGhpcyBkZWZpbmUgc2V0IHRvCisgKiBvbmUgYW5kIGNoZWNrIEhlYWRlci5QYWdlTGVuZ3RoIGF0IHJ1bnRpbWUuCisgKi8KKyNpZm5kZWYgTVBJX1NBU19JT1VOSVQxX1BIWV9NQVgKKyNkZWZpbmUgTVBJX1NBU19JT1VOSVQxX1BIWV9NQVggICAgICAgICAoMSkKKyNlbmRpZgorCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfU0FTX0lPX1VOSVRfMQoreworICAgIGZDT05GSUdfRVhURU5ERURfUEFHRV9IRUFERVIgSGVhZGVyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1QaHlzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMERoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIE1QSV9TQVNfSU9fVU5JVDFfUEhZX0RBVEEgICBQaHlEYXRhW01QSV9TQVNfSU9VTklUMV9QSFlfTUFYXTsgICAvKiAxMGggKi8KK30gZkNPTkZJR19QQUdFX1NBU19JT19VTklUXzEsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9TQVNfSU9fVU5JVF8xLAorICBTYXNJT1VuaXRQYWdlMV90LCBNUElfUE9JTlRFUiBwU2FzSU9Vbml0UGFnZTFfdDsKKworI2RlZmluZSBNUElfU0FTSU9VTklUUEFHRTFfUEFHRVZFUlNJT04gICAgICAoMHgwMCkKKworLyogdmFsdWVzIGZvciB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xX01JTl9SQVRFX01BU0sgICAgICAgICAgICAgICAgICAgICAgICgweDBGKQorI2RlZmluZSBNUElfU0FTX0lPVU5JVDFfTUlOX1JBVEVfMV81ICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDgpCisjZGVmaW5lIE1QSV9TQVNfSU9VTklUMV9NSU5fUkFURV8zXzAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwOSkKKworLyogc2VlIG1waV9zYXMuaCBmb3IgdmFsdWVzIGZvciBTQVMgSU8gVW5pdCBQYWdlIDEgQ29udHJvbGxlclBoeURldmljZUluZm8gdmFsdWVzICovCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NBU19JT19VTklUXzIKK3sKKyAgICBmQ09ORklHX0VYVEVOREVEX1BBR0VfSEVBREVSICAgICAgICAgSGVhZGVyOyAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF4UGVyc2lzdGVudElEczsgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtUGVyc2lzdGVudElEc1VzZWQ7ICAgLyogMEVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RhdHVzOyAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgLyogMTFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgLyogMTJoICovCit9IGZDT05GSUdfUEFHRV9TQVNfSU9fVU5JVF8yLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0FT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IC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBSdW5uaW5nRGlzcGFyaXR5RXJyb3JUaW1lOyAgICAgIC8qIDE4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBNYXhMb3NzRHdvcmRTeW5jaENvdW50OyAgICAgICAgIC8qIDFDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBMb3NzRHdvcmRTeW5jaENvdW50VGltZTsgICAgICAgIC8qIDIwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBNYXhQaHlSZXNldFByb2JsZW1Db3VudDsgICAgICAgIC8qIDI0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBQaHlSZXNldFByb2JsZW1UaW1lOyAgICAgICAgICAgIC8qIDI4aCAqLworfSBmQ09ORklHX1BBR0VfU0FTX0lPX1VOSVRfMywgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX1NBU19JT19VTklUXzMsCisgIFNhc0lPVW5pdFBhZ2UzX3QsIE1QSV9QT0lOVEVSIHBTYXNJT1VuaXRQYWdlM190OworCisjZGVmaW5lIE1QSV9TQVNJT1VOSVRQQUdFM19QQUdFVkVSU0lPTiAgICAgICgweDAwKQorCisKK3R5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9TQVNfRVhQQU5ERVJfMAoreworICAgIGZDT05GSUdfRVhURU5ERURfUEFHRV9IRUFERVIgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQVNBZGRyZXNzOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXZIYW5kbGU7ICAgICAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJlbnREZXZIYW5kbGU7ICAgICAgICAvKiAxQWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHBhbmRlckNoYW5nZUNvdW50OyAgICAvKiAxQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHBhbmRlclJvdXRlSW5kZXhlczsgICAvKiAxRWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1QaHlzOyAgICAgICAgICAgICAgICAvKiAyMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQVNMZXZlbDsgICAgICAgICAgICAgICAvKiAyMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAvKiAyMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAvKiAyM2ggKi8KK30gZkNPTkZJR19QQUdFX1NBU19FWFBBTkRFUl8wLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0FTX0VYUEFOREVSXzAsCisgIFNhc0V4cGFuZGVyUGFnZTBfdCwgTVBJX1BPSU5URVIgcFNhc0V4cGFuZGVyUGFnZTBfdDsKKworI2RlZmluZSBNUElfU0FTRVhQQU5ERVIwX1BBR0VWRVJTSU9OICAgICAgICAoMHgwMCkKKworLyogdmFsdWVzIGZvciBTQVMgRXhwYW5kZXIgUGFnZSAwIEZsYWdzIGZpZWxkICovCisjZGVmaW5lIE1QSV9TQVNfRVhQQU5ERVIwX0ZMQUdTX1JPVVRFX1RBQkxFX0NPTkZJRyAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0FTX0VYUEFOREVSMF9GTEFHU19DT05GSUdfSU5fUFJPR1JFU1MgICAgICAoMHgwMSkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfU0FTX0RFVklDRV8wCit7CisgICAgZkNPTkZJR19FWFRFTkRFRF9QQUdFX0hFQURFUiAgICAgICAgIEhlYWRlcjsgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNBU0FkZHJlc3M7ICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgIC8qIDE0aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldkhhbmRsZTsgICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgICAgIC8qIDFBaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ1czsgICAgICAgICAgICAgICAgICAgIC8qIDFCaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldmljZUluZm87ICAgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgIC8qIDIwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBoeXNpY2FsUG9ydDsgICAgICAgICAgIC8qIDIyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgIC8qIDIzaCAqLworfSBmQ09ORklHX1BBR0VfU0FTX0RFVklDRV8wLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0FTX0RFVklDRV8wLAorICBTYXNEZXZpY2VQYWdlMF90LCBNUElfUE9JTlRFUiBwU2FzRGV2aWNlUGFnZTBfdDsKKworI2RlZmluZSBNUElfU0FTREVWSUNFMF9QQUdFVkVSU0lPTiAgICAgICAgICAoMHgwMCkKKworLyogdmFsdWVzIGZvciBTQVMgRGV2aWNlIFBhZ2UgMCBGbGFncyBmaWVsZCAqLworI2RlZmluZSBNUElfU0FTX0RFVklDRTBfRkxBR1NfTUFQUElOR19QRVJTSVNURU5UICAgICgweDA0KQorI2RlZmluZSBNUElfU0FTX0RFVklDRTBfRkxBR1NfREVWSUNFX01BUFBFRCAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0FTX0RFVklDRTBfRkxBR1NfREVWSUNFX1BSRVNFTlQgICAgICAgICgweDAxKQorCisvKiBzZWUgbXBpX3Nhcy5oIGZvciB2YWx1ZXMgZm9yIFNBUyBEZXZpY2UgUGFnZSAwIERldmljZUluZm8gdmFsdWVzICovCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NBU19ERVZJQ0VfMQoreworICAgIGZDT05GSUdfRVhURU5ERURfUEFHRV9IRUFERVIgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQVNBZGRyZXNzOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXZIYW5kbGU7ICAgICAgICAgICAgICAvKiAxOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUYXJnZXRJRDsgICAgICAgICAgICAgICAvKiAxQWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgICAgICAvKiAxQmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbml0aWFsUmVnRGV2aWNlRklTWzIwXTsvKiAxQ2ggKi8KK30gZkNPTkZJR19QQUdFX1NBU19ERVZJQ0VfMSwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX1NBU19ERVZJQ0VfMSwKKyAgU2FzRGV2aWNlUGFnZTFfdCwgTVBJX1BPSU5URVIgcFNhc0RldmljZVBhZ2UxX3Q7CisKKyNkZWZpbmUgTVBJX1NBU0RFVklDRTFfUEFHRVZFUlNJT04gICAgICAgICAgKDB4MDApCisKKwordHlwZWRlZiBzdHJ1Y3QgX0NPTkZJR19QQUdFX1NBU19QSFlfMAoreworICAgIGZDT05GSUdfRVhURU5ERURfUEFHRV9IRUFERVIgICAgICAgICBIZWFkZXI7ICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQVNBZGRyZXNzOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdHRhY2hlZERldkhhbmRsZTsgICAgICAvKiAxNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdHRhY2hlZFBoeUlkZW50aWZpZXI7ICAvKiAxNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAvKiAxN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdHRhY2hlZERldmljZUluZm87ICAgICAvKiAxOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9ncmFtbWVkTGlua1JhdGU7ICAgICAvKiAyMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBId0xpbmtSYXRlOyAgICAgICAgICAgICAvKiAyMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFuZ2VDb3VudDsgICAgICAgICAgICAvKiAyMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAvKiAyM2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlJbmZvOyAgICAgICAgICAgICAgICAvKiAyNGggKi8KK30gZkNPTkZJR19QQUdFX1NBU19QSFlfMCwgTVBJX1BPSU5URVIgUFRSX0NPTkZJR19QQUdFX1NBU19QSFlfMCwKKyAgU2FzUGh5UGFnZTBfdCwgTVBJX1BPSU5URVIgcFNhc1BoeVBhZ2UwX3Q7CisKKyNkZWZpbmUgTVBJX1NBU1BIWTBfUEFHRVZFUlNJT04gICAgICAgICAgICAgKDB4MDApCisKKy8qIHZhbHVlcyBmb3IgU0FTIFBIWSBQYWdlIDAgUHJvZ3JhbW1lZExpbmtSYXRlIGZpZWxkICovCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NQVhfUkFURV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgKDB4RjApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NQVhfUkFURV9OT1RfUFJPR1JBTU1BQkxFICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NQVhfUkFURV8xXzUgICAgICAgICAgICAgICAgICAgICAgICAgKDB4ODApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NQVhfUkFURV8zXzAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4OTApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NSU5fUkFURV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgKDB4MEYpCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NSU5fUkFURV9OT1RfUFJPR1JBTU1BQkxFICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NSU5fUkFURV8xXzUgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDgpCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QUkFURV9NSU5fUkFURV8zXzAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDkpCisKKy8qIHZhbHVlcyBmb3IgU0FTIFBIWSBQYWdlIDAgSHdMaW5rUmF0ZSBmaWVsZCAqLworI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01BWF9SQVRFX01BU0sgICAgICAgICAgICAgICAgICAgICAgICgweEYwKQorI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01BWF9SQVRFXzFfNSAgICAgICAgICAgICAgICAgICAgICAgICgweDgwKQorI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01BWF9SQVRFXzNfMCAgICAgICAgICAgICAgICAgICAgICAgICgweDkwKQorI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01JTl9SQVRFX01BU0sgICAgICAgICAgICAgICAgICAgICAgICgweDBGKQorI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01JTl9SQVRFXzFfNSAgICAgICAgICAgICAgICAgICAgICAgICgweDA4KQorI2RlZmluZSBNUElfU0FTX1BIWTBfSFdSQVRFX01JTl9SQVRFXzNfMCAgICAgICAgICAgICAgICAgICAgICAgICgweDA5KQorCisvKiB2YWx1ZXMgZm9yIFNBUyBQSFkgUGFnZSAwIFBoeUluZm8gZmllbGQgKi8KKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fU0FUQV9QT1JUX0FDVElWRSAgICAgICAgICAgICAgICAgICAoMHgwMDAwNDAwMCkKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fU0FUQV9QT1JUX1NFTEVDVE9SICAgICAgICAgICAgICAgICAoMHgwMDAwMjAwMCkKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fVklSVFVBTF9QSFkgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMTAwMCkKKworI2RlZmluZSBNUElfU0FTX1BIWTBfUEhZSU5GT19NQVNLX1BBUlRJQUxfUEFUSFdBWV9USU1FICAgICAgICAgICgweDAwMDAwRjAwKQorI2RlZmluZSBNUElfU0FTX1BIWTBfUEhZSU5GT19TSElGVF9QQVJUSUFMX1BBVEhXQVlfVElNRSAgICAgICAgICg4KQorCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QSFlJTkZPX01BU0tfUk9VVElOR19BVFRSSUJVVEUgICAgICAgICAgICAgKDB4MDAwMDAwRjApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QSFlJTkZPX0RJUkVDVF9ST1VUSU5HICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QSFlJTkZPX1NVQlRSQUNUSVZFX1JPVVRJTkcgICAgICAgICAgICAgICAgKDB4MDAwMDAwMTApCisjZGVmaW5lIE1QSV9TQVNfUEhZMF9QSFlJTkZPX1RBQkxFX1JPVVRJTkcgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMjApCisKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fTUFTS19MSU5LX1JBVEUgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwRikKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fVU5LTk9XTl9MSU5LX1JBVEUgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMCkKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fUEhZX0RJU0FCTEVEICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMSkKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fTkVHT1RJQVRJT05fRkFJTEVEICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fU0FUQV9PT0JfQ09NUExFVEUgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMykKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fUkFURV8xXzUgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwOCkKKyNkZWZpbmUgTVBJX1NBU19QSFkwX1BIWUlORk9fUkFURV8zXzAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwOSkKKworCit0eXBlZGVmIHN0cnVjdCBfQ09ORklHX1BBR0VfU0FTX1BIWV8xCit7CisgICAgZkNPTkZJR19FWFRFTkRFRF9QQUdFX0hFQURFUiBIZWFkZXI7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgSW52YWxpZER3b3JkQ291bnQ7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICBSdW5uaW5nRGlzcGFyaXR5RXJyb3JDb3VudDsg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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgTVBJX0ZDX0gKKyNkZWZpbmUgTVBJX0ZDX0gKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoKKyogICAgICAgIEYgQyAgICBEIGkgciBlIGMgdCAgICBBIGMgYyBlIHMgcyAgICAgTSBlIHMgcyBhIGcgZSBzCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBMaW5rIFNlcnZpY2UgQnVmZmVyIFBvc3QgbWVzc2FnZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xJTktfU0VSVklDRV9CVUZGRVJfUE9TVF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVmZmVyUG9zdEZsYWdzOyAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJDb3VudDsgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFNHRV9UUkFOU19TSU1QTEVfVU5JT04gIFNHTDsKK30gTVNHX0xJTktfU0VSVklDRV9CVUZGRVJfUE9TVF9SRVFVRVNULAorIE1QSV9QT0lOVEVSIFBUUl9NU0dfTElOS19TRVJWSUNFX0JVRkZFUl9QT1NUX1JFUVVFU1QsCisgIExpbmtTZXJ2aWNlQnVmZmVyUG9zdFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcExpbmtTZXJ2aWNlQnVmZmVyUG9zdFJlcXVlc3RfdDsKKworI2RlZmluZSBMSU5LX1NFUlZJQ0VfQlVGRkVSX1BPU1RfRkxBR1NfUE9SVF9NQVNLICgweDAxKQorCit0eXBlZGVmIHN0cnVjdCBfV1dORk9STUFUCit7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUG9ydE5hbWVIaWdoOyAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBQb3J0TmFtZUxvdzsgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE5vZGVOYW1lSGlnaDsgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTm9kZU5hbWVMb3c7ICAgICAgICAvKiAwQ2ggKi8KK30gV1dORk9STUFULAorICBXd25Gb3JtYXRfdDsKKworLyogTGluayBTZXJ2aWNlIEJ1ZmZlciBQb3N0IFJlcGx5ICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xJTktfU0VSVklDRV9CVUZGRVJfUE9TVF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQb3J0TnVtYmVyOyAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2Zlckxlbmd0aDsgICAgIC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zYWN0aW9uQ29udGV4dDsgLyogMThoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmN0bF9EaWQ7ICAgICAgICAgICAvKiAxQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDc2N0bF9TaWQ7ICAgICAgICAgIC8qIDIwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFR5cGVfRmN0bDsgICAgICAgICAgLyogMjRoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgU2VxQ250OyAgICAgICAgICAgICAvKiAyOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBEZmN0bDsgICAgICAgICAgICAgIC8qIDJBaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNlcUlkOyAgICAgICAgICAgICAgLyogMkJoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUnhpZDsgICAgICAgICAgICAgICAvKiAyQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBPeGlkOyAgICAgICAgICAgICAgIC8qIDJFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFBhcmFtZXRlcjsgICAgICAgICAgLyogMzBoICovCisgICAgV1dORk9STUFUICAgICAgICAgICAgICAgV3duOyAgICAgICAgICAgICAgICAvKiAzNGggKi8KK30gTVNHX0xJTktfU0VSVklDRV9CVUZGRVJfUE9TVF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19MSU5LX1NFUlZJQ0VfQlVGRkVSX1BPU1RfUkVQTFksCisgIExpbmtTZXJ2aWNlQnVmZmVyUG9zdFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBMaW5rU2VydmljZUJ1ZmZlclBvc3RSZXBseV90OworCisjZGVmaW5lIE1QSV9MU19CVUZfUE9TVF9SRVBMWV9GTEFHX05PX1JTUF9ORUVERUQgICAgKDB4ODApCisKKyNkZWZpbmUgTVBJX0ZDX0RJRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMEZGRkZGRikKKyNkZWZpbmUgTVBJX0ZDX0RJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX0ZDX1JDVExfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhGRjAwMDAwMCkKKyNkZWZpbmUgTVBJX0ZDX1JDVExfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAoMjQpCisjZGVmaW5lIE1QSV9GQ19TSURfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDBGRkZGRkYpCisjZGVmaW5lIE1QSV9GQ19TSURfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDApCisjZGVmaW5lIE1QSV9GQ19DU0NUTF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4RkYwMDAwMDApCisjZGVmaW5lIE1QSV9GQ19DU0NUTF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgKDI0KQorI2RlZmluZSBNUElfRkNfRkNUTF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwRkZGRkZGKQorI2RlZmluZSBNUElfRkNfRkNUTF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBNUElfRkNfVFlQRV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweEZGMDAwMDAwKQorI2RlZmluZSBNUElfRkNfVFlQRV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICgyNCkKKworLyogb2Jzb2xldGUgbmFtZSBmb3IgdGhlIGFib3ZlICovCisjZGVmaW5lIEZDUF9UQVJHRVRfRElEX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDBGRkZGRkYpCisjZGVmaW5lIEZDUF9UQVJHRVRfRElEX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgKDApCisjZGVmaW5lIEZDUF9UQVJHRVRfUkNUTF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgKDB4RkYwMDAwMDApCisjZGVmaW5lIEZDUF9UQVJHRVRfUkNUTF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgKDI0KQorI2RlZmluZSBGQ1BfVEFSR0VUX1NJRF9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwRkZGRkZGKQorI2RlZmluZSBGQ1BfVEFSR0VUX1NJRF9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICgwKQorI2RlZmluZSBGQ1BfVEFSR0VUX0NTQ1RMX01BU0sgICAgICAgICAgICAgICAgICAgICAgICgweEZGMDAwMDAwKQorI2RlZmluZSBGQ1BfVEFSR0VUX0NTQ1RMX1NISUZUICAgICAgICAgICAgICAgICAgICAgICgyNCkKKyNkZWZpbmUgRkNQX1RBUkdFVF9GQ1RMX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMEZGRkZGRikKKyNkZWZpbmUgRkNQX1RBUkdFVF9GQ1RMX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgRkNQX1RBUkdFVF9UWVBFX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAoMHhGRjAwMDAwMCkKKyNkZWZpbmUgRkNQX1RBUkdFVF9UWVBFX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAoMjQpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBMaW5rIFNlcnZpY2UgUmVzcG9uc2UgbWVzc2FnZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xJTktfU0VSVklDRV9SU1BfUkVRVUVTVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJzcEZsYWdzOyAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUnNwTGVuZ3RoOyAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSY3RsX0RpZDsgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIENzY3RsX1NpZDsgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHlwZV9GY3RsOyAgICAgICAgICAvKiAxNGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBTZXFDbnQ7ICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIERmY3RsOyAgICAgICAgICAgICAgLyogMUFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2VxSWQ7ICAgICAgICAgICAgICAvKiAxQmggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSeGlkOyAgICAgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIE94aWQ7ICAgICAgICAgICAgICAgLyogMUVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUGFyYW1ldGVyOyAgICAgICAgICAvKiAyMGggKi8KKyAgICBTR0VfU0lNUExFX1VOSU9OICAgICAgICBTR0w7ICAgICAgICAgICAgICAgIC8qIDI0aCAqLworfSBNU0dfTElOS19TRVJWSUNFX1JTUF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0xJTktfU0VSVklDRV9SU1BfUkVRVUVTVCwKKyAgTGlua1NlcnZpY2VSc3BSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBMaW5rU2VydmljZVJzcFJlcXVlc3RfdDsKKworI2RlZmluZSBMSU5LX1NFUlZJQ0VfUlNQX0ZMQUdTX0lNTUVESUFURSAgICAgICAgKDB4ODApCisjZGVmaW5lIExJTktfU0VSVklDRV9SU1BfRkxBR1NfUE9SVF9NQVNLICAgICAgICAoMHgwMSkKKworCisvKiBMaW5rIFNlcnZpY2UgUmVzcG9uc2UgUmVwbHkgICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xJTktfU0VSVklDRV9SU1BfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkXzAxMDBfSW5pdGlhdG9ySW5kZXg7IC8qIDA2aCAqLyAvKiBvYnNvbGV0ZSBJbml0aWF0b3JJbmRleCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJbml0aWF0b3JJbmRleDsgICAgIC8qIDE0aCAqLworfSBNU0dfTElOS19TRVJWSUNFX1JTUF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19MSU5LX1NFUlZJQ0VfUlNQX1JFUExZLAorICBMaW5rU2VydmljZVJzcFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBMaW5rU2VydmljZVJzcFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBFeHRlbmRlZCBMaW5rIFNlcnZpY2UgU2VuZCBtZXNzYWdlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0VYTElOS19TRVJWSUNFX1NFTkRfUkVRVUVTVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNlbmRGbGFnczsgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWxpYXNJbmRleDsgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3NfRGlkOyAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEVsc0NvbW1hbmRDb2RlOyAgICAgLyogMENoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiAxMGggKi8KK30gTVNHX0VYTElOS19TRVJWSUNFX1NFTkRfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19FWExJTktfU0VSVklDRV9TRU5EX1JFUVVFU1QsCisgIEV4TGlua1NlcnZpY2VTZW5kUmVxdWVzdF90LCBNUElfUE9JTlRFUiBwRXhMaW5rU2VydmljZVNlbmRSZXF1ZXN0X3Q7CisKKyNkZWZpbmUgRVhfTElOS19TRVJWSUNFX1NFTkRfRElEX01BU0sgICAgICAgICAgICgweDAwRkZGRkZGKQorI2RlZmluZSBFWF9MSU5LX1NFUlZJQ0VfU0VORF9ESURfU0hJRlQgICAgICAgICAgKDApCisjZGVmaW5lIEVYX0xJTktfU0VSVklDRV9TRU5EX01TR0ZMQUdTX01BU0sgICAgICAoMHhGRjAwMDAwMCkKKyNkZWZpbmUgRVhfTElOS19TRVJWSUNFX1NFTkRfTVNHRkxBR1NfU0hJRlQgICAgICgyNCkKKworCisvKiBFeHRlbmRlZCBMaW5rIFNlcnZpY2UgU2VuZCBSZXBseSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19FWExJTktfU0VSVklDRV9TRU5EX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBbGlhc0luZGV4OyAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlTGVuZ3RoOyAgICAgLyogMTRoICovCit9IE1TR19FWExJTktfU0VSVklDRV9TRU5EX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0VYTElOS19TRVJWSUNFX1NFTkRfUkVQTFksCisgIEV4TGlua1NlcnZpY2VTZW5kUmVwbHlfdCwgTVBJX1BPSU5URVIgcEV4TGlua1NlcnZpY2VTZW5kUmVwbHlfdDsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBGQyBBYm9ydCBtZXNzYWdlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZDX0FCT1JUX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBYm9ydEZsYWdzOyAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWJvcnRUeXBlOyAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zYWN0aW9uQ29udGV4dFRvQWJvcnQ7ICAvKiAwQ2ggKi8KK30gTVNHX0ZDX0FCT1JUX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfRkNfQUJPUlRfUkVRVUVTVCwKKyAgRmNBYm9ydFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcEZjQWJvcnRSZXF1ZXN0X3Q7CisKKyNkZWZpbmUgRkNfQUJPUlRfRkxBR19QT1JUX01BU0sgICAgICAgICAgICAgICAgICgweDAxKQorCisjZGVmaW5lIEZDX0FCT1JUX1RZUEVfQUxMX0ZDX0JVRkZFUlMgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgRkNfQUJPUlRfVFlQRV9FWEFDVF9GQ19CVUZGRVIgICAgICAgICAgICgweDAxKQorI2RlZmluZSBGQ19BQk9SVF9UWVBFX0NUX1NFTkRfUkVRVUVTVCAgICAgICAgICAgKDB4MDIpCisjZGVmaW5lIEZDX0FCT1JUX1RZUEVfRVhMSU5LU0VORF9SRVFVRVNUICAgICAgICAoMHgwMykKKworLyogRkMgQWJvcnQgUmVwbHkgKi8KK3R5cGVkZWYgc3RydWN0IF9NU0dfRkNfQUJPUlRfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfRkNfQUJPUlRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfRkNfQUJPUlRfUkVQTFksCisgIEZjQWJvcnRSZXBseV90LCBNUElfUE9JTlRFUiBwRmNBYm9ydFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBGQyBDb21tb24gVHJhbnNwb3J0IFNlbmQgbWVzc2FnZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZDX0NPTU1PTl9UUkFOU1BPUlRfU0VORF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2VuZEZsYWdzOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBbGlhc0luZGV4OyAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnc19EaWQ7ICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgQ1RDb21tYW5kQ29kZTsgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGc1R5cGU7ICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMEZoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiAxMGggKi8KK30gTVNHX0ZDX0NPTU1PTl9UUkFOU1BPUlRfU0VORF9SRVFVRVNULAorIE1QSV9QT0lOVEVSIFBUUl9NU0dfRkNfQ09NTU9OX1RSQU5TUE9SVF9TRU5EX1JFUVVFU1QsCisgIEZjQ29tbW9uVHJhbnNwb3J0U2VuZFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcEZjQ29tbW9uVHJhbnNwb3J0U2VuZFJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfRkNfQ1RfU0VORF9ESURfTUFTSyAgICAgICAgICAgICAgICAgKDB4MDBGRkZGRkYpCisjZGVmaW5lIE1QSV9GQ19DVF9TRU5EX0RJRF9TSElGVCAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgTVBJX0ZDX0NUX1NFTkRfTVNHRkxBR1NfTUFTSyAgICAgICAgICAgICgweEZGMDAwMDAwKQorI2RlZmluZSBNUElfRkNfQ1RfU0VORF9NU0dGTEFHU19TSElGVCAgICAgICAgICAgKDI0KQorCisKKy8qIEZDIENvbW1vbiBUcmFuc3BvcnQgU2VuZCBSZXBseSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19GQ19DT01NT05fVFJBTlNQT1JUX1NFTkRfUkVQTFkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFsaWFzSW5kZXg7ICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzcG9uc2VMZW5ndGg7ICAgICAvKiAxNGggKi8KK30gTVNHX0ZDX0NPTU1PTl9UUkFOU1BPUlRfU0VORF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19GQ19DT01NT05fVFJBTlNQT1JUX1NFTkRfUkVQTFksCisgIEZjQ29tbW9uVHJhbnNwb3J0U2VuZFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBGY0NvbW1vblRyYW5zcG9ydFNlbmRSZXBseV90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogRkMgUHJpbWl0aXZlIFNlbmQgbWVzc2FnZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19GQ19QUklNSVRJVkVfU0VORF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2VuZEZsYWdzOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZjUHJpbWl0aXZlWzRdOyAgICAgLyogMENoICovCit9IE1TR19GQ19QUklNSVRJVkVfU0VORF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0ZDX1BSSU1JVElWRV9TRU5EX1JFUVVFU1QsCisgIEZjUHJpbWl0aXZlU2VuZFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcEZjUHJpbWl0aXZlU2VuZFJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfRkNfUFJJTV9TRU5EX0ZMQUdTX1BPUlRfTUFTSyAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX0ZDX1BSSU1fU0VORF9GTEFHU19NTF9SRVNFVF9MSU5LICAgKDB4MDIpCisjZGVmaW5lIE1QSV9GQ19QUklNX1NFTkRfRkxBR1NfUkVTRVRfTElOSyAgICAgICgweDA0KQorI2RlZmluZSBNUElfRkNfUFJJTV9TRU5EX0ZMQUdTX1NUT1BfU0VORCAgICAgICAoMHgwOCkKKyNkZWZpbmUgTVBJX0ZDX1BSSU1fU0VORF9GTEFHU19TRU5EX09OQ0UgICAgICAgKDB4MTApCisjZGVmaW5lIE1QSV9GQ19QUklNX1NFTkRfRkxBR1NfU0VORF9BUk9VTkQgICAgICgweDIwKQorI2RlZmluZSBNUElfRkNfUFJJTV9TRU5EX0ZMQUdTX1VOVElMX0ZVTEwgICAgICAoMHg0MCkKKyNkZWZpbmUgTVBJX0ZDX1BSSU1fU0VORF9GTEFHU19GT1JFVkVSICAgICAgICAgKDB4ODApCisKKy8qIEZDIFByaW1pdGl2ZSBTZW5kIFJlcGx5ICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZDX1BSSU1JVElWRV9TRU5EX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2VuZEZsYWdzOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfRkNfUFJJTUlUSVZFX1NFTkRfUkVQTFksIE1QSV9QT0lOVE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wICsxLDIyMCBAQAorLyoKKyAqICBDb3B5cmlnaHQgKGMpIDIwMDMgTFNJIExvZ2ljIENvcnBvcmF0aW9uLgorICoKKyAqCisgKiAgICAgICAgICAgTmFtZTogIG1waV9pbmIuaAorICogICAgICAgICAgVGl0bGU6ICBNUEkgSW5iYW5kIHN0cnVjdHVyZXMgYW5kIGRlZmluaXRpb25zCisgKiAgQ3JlYXRpb24gRGF0ZTogIFNlcHRlbWJlciAzMCwgMjAwMworICoKKyAqICAgIG1waV9pbmIuaCBWZXJzaW9uOiAgMDEuMDMueHgKKyAqCisgKiAgVmVyc2lvbiBIaXN0b3J5CisgKiAgLS0tLS0tLS0tLS0tLS0tCisgKgorICogIERhdGUgICAgICBWZXJzaW9uICAgRGVzY3JpcHRpb24KKyAqICAtLS0tLS0tLSAgLS0tLS0tLS0gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogID8/LT8/LT8/ICAwMS4wMy4wMSAgT3JpZ2luYWwgcmVsZWFzZS4KKyAqICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgTVBJX0lOQl9ICisjZGVmaW5lIE1QSV9JTkJfSAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICBJIG4gYiBhIG4gZCAgICBNIGUgcyBzIGEgZyBlIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBJbmJhbmQgQnVmZmVyIFBvc3QgUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9CVUZGRVJfUE9TVF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJDb3VudDsgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCisgICAgU0dFX1RSQU5TX1NJTVBMRV9VTklPTiAgU0dMOyAgICAgICAgICAgICAgICAvKiAxMGggKi8KK30gTVNHX0lOQkFORF9CVUZGRVJfUE9TVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0lOQkFORF9CVUZGRVJfUE9TVF9SRVFVRVNULAorICBNcGlJbmJhbmRCdWZmZXJQb3N0UmVxdWVzdF90ICwgTVBJX1BPSU5URVIgcE1waUluYmFuZEJ1ZmZlclBvc3RSZXF1ZXN0X3Q7CisKKwordHlwZWRlZiBzdHJ1Y3QgX1dXTl9GQ19GT1JNQVQKK3sKKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBOb2RlTmFtZTsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFBvcnROYW1lOyAgICAgICAgICAgLyogMDhoICovCit9IFdXTl9GQ19GT1JNQVQsIE1QSV9QT0lOVEVSIFBUUl9XV05fRkNfRk9STUFULAorICBXd25GY0Zvcm1hdF90LCBNUElfUE9JTlRFUiBwV3duRmNGb3JtYXRfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX1dXTl9TQVNfRk9STUFUCit7CisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgV29ybGRXaWRlSUQ7ICAgICAgICAvKiAwMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMENoICovCit9IFdXTl9TQVNfRk9STUFULCBNUElfUE9JTlRFUiBQVFJfV1dOX1NBU19GT1JNQVQsCisgIFd3blNhc0Zvcm1hdF90LCBNUElfUE9JTlRFUiBwV3duU2FzRm9ybWF0X3Q7CisKK3R5cGVkZWYgdW5pb24gX1dXTl9JTkJBTkRfRk9STUFUCit7CisgICAgV1dOX0ZDX0ZPUk1BVCAgICAgICAgICAgRmM7CisgICAgV1dOX1NBU19GT1JNQVQgICAgICAgICAgU2FzOworfSBXV05fSU5CQU5EX0ZPUk1BVCwgTVBJX1BPSU5URVIgUFRSX1dXTl9JTkJBTkRfRk9STUFULAorICBXd25JbmJhbmRGb3JtYXQsIE1QSV9QT0lOVEVSIHBXd25JbmJhbmRGb3JtYXQ7CisKKworLyogSW5iYW5kIEJ1ZmZlciBQb3N0IHJlcGx5IG1lc3NhZ2UgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfQlVGRkVSX1BPU1RfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zZmVyTGVuZ3RoOyAgICAgLyogMTRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNhY3Rpb25Db250ZXh0OyAvKiAxOGggKi8KKyAgICBXV05fSU5CQU5EX0ZPUk1BVCAgICAgICBXd247ICAgICAgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0lkZW50aWZpZXJbNF07ICAgLyogMkNoICovCit9IE1TR19JTkJBTkRfQlVGRkVSX1BPU1RfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX0JVRkZFUl9QT1NUX1JFUExZLAorICBNcGlJbmJhbmRCdWZmZXJQb3N0UmVwbHlfdCwgTVBJX1BPSU5URVIgcE1waUluYmFuZEJ1ZmZlclBvc3RSZXBseV90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogSW5iYW5kIFNlbmQgUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfU0VORF9SRVFVRVNUCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFdXTl9JTkJBTkRfRk9STUFUICAgICAgIFd3bjsgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ1OyAgICAgICAgICAvKiAyMGggKi8KKyAgICBTR0VfSU9fVU5JT04gICAgICAgICAgICBTR0w7ICAgICAgICAgICAgICAgIC8qIDI0aCAqLworfSBNU0dfSU5CQU5EX1NFTkRfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19JTkJBTkRfU0VORF9SRVFVRVNULAorICBNcGlJbmJhbmRTZW5kUmVxdWVzdF90ICwgTVBJX1BPSU5URVIgcE1waUluYmFuZFNlbmRSZXF1ZXN0X3Q7CisKKworLyogSW5iYW5kIFNlbmQgcmVwbHkgbWVzc2FnZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9TRU5EX1JFUExZCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNwb25zZUxlbmd0aDsgICAgIC8qIDE0aCAqLworfSBNU0dfSU5CQU5EX1NFTkRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX1NFTkRfUkVQTFksCisgIE1waUluYmFuZFNlbmRSZXBseV90LCBNUElfUE9JTlRFUiBwTXBpSW5iYW5kU2VuZFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBJbmJhbmQgUmVzcG9uc2UgUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9SU1BfUkVRVUVTVAoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBXV05fSU5CQU5EX0ZPUk1BVCAgICAgICBXd247ICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0lkZW50aWZpZXJbNF07ICAgLyogMjBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzcG9uc2VMZW5ndGg7ICAgICAvKiAzMGggKi8KKyAgICBTR0VfSU9fVU5JT04gICAgICAgICAgICBTR0w7ICAgICAgICAgICAgICAgIC8qIDM0aCAqLworfSBNU0dfSU5CQU5EX1JTUF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0lOQkFORF9SU1BfUkVRVUVTVCwKKyAgTXBpSW5iYW5kUnNwUmVxdWVzdF90ICwgTVBJX1BPSU5URVIgcE1waUluYmFuZFJzcFJlcXVlc3RfdDsKKworCisvKiBJbmJhbmQgUmVzcG9uc2UgcmVwbHkgbWVzc2FnZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9SU1BfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfSU5CQU5EX1JTUF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19JTkJBTkRfUlNQX1JFUExZLAorICBNcGlJbmJhbmRSc3BSZXBseV90LCBNUElfUE9JTlRFUiBwTXBpSW5iYW5kUnNwUmVwbHlfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIEluYmFuZCBBYm9ydCBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfSU5CQU5EX0FCT1JUX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFib3J0VHlwZTsgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDb250ZXh0VG9BYm9ydDsgICAgIC8qIDEwaCAqLworfSBNU0dfSU5CQU5EX0FCT1JUX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX0FCT1JUX1JFUVVFU1QsCisgIE1waUluYmFuZEFib3J0UmVxdWVzdF90ICwgTVBJX1BPSU5URVIgcE1waUluYmFuZEFib3J0UmVxdWVzdF90OworCisjZGVmaW5lIE1QSV9JTkJBTkRfQUJPUlRfVFlQRV9BTExfQlVGRkVSUyAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX0lOQkFORF9BQk9SVF9UWVBFX0VYQUNUX0JVRkZFUiAgICAgICgweDAxKQorI2RlZmluZSBNUElfSU5CQU5EX0FCT1JUX1RZUEVfU0VORF9SRVFVRVNUICAgICAgKDB4MDIpCisjZGVmaW5lIE1QSV9JTkJBTkRfQUJPUlRfVFlQRV9SRVNQT05TRV9SRVFVRVNUICAoMHgwMykKKworCisvKiBJbmJhbmQgQWJvcnQgcmVwbHkgbWVzc2FnZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9BQk9SVF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWJvcnRUeXBlOyAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KK30gTVNHX0lOQkFORF9BQk9SVF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19JTkJBTkRfQUJPUlRfUkVQTFksCisgIE1waUluYmFuZEFib3J0UmVwbHlfdCwgTVBJX1BPSU5URVIgcE1waUluYmFuZEFib3J0UmVwbHlfdDsKKworCisjZW5kaWYKKwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX2luaXQuaCBiL2RyaXZlcnMvbWVzc2FnZS9mdXNpb24vbHNpL21waV9pbml0LmgKbmV3IGZpbGU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SBJTyByZXF1ZXN0cy4KKyAqICAxMS0xNS0wMiAgMDEuMDIuMDYgIEFkZGVkIHNwZWNpYWwgZXh0ZW5kZWQgU0NTSSBTdGF0dXMgZGVmaW5lcyBmb3IgRkNQLgorICogIDA2LTI2LTAzICAwMS4wMi4wNyAgQWRkZWQgTVBJX1NDU0lfU1RBVFVTX0ZDUEVYVF9VTkFTU0lHTkVEIGRlZmluZS4KKyAqICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgTVBJX0lOSVRfSAorI2RlZmluZSBNUElfSU5JVF9ICisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgUyBDIFMgSSAgICBJIG4gaSB0IGkgYSB0IG8gciAgICBNIGUgcyBzIGEgZyBlIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBTQ1NJIElPIG1lc3NhZ2VzIGFuZCBhc3NvY2lhdGVkIHN0cnVjdHVyZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfU0NTSV9JT19SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDREJMZW5ndGg7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNlbnNlQnVmZmVyTGVuZ3RoOyAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTFVOWzhdOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDb250cm9sOyAgICAgICAgICAgIC8qIDE0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENEQlsxNl07ICAgICAgICAgICAgLyogMThoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgRGF0YUxlbmd0aDsgICAgICAgICAvKiAyOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBTZW5zZUJ1ZmZlckxvd0FkZHI7IC8qIDJDaCAqLworICAgIFNHRV9JT19VTklPTiAgICAgICAgICAgIFNHTDsgICAgICAgICAgICAgICAgLyogMzBoICovCit9IE1TR19TQ1NJX0lPX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfU0NTSV9JT19SRVFVRVNULAorICBTQ1NJSU9SZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHB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gweDAwMjAwMDAwKQorI2RlZmluZSBNUElfU0NTSUlPX0NPTlRST0xfTFVOX1JFU0VUX1JTViAgICAgICAgKDB4MDAxMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJSU9fQ09OVFJPTF9SRVNFUlZFRCAgICAgICAgICAgICAoMHgwMDA4MDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lJT19DT05UUk9MX0NMUl9UQVNLX1NFVF9SU1YgICAgICgweDAwMDQwMDAwKQorI2RlZmluZSBNUElfU0NTSUlPX0NPTlRST0xfQUJPUlRfVEFTS19TRVQgICAgICAgKDB4MDAwMjAwMDApCisjZGVmaW5lIE1QSV9TQ1NJSU9fQ09OVFJPTF9SRVNFUlZFRDIgICAgICAgICAgICAoMHgwMDAxMDAwMCkKKworCisvKiBTQ1NJIElPIHJlcGx5IHN0cnVjdHVyZSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19TQ1NJX0lPX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDREJMZW5ndGg7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNlbnNlQnVmZmVyTGVuZ3RoOyAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU0NTSVN0YXR1czsgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTQ1NJU3RhdGU7ICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2ZlckNvdW50OyAgICAgIC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNlbnNlQ291bnQ7ICAgICAgICAgLyogMThoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzcG9uc2VJbmZvOyAgICAgICAvKiAxQ2ggKi8KK30gTVNHX1NDU0lfSU9fUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfU0NTSV9JT19SRVBMWSwKKyAgU0NTSUlPUmVwbHlfdCwgTVBJX1BPSU5URVIgcFNDU0lJT1JlcGx5X3Q7CisKKworLyogU0NTSSBJTyBSZXBseSBTQ1NJU3RhdHVzIHZhbHVlcyAoU0FNLTIgc3RhdHVzIGNvZGVzKSAqLworCisjZGVmaW5lIE1QSV9TQ1NJX1NUQVRVU19TVUNDRVNTICAgICAgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1NDU0lfU1RBVFVTX0NIRUNLX0NPTkRJVElPTiAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0NTSV9TVEFUVVNfQ09ORElUSU9OX01FVCAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9TQ1NJX1NUQVRVU19CVVNZICAgICAgICAgICAgICAgICAgICAoMHgwOCkKKyNkZWZ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KQorI2RlZmluZSBNUElfU0NTSV9TVEFURV9RVUVVRV9UQUdfUkVKRUNURUQgICAgICAgKDB4MjApCisKKy8qIFNDU0kgSU8gUmVwbHkgUmVzcG9uc2VJbmZvIHZhbHVlcyAqLworLyogKEZDUC0xIFJTUF9DT0RFIHZhbHVlcyBhbmQgU1BJLTMgUGFja2V0aXplZCBGYWlsdXJlIGNvZGVzKSAqLworCisjZGVmaW5lIE1QSV9TQ1NJX1JTUF9JTkZPX0ZVTkNUSU9OX0NPTVBMRVRFICAgICAoMHgwMDAwMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lfUlNQX0lORk9fRkNQX0JVUlNUX0xFTl9FUlJPUiAgICgweDAxMDAwMDAwKQorI2RlZmluZSBNUElfU0NTSV9SU1BfSU5GT19DTU5EX0ZJRUxEU19JTlZBTElEICAgKDB4MDIwMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJX1JTUF9JTkZPX0ZDUF9EQVRBX1JPX0VSUk9SICAgICAoMHgwMzAwMDAwMCkKKyNkZWZpbmUgTVBJX1NDU0lfUlNQX0lORk9fVEFTS19NR01UX1VOU1VQUE9SVEVEICgweDA0MDAwMDAwKQorI2RlZmluZSBNUElfU0NTSV9SU1BfSU5GT19UQVNLX01HTVRfRkFJTEVEICAgICAgKDB4MDUwMDAwMDApCisjZGVmaW5lIE1QSV9TQ1NJX1JTUF9JTkZPX1NQSV9MUV9JTlZBTElEX1RZUEUgICAoMHgwNjAwMDAwMCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBTQ1NJIElPIDMyIFJlcXVlc3QgbWVzc2FnZSBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfU0NTSV9JTzMyX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUYXJnZXRJRDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1czsgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENEQkxlbmd0aDsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2Vuc2VCdWZmZXJMZW5ndGg7ICAvKiAwNWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBMVU5bOF07ICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIENvbnRyb2w7ICAgICAgICAgICAgLyogMTRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ0RCWzMyXTsgICAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBEYXRhTGVuZ3RoOyAgICAgICAgIC8qIDM4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNlbnNlQnVmZmVyTG93QWRkcjsgLyogM0NoICovCisgICAgU0dFX0lPX1VOSU9OICAgICAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiA0MGggKi8KK30gTVNHX1NDU0lfSU8zMl9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX1NDU0lfSU8zMl9SRVFVRVNULAorICBTQ1NJSU8zMlJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcFNDU0lJTzMyUmVxdWVzdF90OworCisvKiBTQ1NJIElPIDMyIHVzZXMgdGhlIHNhbWUgZGVmaW5lcyBhcyBhYm92ZSBmb3IgU0NTSSBJTyAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIFNDU0kgVGFzayBNYW5hZ2VtZW50IG1lc3NhZ2VzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19TQ1NJX1RBU0tfTUdNVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVzOyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUYXNrVHlwZTsgICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExVTls4XTsgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyWzddOyAgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUYXNrTXNnQ29udGV4dDsgICAgIC8qIDMwaCAqLworfSBNU0dfU0NTSV9UQVNLX01HTVQsIE1QSV9QT0lOVEVSIFBUUl9TQ1NJX1RBU0tfTUdNVCwKKyAgU0NTSVRhc2tNZ210X3QsIE1QSV9QT0lOVEVSIHBTQ1NJVGFza01nbXRfdDsKKworLyogVGFza1R5cGUgdmFsdWVzICovCisKKyNkZWZpbmUgTVBJX1NDU0lUQVNLTUdNVF9UQVNLVFlQRV9BQk9SVF9UQVNLICAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9TQ1NJVEFTS01HTVRfVEFTS1RZUEVfQUJSVF9UQVNLX1NFVCAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0NTSVRBU0tNR01UX1RBU0tUWVBFX1RBUkdFVF9SRVNFVCAgICAgICAgICAoMHgwMykKKyNkZWZpbmUgTVBJX1NDU0lUQVNLTUdNVF9UQVNLVFlQRV9SRVNFVF9CVVMgICAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9TQ1NJVEFTS01HTVRfVEFTS1RZUEVfTE9HSUNBTF9VTklUX1JFU0VUICAgICgweDA1KQorI2RlZmluZSBNUElfU0NTSVRBU0tNR01UX1RBU0tUWVBFX0NMRUFSX1RBU0tfU0VUICAgICAgICAoMHgwNikKKworLyogTXNnRmxhZ3MgYml0cyAqLworI2RlZmluZSBNUElfU0NTSVRBU0tNR01UX01TR0ZMQUdTX1RBUkdFVF9SRVNFVF9PUFRJT04gICAoMHgwMCkKKyNkZWZpbmUgTVBJX1NDU0lUQVNLTUdNVF9NU0dGTEFHU19MSVBfUkVTRVRfT1BUSU9OICAgICAgKDB4MDIpCisjZGVmaW5lIE1QSV9TQ1NJVEFTS01HTVRfTVNHRkxBR1NfTElQUkVTRVRfUkVTRVRfT1BUSU9OICgweDA0KQorCisvKiBTQ1NJIFRhc2sgTWFuYWdlbWVudCBSZXBseSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19TQ1NJX1RBU0tfTUdNVF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVzOyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUYXNrVHlwZTsgICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMlsyXTsgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRlcm1pbmF0aW9uQ291bnQ7ICAgLyogMTRoICovCit9IE1TR19TQ1NJX1RBU0tfTUdNVF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19TQ1NJX1RBU0tfTUdNVF9SRVBMWSwKKyAgU0NTSVRhc2tNZ210UmVwbHlfdCwgTVBJX1BPSU5URVIgcFNDU0lUYXNrTWdtdFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgU0NTSSBFbmNsb3N1cmUgUHJvY2Vzc29yIG1lc3NhZ2VzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1NFUF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBY3Rpb247ICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICA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AgICAgICAgICAgICgweDEwMDAwMDAwKQorI2RlZmluZSBNUElfU0VQX1JFUV9TTE9UU1RBVFVTX1NXQVBfUkVTRVQgICAgICAgICAgICAgICAoMHg4MDAwMDAwMCkKKworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1NFUF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVzOyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWN0aW9uOyAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNsb3RTdGF0dXM7ICAgICAgICAgLyogMTRoICovCit9IE1TR19TRVBfUkV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IEFkZGVkIGRlZmluZSBmb3IKKyAqICAgICAgICAgICAgICAgICAgICAgIE1QSV9JT0NGQUNUU19FWENFUFRfUkFJRF9DT05GSUdfSU5WQUxJRC4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIEFsaWFzSW5kZXggdG8gRVZFTlRfREFUQV9MT0dPVVQgc3RydWN0dXJlLgorICogIDA0LTAxLTAzICAwMS4wMi4wNyAgQWRkZWQgZGVmaW5lcyBmb3IgTVBJX0ZXX0hFQURFUl9TSUdOQVRVUkVfLgorICogIDA2LTI2LTAzICAwMS4wMi4wOCAgQWRkZWQgbmV3IHZhbHVlcyB0byB0aGUgcHJvZHVjdCBmYW1pbHkgZGVmaW5lcy4KKyAqICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICovCisKKyNpZm5kZWYgTVBJX0lPQ19ICisjZGVmaW5lIE1QSV9JT0NfSAorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgICAgICAgIEkgTyBDICAgIE0gZSBzIHMgYSBnIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIElPQ0luaXQgbWVzc2FnZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19JT0NfSU5JVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFdob0luaXQ7ICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTWF4RGV2aWNlczsgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1heEJ1c2VzOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlcGx5RnJhbWVTaXplOyAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbMl07ICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSG9zdE1mYUhpZ2hBZGRyOyAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNlbnNlQnVmZmVySGlnaEFkZHI7ICAgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXBseUZpZm9Ib3N0U2lnbmFsaW5nQWRkcjsgLyogMThoICovCit9IE1TR19JT0NfSU5JVCwgTVBJX1BPSU5URVIgUFRSX01TR19JT0NfSU5JVCwKKyAgSU9DSW5pdF90LCBNUElfUE9JTlRFUiBwSU9DSW5pdF90OworCisvKiBXaG9Jbml0IHZhbHVlcyAqLworI2RlZmluZSBNUElfV0hPSU5JVF9OT19PTkUgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfV0hPSU5JVF9TWVNURU1fQklPUyAgICAgICAgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfV0hPSU5JVF9ST01fQklPUyAgICAgICAgICAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfV0hPSU5JVF9QQ0lfUEVFUiAgICAgICAgICAgICAgICAgICAgICAgICgweDAzKQorI2RlZmluZSBNUElfV0hPSU5JVF9IT1NUX0RSSVZFUiAgICAgICAgICAgICAgICAgICAgICgweDA0KQorI2RlZmluZSBNUElfV0hPSU5JVF9NQU5VRkFDVFVSRVIgICAgICAgICAgICAgICAgICAgICgweDA1KQorCisvKiBGbGFncyB2YWx1ZXMgKi8KKyNkZWZpbmUgTVBJX0lPQ0lOSVRfRkxBR1NfRElTQ0FSRF9GV19JTUFHRSAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX0lPQ0lOSVRfRkxBR1NfUkVQTFlfRklGT19IT1NUX1NJR05BTCAgICAoMHgwMikKKwordHlwZWRlZiBzdHJ1Y3QgX01TR19JT0NfSU5JVF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFdob0luaXQ7ICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTWF4RGV2aWNlczsgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1heEJ1c2VzOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfSU9DX0lOSVRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU9DX0lOSVRfUkVQTFksCisgIElPQ0luaXRSZXBseV90LCBNUElfUE9JTlRFUiBwSU9DSW5pdFJlcGx5X3Q7CisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBJT0MgRmFjdHMgbWVzc2FnZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfSU9DX0ZBQ1RTCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWRbMl07ICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxWzNdOyAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCit9IE1TR19JT0NfRkFDVFMsIE1QSV9QT0lOVEVSIFBUUl9JT0NfRkFDVFMsCisgIElPQ0ZhY3RzX3QsIE1QSV9QT0lOVEVSIHBJT0NGYWN0c190OworCit0eXBlZGVmIHN0cnVjdCBfTVBJX0ZXX1ZFUlNJT05fU1RSVUNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRGV2OyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFVuaXQ7ICAgICAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNaW5vcjsgICAgICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTWFqb3I7ICAgICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworfSBNUElfRldfVkVSU0lPTl9TVFJVQ1Q7CisKK3R5cGVkZWYgdW5pb24gX01QSV9GV19WRVJTSU9OCit7CisgICAgTVBJX0ZXX1ZFUlNJT05fU1RSVUNUICAgU3RydWN0OworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFdvcmQ7Cit9IE1QSV9GV19WRVJTSU9OOworCisvKiBJT0MgRmFjdHMgUmVwbHkgKi8KK3R5cGVkZWYgc3RydWN0IF9NU0dfSU9DX0ZBQ1RTX1JFUExZCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgTXNnVmVyc2lvbjsgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSGVhZGVyVmVyc2lvbjsgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIElPQ051bWJlcjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ0V4Y2VwdGlvbnM7ICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1heENoYWluRGVwdGg7ICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBXaG9Jbml0OyAgICAgICAgICAgICAgICAgICAgLyogMTVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQmxvY2tTaXplOyAgICAgICAgICAgICAgICAgIC8qIDE2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgICAgICAvKiAxN2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXBseVF1ZXVlRGVwdGg7ICAgICAgICAgICAgLyogMThoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVxdWVzdEZyYW1lU2l6ZTsgICAgICAgICAgIC8qIDFBaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkXzAxMDFfRldWZXJzaW9uOyAgICAvKiAxQ2ggKi8gLyogb2Jzb2xldGUgMTYtYml0IEZXVmVyc2lvbiAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFByb2R1Y3RJRDsgICAgICAgICAgICAgICAgICAvKiAxRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBDdXJyZW50SG9zdE1mYUhpZ2hBZGRyOyAgICAgLyogMjBoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgR2xvYmFsQ3JlZGl0czsgICAgICAgICAgICAgIC8qIDI0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE51bWJlck9mUG9ydHM7ICAgICAgICAgICAgICAvKiAyNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBFdmVudFN0YXRlOyAgICAgICAgICAgICAgICAgLyogMjdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ3VycmVudFNlbnNlQnVmZmVySGlnaEFkZHI7IC8qIDI4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIEN1clJlcGx5RnJhbWVTaXplOyAgICAgICAgICAvKiAyQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNYXhEZXZpY2VzOyAgICAgICAgICAgICAgICAgLyogMkVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTWF4QnVzZXM7ICAgICAgICAgICAgICAgICAgIC8qIDJGaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEZXSW1hZ2VTaXplOyAgICAgICAgICAgICAgICAvKiAzMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NDYXBhYmlsaXRpZXM7ICAgICAgICAgICAgLyogMzRoICovCisgICAgTVBJX0ZXX1ZFUlNJT04gICAgICAgICAgRldWZXJzaW9uOyAgICAgICAgICAgICAgICAgIC8qIDM4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIEhpZ2hQcmlvcml0eVF1ZXVlRGVwdGg7ICAgICAvKiAzQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogM0VoICovCit9IE1TR19JT0NfRkFDVFNfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU9DX0ZBQ1RTX1JFUExZLAorICBJT0NGYWN0c1JlcGx5X3QsIE1QSV9QT0lOVEVSIHBJT0NGYWN0c1JlcGx5X3Q7CisKKyNkZWZpbmUgTVBJX0lPQ0ZBQ1RTX01TR1ZFUlNJT05fTUFKT1JfTUFTSyAgICAgICAgICAoMHhGRjAwKQorI2RlZmluZSBNUElfSU9DRkFDVFNfTVNHVkVSU0lPTl9NSU5PUl9NQVNLICAgICAgICAgICgweDAwRkYpCisKKyNkZWZpbmUgTVBJX0lPQ0ZBQ1RTX0hFQURFUlZFUlNJT05fVU5JVF9NQVNLICAgICAgICAoMHhGRjAwKQorI2RlZmluZSBNUElfSU9DRkFDVFNfSEVBREVSVkVSU0lPTl9ERVZfTUFTSyAgICAgICAgICgweDAwRkYpCisKKyNkZWZpbmUgTVBJX0lPQ0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IwKQorI2RlZmluZSBNUElfSU9DRkFDVFNfQ0FQQUJJTElUWV9FRURQICAgICAgICAgICAgICAgICgweDAwMDAwMDQwKQorCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgUCBvIHIgdCAgICBNIGUgcyBzIGEgZyBlIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBQb3J0IEZhY3RzIG1lc3NhZ2UgYW5kIFJlcGx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfUE9SVF9GQUNUUworeworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkWzJdOyAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgIFU4ICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMVsyXTsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBQb3J0TnVtYmVyOyAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgIFU4ICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgICBVMzIgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KK30gTVNHX1BPUlRfRkFDVFMsIE1QSV9QT0lOVEVSIFBUUl9NU0dfUE9SVF9GQUNUUywKKyAgUG9ydEZhY3RzX3QsIE1QSV9QT0lOVEVSIHBQb3J0RmFjdHNfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX01TR19QT1JUX0ZBQ1RTX1JFUExZCit7CisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgIFUzMiAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgICBVMTYgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICAgVTE2ICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgIFUzMiAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBQb3J0VHlwZTsgICAgICAgICAgICAgICAgICAgLyogMTVoICovCisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgTWF4RGV2aWNlczsgICAgICAgICAgICAgICAgIC8qIDE2aCAqLworICAgICBVMTYgICAgICAgICAgICAgICAgICAgIFBvcnRTQ1NJSUQ7ICAgICAgICAgICAgICAgICAvKiAxOGggKi8KKyAgICAgVTE2ICAgICAgICAgICAgICAgICAgICBQcm90b2NvbEZsYWdzOyAgICAgICAgICAgICAgLyogMUFoICovCisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgTWF4UG9zdGVkQ21kQnVmZmVyczsgICAgICAgIC8qIDFDaCAqLworICAgICBVMTYgICAgICAgICAgICAgICAgICAgIE1heFBlcnNpc3RlbnRJRHM7ICAgICAgICAgICAvKiAxRWggKi8KKyAgICAgVTE2ICAgICAgICAgICAgICAgICAgICBNYXhMYW5CdWNrZXRzOyAgICAgICAgICAgICAgLyogMjBoICovCisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAgICAgICAgIC8qIDIyaCAqLworICAgICBVMzIgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNTsgICAgICAgICAgICAgICAgICAvKiAyNGggKi8KK30gTVNHX1BPUlRfRkFDVFNfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfUE9SVF9GQUNUU19SRVBMWSwKKyAgUG9ydEZhY3RzUmVwbHlfdCwgTVBJX1BPSU5URVIgcFBvcnRGYWN0c1JlcGx5X3Q7CisKKworLyogUG9ydFR5cGVzIHZhbHVlcyAqLworCisjZGVmaW5lIE1QSV9QT1JURkFDVFNfUE9SVFRZUEVfSU5BQ1RJVkUgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1BPUlRGQUNUU19QT1JUVFlQRV9TQ1NJICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfUE9SVEZBQ1RTX1BPUlRUWVBFX0ZDICAgICAgICAgICAgICAgKDB4MTApCisjZGVmaW5lIE1QSV9QT1JURkFDVFNfUE9SVFRZUEVfSVNDU0kgICAgICAgICAgICAoMHgyMCkKKyNkZWZpbmUgTVBJX1BPUlRGQUNUU19QT1JUVFlQRV9TQVMgICAgICAgICAgICAgICgweDMwKQorCisvKiBQcm90b2NvbEZsYWdzIHZhbHVlcyAqLworCisjZGVmaW5lIE1QSV9QT1JURkFDVFNfUFJPVE9DT0xfTE9HQlVTQUREUiAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1BPUlRGQUNUU19QUk9UT0NPTF9MQU4gICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfUE9SVEZBQ1RTX1BST1RPQ09MX1RBUkdFVCAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9QT1JURkFDVFNfUFJPVE9DT0xfSU5JVElBVE9SICAgICAgICAoMHgwOCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBQb3J0IEVuYWJsZSBNZXNzYWdlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfUE9SVF9FTkFCTEUKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZFsyXTsgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbMl07ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUG9ydE51bWJlcjsgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCit9IE1TR19QT1JUX0VOQUJMRSwgTVBJX1BPSU5URVIgUFRSX01TR19QT1JUX0VOQUJMRSwKKyAgUG9ydEVuYWJsZV90LCBNUElfUE9JTlRFUiBwUG9ydEVuYWJsZV90OworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1BPUlRfRU5BQkxFX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWRbMl07ICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxWzJdOyAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgICAgICAgICAvKiAwNWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfUE9SVF9FTkFCTEVfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfUE9SVF9FTkFCTEVfUkVQTFksCisgIFBvcnRFbmFibGVSZXBseV90LCBNUElfUE9JTlRFUiBwUG9ydEVuYWJsZVJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgRSB2IGUgbiB0ICAgIE0gZSBzIHMgYSBnIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIEV2ZW50IE5vdGlmaWNhdGlvbiBtZXNzYWdlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19FVkVOVF9OT1RJRlkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTd2l0Y2g7ICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxWzNdOyAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCit9IE1TR19FVkVOVF9OT1RJRlksIE1QSV9QT0lOVEVSIFBUUl9NU0dfRVZFTlRfTk9USUZZLAorICBFdmVudE5vdGlmaWNhdGlvbl90LCBNUElfUE9JTlRFUiBwRXZlbnROb3RpZmljYXRpb25fdDsKKworLyogRXZlbnQgTm90aWZpY2F0aW9uIFJlcGx5ICovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfRVZFTlRfTk9USUZZX1JFUExZCit7CisgICAgIFUxNiAgICAgICAgICAgICAgICAgICAgRXZlbnREYXRhTGVuZ3RoOyAgICAgICAgICAgIC8qIDAwaCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgIFU4ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxWzJdOyAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIEFja1JlcXVpcmVkOyAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICAgVTggICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgIFUzMiAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgICBVOCAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMlsyXTsgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICAgVTE2ICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgIFUzMiAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgICBVMzIgICAgICAgICAgICAgICAgICAgIEV2ZW50OyAgICAgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICAgVTMyICAgICAgICAgICAgICAgICAgICBFdmVudENvbnRleHQ7ICAgICAgICAgICAgICAgLyogMThoICovCisgICAgIFUzMiAgICAgICAgICAgICAgICAgICAgRGF0YVsxXTsgICAgICAgICAgICAgICAgICAgIC8qIDFDaCAqLworfSBNU0dfRVZFTlRfTk9USUZZX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0VWRU5UX05PVElGWV9SRVBMWSwKKyAgRXZlbnROb3RpZmljYXRpb25SZXBseV90LCBNUElfUE9JTlRFUiBwRXZlbnROb3RpZmljYXRpb25SZXBseV90OworCisvKiBFdmVudCBBY2tub3dsZWRnZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0VWRU5UX0FDSworeworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkWzJdOyAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMVszXTsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEV2ZW50OyAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBFdmVudENvbnRleHQ7ICAgICAgICAgICAgICAgLyogMTBoICovCit9IE1TR19FVkVOVF9BQ0ssIE1QSV9QT0lOVEVSIFBUUl9NU0dfRVZFTlRfQUNLLAorICBFdmVudEFja190LCBNUElfUE9JTlRFUiBwRXZlbnRBY2tfdDsKKwordHlwZWRlZiBzdHJ1Y3QgX01TR19FVkVOVF9BQ0tfUkVQTFkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZFsyXTsgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbM107ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgICAgICAgICAvKiAxMGggKi8KK30gTVNHX0VWRU5UX0FDS19SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19FVkVOVF9BQ0tfUkVQTFksCisgIEV2ZW50QWNrUmVwbHlfdCwgTVBJX1BPSU5URVIgcEV2ZW50QWNrUmVwbHlfdDsKKworLyogU3dpdGNoICovCisKKyNkZWZpbmUgTVBJX0VWRU5UX05PVElGSUNBVElPTl9TV0lUQ0hfT0ZGICAgKDB4MDApCisjZGVmaW5lIE1QSV9FVkVOVF9OT1RJRklDQVRJT05fU1dJVENIX09OICAgICgweDAxKQorCisvKiBFdmVudCAqLworCisjZGVmaW5lIE1QSV9FVkVOVF9OT05FICAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAwKQorI2RlZmluZSBNUElfRVZFTlRfTE9HX0RBVEEgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMSkKKyNkZWZpbmUgTVBJX0VWRU5UX1NUQVRFX0NIQU5HRSAgICAgICAgICAgICAgKDB4MDAwMDAwMDIpCisjZGVmaW5lIE1QSV9FVkVOVF9VTklUX0FUVEVOVElPTiAgICAgICAgICAgICgweDAwMDAwMDAzKQorI2RlZmluZSBNUElfRVZFTlRfSU9DX0JVU19SRVNFVCAgICAgICAgICAgICAoMHgwMDAwMDAwNCkKKyNkZWZpbmUgTVBJX0VWRU5UX0VYVF9CVVNfUkVTRVQgICAgICAgICAgICAgKDB4MDAwMDAwMDUpCisjZGVmaW5lIE1QSV9FVkVOVF9SRVNDQU4gICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDA2KQorI2RlZmluZSBNUElfRVZFTlRfTElOS19T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RU5UX0NIQU5HRQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEV2ZW50U3RhdGU7ICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworfSBFVkVOVF9EQVRBX0VWRU5UX0NIQU5HRSwgTVBJX1BPSU5URVIgUFRSX0VWRU5UX0RBVEFfRVZFTlRfQ0hBTkdFLAorICBFdmVudERhdGFFdmVudENoYW5nZV90LCBNUElfUE9JTlRFUiBwRXZlbnREYXRhRXZlbnRDaGFuZ2VfdDsKKworLyogU0NTSSBFdmVudCBkYXRhIGZvciBQb3J0LCBCdXMgYW5kIERldmljZSBmb3JtcyAqLworCit0eXBlZGVmIHN0cnVjdCBfRVZFTlRfREFUQV9TQ1NJCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1c1BvcnQ7ICAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDJoICovCit9IEVWRU5UX0RBVEFfU0NTSSwgTVBJX1BPSU5URVIgUFRSX0VWRU5UX0RBVEFfU0NTSSwKKyAgRXZlbnREYXRhU2NzaV90LCBNUElfUE9JTlRFUiBwRXZlbnREYXRhU2NzaV90OworCisvKiBTQ1NJIERldmljZSBTdGF0dXMgQ2hhbmdlIEV2ZW50IGRhdGEgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0VWRU5UX0RBVEFfU0NTSV9ERVZJQ0VfU1RBVFVTX0NIQU5HRQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVhc29uQ29kZTsgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIExVTjsgICAgICAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBU0M7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQVNDUTsgICAgICAgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KK30gRVZFTlRfREFUQV9TQ1NJX0RFVklDRV9TVEFUVVNfQ0hBTkdFLAorICBNUElfUE9JTlRFUiBQVFJfRVZFTlRfREFUQV9TQ1NJX0RFVklDRV9TVEFUVVNfQ0hBTkdFLAorICBNcGlFdmVudERhdGFTY3NpRGV2aWNlU3RhdHVzQ2hhbmdlX3QsCisgIE1QSV9QT0lOVEVSIHBNcGlFdmVudERhdGFTY3NpRGV2aWNlU3RhdHVzQ2hhbmdlX3Q7CisKKy8qIE1QSSBTQ1NJIERldmljZSBTdGF0dXMgQ2hhbmdlIEV2ZW50IGRhdGEgUmVhc29uQ29kZSB2YWx1ZXMgKi8KKyNkZWZpbmUgTVBJX0VWRU5UX1NDU0lfREVWX1NUQVRfUkNfQURERUQgICAgICAgICAgICAgICAgKDB4MDMpCisjZGVmaW5lIE1QSV9FVkVOVF9TQ1NJX0RFVl9TVEFUX1JDX05PVF9SRVNQT05ESU5HICAgICAgICgweDA0KQorI2RlZmluZSBNUElfRVZFTlRfU0NTSV9ERVZfU1RBVF9SQ19TTUFSVF9EQVRBICAgICAgICAgICAoMHgwNSkKKworLyogU0FTIERldmljZSBTdGF0dXMgQ2hhbmdlIEV2ZW50IGRhdGEgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0VWRU5UX0RBVEFfU0FTX0RFVklDRV9TVEFUVVNfQ0hBTkdFCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SUQ7ICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1czsgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZWFzb25Db2RlOyAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFTQzsgICAgICAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBU0NROyAgICAgICAgICAgICAgICAgICAgICAgLyogMDVoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgRGV2SGFuZGxlOyAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERldmljZUluZm87ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KK30gRVZFTlRfREFUQV9TQVNfREVWSUNFX1NUQVRVU19DSEFOR0UsCisgIE1QSV9QT0lOVEVSIFBUUl9FVkVOVF9EQVRBX1NBU19ERVZJQ0VfU1RBVFVTX0NIQU5HRSwKKyAgTXBpRXZlbnREYXRhU2FzRGV2aWNlU3RhdHVzQ2hhbmdlX3QsCisgIE1QSV9QT0lOVEVSIHBNcGlFdmVudERhdGFTYXNEZXZpY2VTdGF0dXNDaGFuZ2VfdDsKKworLyogTVBJIFNBUyBEZXZp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AgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQb3J0OyAgICAgICAgICAgICAgICAgICAgICAgLyogMDVoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworfSBFVkVOVF9EQVRBX0xJTktfU1RBVFVTLCBNUElfUE9JTlRFUiBQVFJfRVZFTlRfREFUQV9MSU5LX1NUQVRVUywKKyAgRXZlbnREYXRhTGlua1N0YXR1c190LCBNUElfUE9JTlRFUiBwRXZlbnREYXRhTGlua1N0YXR1c190OworCisjZGVmaW5lIE1QSV9FVkVOVF9MSU5LX1NUQVRVU19GQUlMVVJFICAgICAgICgweDAwMDAwMDAwKQorI2RlZmluZSBNUElfRVZFTlRfTElOS19TVEFUVVNfQUNUSVZFICAgICAgICAoMHgwMDAwMDAwMSkKKworLyogTVBJIExvb3AgU3RhdGUgQ2hhbmdlIEV2ZW50IGRhdGEgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX0VWRU5UX0RBVEFfTE9PUF9TVEFURQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYXJhY3RlcjQ7ICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXIzOyAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVHlwZTsgICAgICAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUG9ydDsgICAgICAgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KK30gRVZFTlRfREFUQV9MT09QX1NUQVRFLCBNUElfUE9JTlRFUiBQVFJfRVZFTlRfREFUQV9MT09QX1NUQVRFLAorICBFdmVudERhdGFMb29wU3RhdGVfdCwgTVBJX1BPSU5URVIgcEV2ZW50RGF0YUxvb3BTdGF0ZV90OworCisjZGVmaW5lIE1QSV9FVkVOVF9MT09QX1NUQVRFX0NIQU5HRV9MSVAgICAgICgweDAwMDEpCisjZGVmaW5lIE1QSV9FVkVOVF9MT09QX1NUQVRFX0NIQU5HRV9MUEUgICAgICgweDAwMDIpCisjZGVmaW5lIE1QSV9FVkVOVF9MT09QX1NUQVRFX0NIQU5HRV9MUEIgICAgICgweDAwMDMpCisKKy8qIE1QSSBMT0dPVVQgRXZlbnQgZGF0YSAqLworCit0eXBlZGVmIHN0cnVjdCBfRVZFTlRfREFUQV9MT0dPVVQKK3sKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBOUG9ydElEOyAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWxpYXNJbmRleDsgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnQ7ICAgICAgICAgICAgICAgICAgICAgICAvKiAwNWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCit9IEVWRU5UX0RBVEFfTE9HT1VULCBNUElfUE9JTlRFUiBQVFJfRVZFTlRfREFUQV9MT0dPVVQsCisgIEV2ZW50RGF0YUxvZ291dF90LCBNUElfUE9JTlRFUiBwRXZlbnREYXRhTG9nb3V0X3Q7CisKKyNkZWZpbmUgTVBJX0VWRU5UX0xPR09VVF9BTExfQUxJQVNFUyAgICAgICAgKDB4RkYpCisKKworLyogTVBJIEludGVncmF0ZWQgUkFJRCBFdmVudCBkYXRhICovCisKK3R5cGVkZWYgc3RydWN0IF9FVkVOVF9EQVRBX1JBSUQKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVJRDsgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lQnVzOyAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlYXNvbkNvZGU7ICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza051bTsgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQVNDOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFTQ1E7ICAgICAgICAgICAgICAgICAgICAgICAvKiAwNWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3NTdGF0dXM7ICAgICAgICAgICAgIC8qIDA4aCAqLworfSBFVkVOVF9EQVRBX1JBSUQsIE1QSV9QT0lOVEVSIFBUUl9FVkVOVF9EQVRBX1JBSUQsCisgIE1waUV2ZW50RGF0YVJhaWRfdCwgTVBJX1BPSU5URVIgcE1waUV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CAgICAgICAgKDB4MEIpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgRiBpIHIgbSB3IGEgciBlICAgIEwgbyBhIGQgICAgTSBlIHMgcyBhIGcgZSBzCisqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgRmlybXdhcmUgRG93bmxvYWQgbWVzc2FnZSBhbmQgYXNzb2NpYXRlZCBzdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZXX0RPV05MT0FECit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSW1hZ2VUeXBlOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMVszXTsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFNHRV9NUElfVU5JT04gICAgICAgICAgIFNHTDsgICAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KK30gTVNHX0ZXX0RPV05MT0FELCBNUElfUE9JTlRFUiBQVFJfTVNHX0ZXX0RPV05MT0FELAorICBGV0Rvd25sb2FkX3QsIE1QSV9QT0lOVEVSIHBGV0Rvd25sb2FkX3Q7CisKKyNkZWZpbmUgTVBJX0ZXX0RPV05MT0FEX0lUWVBFX1JFU0VSVkVEICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9GV19ET1dOTE9BRF9JVFlQRV9GVyAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfRldfRE9XTkxPQURfSVRZUEVfQklPUyAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX0ZXX0RPV05MT0FEX0lUWVBFX05WREFUQSAgICAgICAgKDB4MDMpCisjZGVmaW5lIE1QSV9GV19ET1dOTE9BRF9JVFlQRV9CT09UTE9BREVSICAgICgweDA0KQorCisKK3R5cGVkZWYgc3RydWN0IF9GV0Rvd25sb2FkVENTR0UKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29udGV4dFNpemU7ICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIERldGFpbHNMZW5ndGg7ICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWRfMDEwMF9DaGVja3N1bTsgICAgIC8qIDA0aCAqLyAvKiBvYnNvbGV0ZSBDaGVja3N1bSAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEltYWdlT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJbWFnZVNpemU7ICAgICAgICAgICAgICAgICAgLyogMENoICovCit9IEZXX0RPV05MT0FEX1RDU0dFLCBNUElfUE9JTlRFUiBQVFJfRldfRE9XTkxPQURfVENTR0UsCisgIEZXRG93bmxvYWRUQ1NHRV90LCBNUElfUE9JTlRFUiBwRldEb3dubG9hZFRDU0dFX3Q7CisKKy8qIEZpcm13YXJlIERvd25sb2FkIHJlcGx5ICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZXX0RPV05MT0FEX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSW1hZ2VUeXBlOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMVszXTsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfRldfRE9XTkxPQURfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfRldfRE9XTkxPQURfUkVQTFksCisgIEZXRG93bmxvYWRSZXBseV90LCBNUElfUE9JTlRFUiBwRldEb3dubG9hZFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgRmlybXdhcmUgVXBsb2FkIG1lc3NhZ2UgYW5kIGFzc29jaWF0ZWQgc3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZXX1VQTE9BRAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEltYWdlVHlwZTsgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbM107ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBTR0VfTVBJX1VOSU9OICAgICAgICAgICBTR0w7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMENoICovCit9IE1TR19GV19VUExPQUQsIE1QSV9QT0lOVEVSIFBUUl9NU0dfRldfVVBMT0FELAorICBGV1VwbG9hZF90LCBNUElfUE9JTlRFUiBwRldVcGxvYWRfdDsKKworI2RlZmluZSBNUElfRldfVVBMT0FEX0lUWVBFX0ZXX0lPQ19NRU0gICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX0ZXX1VQTE9BRF9JVFlQRV9GV19GTEFTSCAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9GV19VUExPQURfSVRZUEVfQklPU19GTEFTSCAgICAgICgweDAyKQorI2RlZmluZSBNUElfRldfVVBMT0FEX0lUWVBFX05WREFUQSAgICAgICAgICAoMHgwMykKKyNkZWZpbmUgTVBJX0ZXX1VQTE9BRF9JVFlQRV9CT09UTE9BREVSICAgICAgKDB4MDQpCisKK3R5cGVkZWYgc3RydWN0IF9GV1VwbG9hZFRDU0dFCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENvbnRleHRTaXplOyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBEZXRhaWxzTGVuZ3RoOyAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJbWFnZU9mZnNldDsgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSW1hZ2VTaXplOyAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworfSBGV19VUExPQURfVENTR0UsIE1QSV9QT0lOVEVSIFBUUl9GV19VUExPQURfVENTR0UsCisgIEZXVXBsb2FkVENTR0VfdCwgTVBJX1BPSU5URVIgcEZXVXBsb2FkVENTR0VfdDsKKworLyogRmlybXdhcmUgVXBsb2FkIHJlcGx5ICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0ZXX1VQTE9BRF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEltYWdlVHlwZTsgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDFbM107ICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBBY3R1YWxJbWFnZVNpemU7ICAgICAgICAgICAgLyogMTRoICovCit9IE1TR19GV19VUExPQURfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfRldfVVBMT0FEX1JFUExZLAorICBGV1VwbG9hZFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBGV1VwbG9hZFJlcGx5X3Q7CisKKwordHlwZWRlZiBzdHJ1Y3QgX01QSV9GV19IRUFERVIKK3sKKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBBcm1CcmFuY2hJbnN0cnVjdGlvbjA7ICAgICAgLyogMDBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgU2lnbmF0dXJlMDsgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNpZ25hdHVyZTE7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBTaWduYXR1cmUyOyAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQXJtQnJhbmNoSW5zdHJ1Y3Rpb24xOyAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEFybUJyYW5jaEluc3RydWN0aW9uMjsgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ2hlY2tzdW07ICAgICAgICAgICAgICAgICAgIC8qIDFDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFZlbmRvcklkOyAgICAgICAgICAgICAgICAgICAvKiAyMGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBQcm9kdWN0SWQ7ICAgICAgICAgICAgICAgICAgLyogMjJoICovCisgICAgTVBJX0ZXX1ZFUlNJT04gICAgICAgICAgRldWZXJzaW9uOyAgICAgICAgICAgICAgICAgIC8qIDI0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNlcUNvZGVWZXJzaW9uOyAgICAgICAgICAgICAvKiAyOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJbWFnZVNpemU7ICAgICAgICAgICAgICAgICAgLyogMkNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTmV4dEltYWdlSGVhZGVyT2Zmc2V0OyAgICAgIC8qIDMwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIExvYWRTdGFydEFkZHJlc3M7ICAgICAgICAgICAvKiAzNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJb3BSZXNldFZlY3RvclZhbHVlOyAgICAgICAgLyogMzhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSW9wUmVzZXRSZWdBZGRyOyAgICAgICAgICAgIC8qIDNDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFZlcnNpb25OYW1lV2hhdDsgICAgICAgICAgICAvKiA0MGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWZXJzaW9uTmFtZVszMl07ICAgICAgICAgICAgLyogNDRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVmVuZG9yTmFtZVdoYXQ7ICAgICAgICAgICAgIC8qIDY0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZlbmRvck5hbWVbMzJdOyAgICAgICAgICAgICAvKiA2OGggKi8KK30gTVBJX0ZXX0hFQURFUiwgTVBJX1BPSU5URVIgUFRSX01QSV9GV19IRUFERVIsCisgIE1waUZ3SGVhZGVyX3QsIE1QSV9QT0lOVEVSIHBNcGlGd0hlYWRlcl90OworCisjZGVmaW5lIE1QSV9GV19IRUFERVJfV0hBVF9TSUdOQVRVUkUgICAgICAgICgweDI5MjMyODQwKQorCisvKiBkZWZp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FlfMTAyMFRBMF9TQ1NJICAgKDB4MDAwQykKKy8qIEZpYnJlIENoYW5uZWwgKi8KKyNkZWZpbmUgTVBJX0ZXX0hFQURFUl9QSURfRkFNSUxZXzkwOV9GQyAgICAgICAgICgweDAwMDApCisjZGVmaW5lIE1QSV9GV19IRUFERVJfUElEX0ZBTUlMWV85MTlfRkMgICAgICAgICAoMHgwMDAxKQorI2RlZmluZSBNUElfRldfSEVBREVSX1BJRF9GQU1JTFlfOTE5WF9GQyAgICAgICAgKDB4MDAwMikKKyNkZWZpbmUgTVBJX0ZXX0hFQURFUl9QSURfRkFNSUxZXzkxOVhMX0ZDICAgICAgICgweDAwMDMpCisjZGVmaW5lIE1QSV9GV19IRUFERVJfUElEX0ZBTUlMWV85NDlfRkMgICAgICAgICAoMHgwMDA0KQorI2RlZmluZSBNUElfRldfSEVBREVSX1BJRF9GQU1JTFlfOTU5X0ZDICAgICAgICAgKDB4MDAwNSkKKy8qIFNBUyAqLworI2RlZmluZSBNUElfRldfSEVBREVSX1BJRF9GQU1JTFlfMTA2NF9TQVMgICAgICAgKDB4MDAwMSkKKwordHlwZWRlZiBzdHJ1Y3QgX01QSV9FWFRfSU1BR0VfSEVBREVSCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgSW1hZ2VUeXBlOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ2hlY2tzdW07ICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEltYWdlU2l6ZTsgICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgIC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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIExBTlNlbmQgbWVzc2FnZXMgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19MQU5fU0VORF9SRVFVRVNUCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQb3J0TnVtYmVyOyAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBTR0VfTVBJX1VOSU9OICAgICAgICAgICBTR19MaXN0WzFdOyAgICAgICAgIC8qIDBDaCAqLworfSBNU0dfTEFOX1NFTkRfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19MQU5fU0VORF9SRVFVRVNULAorICBMQU5TZW5kUmVxdWVzdF90LCBNUElfUE9JTlRFUiBwTEFOU2VuZFJlcXVlc3RfdDsKKworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xBTl9TRU5EX1JFUExZCit7CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBOdW1iZXJPZkNvbnRleHRzOyAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlckNvbnRleHQ7ICAgICAgLyogMTRoICovCit9IE1TR19MQU5fU0VORF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19MQU5fU0VORF9SRVBMWSwKKyAgTEFOU2VuZFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBMQU5TZW5kUmVwbHlfdDsKKworCisvKiBMQU5SZWNlaXZlUG9zdCAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xBTl9SRUNFSVZFX1BPU1RfUkVRVUVTVAoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUG9ydE51bWJlcjsgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQnVja2V0Q291bnQ7ICAgICAgICAvKiAwQ2ggKi8KKyAgICBTR0VfTVBJX1VOSU9OICAgICAgICAgICBTR19MaXN0WzFdOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfTEFOX1JFQ0VJVkVfUE9TVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0xBTl9SRUNFSVZFX1BPU1RfUkVRVUVTVCwKKyAgTEFOUmVjZWl2ZVBvc3RSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBMQU5SZWNlaXZlUG9zdFJlcXVlc3RfdDsKKworCit0eXBlZGVmIHN0cnVjdCBfTVNHX0xBTl9SRUNFSVZFX1BPU1RfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE51bWJlck9mQ29udGV4dHM7ICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUG9ydE51bWJlcjsgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQnVja2V0c1JlbWFpbmluZzsgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBQYWNrZXRPZmZzZXQ7ICAgICAgIC8qIDE4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFBhY2tldExlbmd0aDsgICAgICAgLyogMUNoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQnVja2V0Q29udGV4dFsxXTsgICAvKiAyMGggKi8KK30gTVNHX0xBTl9SRUNFSVZFX1BPU1RfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfTEFOX1JFQ0VJVkVfUE9TVF9SRVBMWSwKKyAgTEFOUmVjZWl2ZVBvc3RSZXBseV90LCBNUElfUE9JTlRFUiBwTEFOUmVjZWl2ZVBvc3RSZXBseV90OworCisKKy8qIExBTlJlc2V0ICovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfTEFOX1JFU0VUX1JFUVVFU1QKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworfSBNU0dfTEFOX1JFU0VUX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfTEFOX1JFU0VUX1JFUVVFU1QsCisgIExBTlJlc2V0UmVxdWVzdF90LCBNUElfUE9JTlRFUiBwTEFOUmVzZXRSZXF1ZXN0X3Q7CisKKwordHlwZWRlZiBzdHJ1Y3QgX01TR19MQU5fUkVTRVRfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBvcnROdW1iZXI7ICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfTEFOX1JFU0VUX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0xBTl9SRVNFVF9SRVBMWSwKKyAgTEFOUmVzZXRSZXBseV90LCBNUElfUE9JTlRFUiBwTEFOUmVzZXRSZXBseV90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTEFOIENvbnRleHQgUmVwbHkgZGVmaW5lcyBhbmQgbWFjcm9zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2RlZmluZSBMQU5fUkVQTFlfUEFDS0VUX0xFTkdUSF9NQVNLICAgICAgICAgICAgKDB4MDAwMEZGRkYpCisjZGVmaW5lIExBTl9SRVBMWV9QQUNLRVRfTEVOR1RIX1NISUZUICAgICAgICAgICAoMCkKKyNkZWZpbmUgTEFOX1JFUExZX0JVQ0tFVF9DT05URVhUX01BU0sgICAgICAgICAgICgweDA3RkYwMDAwKQorI2RlZmluZSBMQU5fUkVQTFlfQlVDS0VUX0NPTlRFWFRfU0hJRlQgICAgICAgICAgKDE2KQorI2RlZmluZSBMQU5fUkVQTFlfQlVGRkVSX0NPTlRFWFRfTUFTSyAgICAgICAgICAgKDB4MDdGRkZGRkYpCisjZGVmaW5lIExBTl9SRVBMWV9CVUZGRVJfQ09OVEVYVF9TSElGVCAgICAgICAgICAoMCkKKyNkZWZpbmUgTEFOX1JFUExZX0ZPUk1fTUFTSyAgICAgICAgICAgICAgICAgICAgICgweDE4MDAwMDAwKQorI2RlZmluZSBMQU5fUkVQTFlfRk9STV9SRUNFSVZFX1NJTkdMRSAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIExBTl9SRVBMWV9GT1JNX1JFQ0VJVkVfTVVMVElQTEUgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTEFOX1JFUExZX0ZPUk1fU0VORF9TSU5HTEUgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBMQU5fUkVQTFlfRk9STV9NRVNTQUdFX0NPTlRFWFQgICAgICAgICAgKDB4MDMpCisjZGVmaW5lIExBTl9SRVBMWV9GT1JNX1NISUZUICAgICAgICAgICAgICAgICAgICAoMjcpCisKKyNkZWZpbmUgR0VUX0xBTl9QQUNLRVRfTEVOR1RIKHgpICAgICgoKHgpICYgTEFOX1JFUExZX1BBQ0tFVF9MRU5HVEhfTUFTSykgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4gTEFOX1JFUExZX1BBQ0tFVF9MRU5HVEhfU0hJRlQpCisKKyNkZWZpbmUgU0VUX0xBTl9QQUNLRVRfTEVOR1RIKHgsIGx0aCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAoKHgpID0gKCh4KSAmIH5MQU5fUkVQTFlfUEFDS0VUX0xFTkdUSF9NQVNLKSB8ICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGx0aCkgPDwgTEFOX1JFUExZX1BBQ0tFVF9MRU5HVEhfU0hJRlQpICYgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMQU5fUkVQTFlfUEFDS0VUX0xFTkdUSF9NQVNLKSkKKworI2RlZmluZSBHRVRfTEFOX0JVQ0tFVF9DT05URVhUKHgpICAgKCgoeCkgJiBMQU5fUkVQTFlfQlVDS0VUX0NPTlRFWFRfTUFTSykgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PiBMQU5fUkVQTFlfQlVDS0VUX0NPTlRFWFRfU0hJRlQpCisKKyNkZWZpbmUgU0VUX0xBTl9CVUNLRVRfQ09OVEVYVCh4LCBjdHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAoKHgpID0gKCh4KSAmIH5MQU5fUkVQTFlfQlVDS0VUX0NPTlRFWFRfTUFTSykgfCAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGN0eCkgPDwgTEFOX1JFUExZX0JVQ0tFVF9DT05URVhUX1NISUZUKSAmICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMQU5fUkVQTFlfQlVDS0VUX0NPTlRFWFRfTUFTSykpCisKKyNkZWZpbmUgR0VUX0xBTl9CVUZGRVJfQ09OVEVYVCh4KSAgICgoKHgpICYgTEFOX1JFUExZX0JVRkZFUl9DT05URVhUX01BU0spICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4gTEFOX1JFUExZX0JVRkZFUl9DT05URVhUX1NISUZUKQorCisjZGVmaW5lIFNFVF9MQU5fQlVGRkVSX0NPTlRFWFQoeCwgY3R4KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgKCh4KSA9ICgoeCkgJiB+TEFOX1JFUExZX0JVRkZFUl9DT05URVhUX01BU0spIHwgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChjdHgpIDw8IExBTl9SRVBMWV9CVUZGRVJfQ09OVEVYVF9TSElGVCkgJiAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTEFOX1JFUExZX0JVRkZFUl9DT05URVhUX01BU0spKQorCisjZGVmaW5lIEdFVF9MQU5fRk9STSh4KSAgICAgICAgICAgICAoKCh4KSAmIExBTl9SRVBMWV9GT1JNX01BU0spICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4+IExBTl9SRVBMWV9GT1JNX1NISUZUKQorCisjZGVmaW5lIFNFVF9MQU5fRk9STSh4LCBmcm0pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgKCh4KSA9ICgoeCkgJiB+TEFOX1JFUExZX0ZPUk1fTUFTSykgfCAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChmcm0pIDw8IExBTl9SRVBMWV9GT1JNX1NISUZUKSAmICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTEFOX1JFUExZX0ZPUk1fTUFTSykpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBMQU4gQ3VycmVudCBEZXZpY2UgU3RhdGUgZGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIE1QSV9MQU5fREVWSUNFX1NUQVRFX1JFU0VUICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9MQU5fREVWSUNFX1NUQVRFX09QRVJBVElPTkFMICAgICAgICAgICAgICAgKDB4MDEpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBMQU4gTG9vcGJhY2sgZGVmaW5lc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Z0NvbnRleHQgZmllbGQgdG8gTVNHX01BSUxCT1hfUkVRVUVTVC4KKyAqICAwNC0wMS0wMyAgMDEuMDIuMDkgIE5ldyBhY3Rpb24gZGF0YSBvcHRpb24gZmxhZyBmb3IKKyAqICAgICAgICAgICAgICAgICAgICAgIE1QSV9SQUlEX0FDVElPTl9ERUxFVEVfVk9MVU1FLgorICogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKi8KKworI2lmbmRlZiBNUElfUkFJRF9ICisjZGVmaW5lIE1QSV9SQUlEX0gKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICBSIEEgSSBEICAgIE0gZSBzIHMgYSBnIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFJBSUQgQWN0aW9uIFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfUkFJRF9BQ1RJT04KK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBY3Rpb247ICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZUlEOyAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lQnVzOyAgICAgICAgICAvKiAwNWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza051bTsgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEFjdGlvbkRhdGFXb3JkOyAgICAgLyogMTBoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgQWN0aW9uRGF0YVNHRTsgICAgICAvKiAxNGggKi8KK30gTVNHX1JBSURfQUNUSU9OX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfUkFJRF9BQ1RJT05fUkVRVUVTVCwKKyAgTXBpUmFpZEFjdGlvblJlcXVlc3RfdCAsIE1QSV9QT0lOVEVSIHBNcGlSYWlkQWN0aW9uUmVxdWVzdF90OworCisKKy8qIFJBSUQgQWN0aW9uIHJlcXVlc3QgQWN0aW9uIHZhbHVlcyAqLworCisjZGVmaW5lIE1QSV9SQUlEX0FDVElPTl9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9SQUlEX0FDVElPTl9JTkRJQ0FUT1JfU1RSVUNUICAgICAgICAgICAgKDB4MDEpCisjZGVmaW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KQorCisKKy8qIFJBSUQgQWN0aW9uIHJlcGx5IG1lc3NhZ2UgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19SQUlEX0FDVElPTl9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFjdGlvbjsgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lSUQ7ICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVCdXM7ICAgICAgICAgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBoeXNEaXNrTnVtOyAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIEFjdGlvblN0YXR1czsgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFZvbHVtZVN0YXR1czsgICAgICAgLyogMTRoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQWN0aW9uRGF0YTsgICAgICAgICAvKiAxOGggKi8KK30gTVNHX1JBSURfQUNUSU9OX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX1JBSURfQUNUSU9OX1JFUExZLAorICBNcGlSYWlkQWN0aW9uUmVwbHlfdCwgTVBJX1BPSU5URVIgcE1waVJhaWRBY3Rpb25SZXBseV90OworCisKKy8qIFJBSUQgVm9sdW1lIHJlcGx5IEFjdGlvblN0YXR1cyB2YWx1ZXMgKi8KKworI2RlZmluZSBNUElfUkFJRF9BQ1RJT05fQVNUQVRVU19TVUNDRVNTICAgICAgICAgICAgICgweDAwMDApCisjZGVmaW5lIE1QSV9SQUlEX0FDVElPTl9BU1RBVFVTX0lOVkFMSURfQUNUSU9OICAgICAgKDB4MDAwMSkKKyNkZWZpbmUgTVBJX1JBSURfQUNUSU9OX0FTVEFUVVNfRkFJTFVSRSAgICAgICAgICAgICAoMHgwMDAyKQorI2RlZmluZSBNUElfUkFJRF9BQ1RJT05fQVNUQVRVU19JTl9QUk9HUkVTUyAgICAgICAgICgweDAwMDMpCisKKworLyogUkFJRCBWb2x1bWUgcmVwbHkgUkFJRCBWb2x1bWUgSW5kaWNhdG9yIHN0cnVjdHVyZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVBJX1JBSURfVk9MX0lORElDQVRPUgoreworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFRvdGFsQmxvY2tzOyAgICAgICAgLyogMDBoICovCisgICAgVTY0ICAgICAgICAgICAgICAgICAgICAgQmxvY2tzUmVtYWluaW5nOyAgICAvKiAwOGggKi8KK30gTVBJX1JBSURfVk9MX0lORElDQVRPUiwgTVBJX1BPSU5URVIgUFRSX01QSV9SQUlEX1ZPTF9JTkRJQ0FUT1IsCisgIE1waVJhaWRWb2xJbmRpY2F0b3JfdCwgTVBJX1BPSU5URVIgcE1waVJhaWRWb2xJbmRpY2F0b3JfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFNDU0kgSU8gUkFJRCBQYXNzdGhyb3VnaCBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfU0NTSV9JT19SQUlEX1BUX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQaHlzRGlza051bTsgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENEQkxlbmd0aDsgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU2Vuc2VCdWZmZXJMZW5ndGg7ICAvKiAwNWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBMVU5bOF07ICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIENvbnRyb2w7ICAgICAgICAgICAgLyogMTRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ0RCWzE2XTsgICAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBEYXRhTGVuZ3RoOyAgICAgICAgIC8qIDI4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFNlbnNlQnVmZmVyTG93QWRkcjsgLyogMkNoICovCisgICAgU0dFX0lPX1VOSU9OICAgICAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiAzMGggKi8KK30gTVNHX1NDU0lfSU9fUkFJRF9QVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX1NDU0lfSU9fUkFJRF9QVF9SRVFVRVNULAorICBTQ1NJSU9SYWlkUGFzc3Rocm91Z2hSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBTQ1NJSU9SYWlkUGFzc3Rocm91Z2hSZXF1ZXN0X3Q7CisKKworLyogU0NTSSBJTyBSQUlEIFBhc3N0aHJvdWdoIHJlcGx5IHN0cnVjdHVyZSAqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1NDU0lfSU9fUkFJRF9QVF9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBoeXNEaXNrTnVtOyAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ0RCTGVuZ3RoOyAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTZW5zZUJ1ZmZlckxlbmd0aDsgIC8qIDA1aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFNDU0lTdGF0dXM7ICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU0NTSVN0YXRlOyAgICAgICAgICAvKiAwRGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgVHJhbnNmZXJDb3VudDsgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBTZW5zZUNvdW50OyAgICAgICAgIC8qIDE4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlSW5mbzsgICAgICAgLyogMUNoICovCit9IE1TR19TQ1NJX0lPX1JBSURfUFRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfU0NTSV9JT19SQUlEX1BUX1JFUExZLAorICBTQ1NJSU9SYWlkUGFzc3Rocm91Z2hSZXBseV90LCBNUElfUE9JTlRFUiBwU0NTSUlPUmFpZFBhc3N0aHJvdWdoUmVwbHlfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIE1haWxib3ggcmVxZXVzdCBzdHJ1Y3R1cmUgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX01BSUxCT1hfUkVRVUVTVAoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQ29tbWFuZFsxMF07CisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OworICAgIFNHRV9JT19VTklPTiAgICAgICAgICAgIFNHTDsKK30gTVNHX01BSUxCT1hfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19NQUlMQk9YX1JFUVVFU1QsCisgIE1haWxib3hSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBNYWlsYm94UmVxdWVzdF90OworCisKKy8qIE1haWxib3ggcmVwbHkgc3RydWN0dXJlICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX01BSUxCT1hfUkVQTFkKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIE1haWxib3hTdGF0dXM7ICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMTRoICovCit9IE1TR19NQUlMQk9YX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX01BSUxCT1hfUkVQTFksCisgIE1haWxib3hSZXBseV90LCBNUElfUE9JTlRFUiBwTWFpbGJveFJlcGx5X3Q7CisKKyNlbmRpZgorCisKKwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX3Nhcy5oIGIvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX3Nhcy5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmNiODc4ZjkKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL21lc3NhZ2UvZnVzaW9uL2xzaS9tcGlfc2FzLmgKQEAgLTAsMCArMSwxODEgQEAKKy8qCisgKiAgQ29weXJpZ2h0IChjKSAyMDAzIExTSSBMb2dpYyBDb3Jwb3JhdGlvbi4KKyAqCisgKgorICogICAgICAgICAgIE5hbWU6ICBtcGlfc2FzLmgKKyAqICAgICAgICAgIFRpdGxlOiAgTVBJIFNlcmlhbCBBdHRhY2hlZCBTQ1NJIHN0cnVjdHVyZXMgYW5kIGRlZmluaXRpb25zCisgKiAgQ3JlYXRpb24gRGF0ZTogIEFwcmlsIDIzLCAyMDAzCisgKgorICogICAgbXBpX3Nhcy5oIFZlcnNpb246ICAwMS4wNS54eAorICoKKyAqICBWZXJzaW9uIEhpc3RvcnkKKyAqICAtLS0tLS0tLS0tLS0tLS0KKyAqCisgKiAgRGF0ZSAgICAgIFZlcnNpb24gICBEZXNjcmlwdGlvbgorICogIC0tLS0tLS0tICAtLS0tLS0tLSAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgeHgteXktenogIDAxLjA1LjAxICBPcmlnaW5hbCByZWxlYXNlLgorICogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKi8KKworI2lmbmRlZiBNUElfU0FTX0gKKyNkZWZpbmUgTVBJX1NBU19ICisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgUyBlIHIgaSBhIGwgICAgQSB0IHQgYSBjIGggZSBkICAgIFMgQyBTIEkgICAgIE0gZSBzIHMgYSBnIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogU2VyaWFsIE1hbmFnZW1lbnQgUHJvdG9jb2wgUGFzc3Rocm91Z2ggUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19TTVBfUEFTU1RIUk9VR0hfUkVRVUVTVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBhc3N0aHJvdWdoRmxhZ3M7ICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUGh5c2ljYWxQb3J0OyAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVxdWVzdERhdGFMZW5ndGg7ICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDb25uZWN0aW9uUmF0ZTsgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDBDaCAqLworICAgIFU2NCAgICAgICAgICAgICAgICAgICAgIFNBU0FkZHJlc3M7ICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAxOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDFDaCAqLworICAgIFNHRV9TSU1QTEVfVU5JT04gICAgICAgIFNHTDsgICAgICAgICAgICAgICAgLyogMjBoICovCit9IE1TR19TTVBfUEFTU1RIUk9VR0hfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19TTVBfUEFTU1RIUk9VR0hfUkVRVUVTVCwKKyAgU21wUGFzc3Rocm91Z2hSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBTbXBQYXNzdGhyb3VnaFJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfU01QX1BUX1JFUV9QVF9GTEFHU19JTU1FRElBVEUgICAgICAgKDB4ODApCisKKyNkZWZpbmUgTVBJX1NNUF9QVF9SRVFfQ09OTkVDVF9SQVRFX05FR09USUFURUQgICgweDAwKQorI2RlZmluZSBNUElfU01QX1BUX1JFUV9DT05ORUNUX1JBVEVfMV81ICAgICAgICAgKDB4MDgpCisjZGVmaW5lIE1QSV9TTVBfUFRfUkVRX0NPTk5FQ1RfUkFURV8zXzAgICAgICAgICAoMHgwOSkKKworCisvKiBTZXJpYWwgTWFuYWdlbWVudCBQcm90b2NvbCBQYXNzdGhyb3VnaCBSZXBseSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19TTVBfUEFTU1RIUk9VR0hfUkVQTFkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQYXNzdGhyb3VnaEZsYWdzOyAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFBoeXNpY2FsUG9ydDsgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlRGF0YUxlbmd0aDsgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTQVNTdGF0dXM7ICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDE0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlRGF0YVs0XTsgICAgLyogMThoICovCit9IE1TR19TTVBfUEFTU1RIUk9VR0hfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfU01QX1BBU1NUSFJPVUdIX1JFUExZLAorICBTbXBQYXNzdGhyb3VnaFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBTbXBQYXNzdGhyb3VnaFJlcGx5X3Q7CisKKyNkZWZpbmUgTVBJX1NNUF9QVF9SRVBMWV9QVF9GTEFHU19JTU1FRElBVEUgICAgICgweDgwKQorCisvKiB2YWx1ZXMgZm9yIHRoZSBTQVNTdGF0dXMgZmllbGQgKi8KKyNkZWZpbmUgTVBJX1NBU1NUQVRVU19TVUNDRVNTICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9TQVNTVEFUVVNfVU5LTk9XTl9FUlJPUiAgICAgICAgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfU0FTU1RBVFVTX0lOVkFMSURfRlJBTUUgICAgICAgICAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX1NBU1NUQVRVU19VVENfQkFEX0RFU1QgICAgICAgICAgICAgICAgICAgICAgKDB4MDMpCisjZGVmaW5lIE1QSV9TQVNTVEFU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kZPX1NTUF9JTklUSUFUT1IgICAgICAgKDB4MDAwMDAwNDApCisjZGVmaW5lIE1QSV9TQVNfREVWSUNFX0lORk9fU1RQX0lOSVRJQVRPUiAgICAgICAoMHgwMDAwMDAyMCkKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfSU5GT19TTVBfSU5JVElBVE9SICAgICAgICgweDAwMDAwMDEwKQorI2RlZmluZSBNUElfU0FTX0RFVklDRV9JTkZPX1NBVEFfSE9TVCAgICAgICAgICAgKDB4MDAwMDAwMDgpCisKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfSU5GT19NQVNLX0RFVklDRV9UWVBFICAgICgweDAwMDAwMDA3KQorI2RlZmluZSBNUElfU0FTX0RFVklDRV9JTkZPX05PX0RFVklDRSAgICAgICAgICAgKDB4MDAwMDAwMDApCisjZGVmaW5lIE1QSV9TQVNfREVWSUNFX0lORk9fRU5EX0RFVklDRSAgICAgICAgICAoMHgwMDAwMDAwMSkKKyNkZWZpbmUgTVBJX1NBU19ERVZJQ0VfSU5GT19FREdFX0VYUEFOREVSICAgICAgICgweDAwMDAwMDAyKQorI2RlZmluZSBNUElfU0FTX0RFVklDRV9JTkZPX0ZBTk9VVF9FWFBBTkRFUiAgICAgKDB4MDAwMDAwMDMpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBTQVMgSU8gVW5pdCBDb250cm9sIFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1NBU19JT1VOSVRfQ09OVFJPTF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgT3BlcmF0aW9uOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFRhcmdldElEOyAgICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVzOyAgICAgICAgICAgICAgICAvKiAwRGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQaHlOdW07ICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMEZoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ1OyAgICAgICAgICAvKiAxMGggKi8KKyAgICBVNjQgICAgICAgICAgICAgICAgICAgICBTQVNBZGRyZXNzOyAgICAgICAgIC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNjsgICAgICAgICAgLyogMUNoICovCit9IE1TR19TQVNfSU9VTklUX0NPTlRST0xfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19TQVNfSU9VTklUX0NPTlRST0xfUkVRVUVTVCwKKyAgU2FzSW9Vbml0Q29udHJvbFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcFNhc0lvVW5pdENvbnRyb2xSZXF1ZXN0X3Q7CisKKy8qIHZhbHVlcyBmb3IgdGhlIC4uLiBmaWVsZCAqLworI2RlZmluZSBNUElfU0FTX09QX0NMRUFSX05PVF9QUkVTRU5UICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfU0FTX09QX0NMRUFSX0FMTCAgICAgICAgICAgICAgICAgICAgICgweDAyKQorI2RlZmluZSBNUElfU0FTX09QX01BUCAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAzKQorI2RlZmluZSBNUElfU0FTX09QX01PVkUgICAgICAgICAgICAgICAgICAgICAgICAgICgweDA0KQorI2RlZmluZSBNUElfU0FTX09QX0NMRUFSICAgICAgICAgICAgICAgICAgICAgICAgICgweDA1KQorI2RlZmluZSBNUElfU0FTX09QX1BIWV9MSU5LX1JFU0VUICAgICAgICAgICAgICAgICgweDA2KQorI2RlZmluZSBNUElfU0FTX09QX1BIWV9IQVJEX1JFU0VUICAgICAgICAgICAgICAgICgweDA3KQorI2RlZmluZSBNUElfU0FTX09QX1BIWV9DTEVBUl9FUlJPUl9MT0cgICAgICAgICAgICgweDA4KQorCisKKy8qIFNBUyBJTyBVbml0IENvbnRyb2wgUmVwbHkgKi8KK3R5cGVkZWYgc3RydWN0IF9NU0dfU0FTX0lPVU5JVF9DT05UUk9MX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgT3BlcmF0aW9uOyAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfU0FTX0lPVU5JVF9DT05UUk9MX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX1NBU19JT1VOSVRfQ09OVFJPTF9SRVBMWSwKKyAgU2FzSW9Vbml0Q29udHJvbFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBTYXNJb1VuaXRDb250cm9sUmVwbHlfdDsKKworI2VuZGlmCisKKwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX3RhcmcuaCBiL2RyaXZlcnMvbWVzc2FnZS9mdXNpb24vbHNpL21waV90YXJnLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODA0ZGM4NQotLS0gL2Rldi9udWxsCisrKyBiL2RyaXZlcnMvbWVzc2FnZS9mdXNpb24vbHNpL21waV90YXJnLmgKQEAgLTAsMCArMSw0MzUgQEAKKy8qCisgKiAgQ29weXJpZ2h0IChjKSAyMDAwLTIwMDMgTFNJIExvZ2ljIENvcnBvcmF0aW9uLgorICoKKyAqCisgKiAgICAgICA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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKgorKiAgICAgICAgUyBDIFMgSSAgICBUIGEgciBnIGUgdCAgICBNIGUgcyBzIGEgZyBlIHMKKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9DTURfQlVGRkVSX0RFU0NSSVBUT1IKK3sKKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJb0luZGV4OyAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIHVuaW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICB7CisgICAgICAgIFUzMiAgICAgICAgICAgICAgICAgUGh5c2ljYWxBZGRyZXNzMzI7CisgICAgICAgIFU2NCAgICAgICAgICAgICAgICAgUGh5c2ljYWxBZGRyZXNzNjQ7CisgICAgfSB1OworfSBDTURfQlVGRkVSX0RFU0NSSVBUT1IsIE1QSV9QT0lOVEVSIFBUUl9DTURfQlVGRkVSX0RFU0NSSVBUT1IsCisgIENtZEJ1ZmZlckRlc2NyaXB0b3JfdCwgTVBJX1BPSU5URVIgcENtZEJ1ZmZlckRlc2NyaXB0b3JfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFRhcmdldCBDb21tYW5kIEJ1ZmZlciBQb3N0IFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfVEFSR0VUX0NNRF9CVUZGRVJfUE9TVF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVmZmVyUG9zdEZsYWdzOyAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlckNvdW50OyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlckxlbmd0aDsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgQ01EX0JVRkZFUl9ERVNDUklQVE9SICAgQnVmZmVyWzFdOyAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworfSBNU0dfVEFSR0VUX0NNRF9CVUZGRVJfUE9TVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX1RBUkdFVF9DTURfQlVGRkVSX1BPU1RfUkVRVUVTVCwKKyAgVGFyZ2V0Q21kQnVmZmVyUG9zdFJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcFRhcmdldENtZEJ1ZmZlclBvc3RSZXF1ZXN0X3Q7CisKKyNkZWZpbmUgQ01EX0JVRkZFUl9QT1NUX0ZMQUdTX1BPUlRfTUFTSyAgICAgICAgICgweDAxKQorI2RlZmluZSBDTURfQlVGRkVSX1BPU1RfRkxBR1NfQUREUl9NT0RFX01BU0sgICAgKDB4ODApCisjZGVmaW5lIENNRF9CVUZGRVJfUE9TVF9GTEFHU19BRERSX01PREVfMzIgICAgICAoMCkKKyNkZWZpbmUgQ01EX0JVRkZFUl9QT1NUX0ZMQUdTX0FERFJfTU9ERV82NCAgICAgICgxKQorI2RlZmluZSBDTURfQlVGRkVSX1BPU1RfRkxBR1NfNjRfQklUX0FERFIgICAgICAgKDB4ODApCisKKyNkZWZpbmUgQ01EX0JVRkZFUl9QT1NUX0lPX0lOREVYX01BU0sgICAgICAgICAgICgweDAwMDAzRkZGKQorI2RlZmluZSBDTURfQlVGRkVSX1BPU1RfSU9fSU5ERVhfTUFTS18wMTAwICAgICAgKDB4MDAwMDAzRkYpIC8qIG9ic29sZXRlICovCisKKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UQVJHRVRfQ01EX0JVRkZFUl9QT1NUX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVmZmVyUG9zdEZsYWdzOyAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlckNvdW50OyAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlckxlbmd0aDsgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDsgICAgICAgICAgICAgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCit9IE1TR19UQVJHRVRfQ01EX0JVRkZFUl9QT1NUX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX1RBUkdFVF9DTURfQlVGRkVSX1BPU1RfUkVQTFksCisgIFRhcmdldENtZEJ1ZmZlclBvc3RSZXBseV90LCBNUElfUE9JTlRFUiBwVGFyZ2V0Q21kQnVmZmVyUG9zdFJlcGx5X3Q7CisKKy8qIHRoZSBmb2xsb3dpbmcgc3RydWN0dXJlIGlzIG9ic29sZXRlIGFzIG9mIE1QSSB2MS4yICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX1BSSU9SSVRZX0NNRF9SRUNFSVZFRF9SRVBMWQoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQcmlvcml0eVJlYXNvbjsgICAgICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVwbHlXb3JkOyAgICAgICAgICAgICAgICAgIC8qIDE0aCAqLworfSBNU0dfUFJJT1JJVFlfQ01EX1JFQ0VJVkVEX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX1BSSU9SSVRZX0NNRF9SRUNFSVZFRF9SRVBMWSwKKyAgUHJpb3JpdHlDb21tYW5kUmVjZWl2ZWRSZXBseV90LCBNUElfUE9JTlRFUiBwUHJpb3JpdHlDb21tYW5kUmVjZWl2ZWRSZXBseV90OworCisjZGVmaW5lIFBSSU9SSVRZX1JFQVNPTl9OT19ESVNDT05ORUNUICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgUFJJT1JJVFlfUkVBU09OX1NDU0lfVEFTS19NQU5BR0VNRU5UICAgICgweDAxKQorI2RlZmluZSBQUklPUklUWV9SRUFTT05fQ01EX1BBUklUWV9FUlIgICAgICAgICAgKDB4MDIpCisjZGVmaW5lIFBSSU9SSVRZX1JFQVNPTl9NU0dfT1VUX1BBUklUWV9FUlIgICAgICAoMHgwMykKKyNkZWZpbmUgUFJJT1JJVFlfUkVBU09OX0xRX0NSQ19FUlIgICAgICAgICAgICAgICgweDA0KQorI2RlZmluZSBQUklPUklUWV9SRUFTT05fQ01EX0NSQ19FUlIgICAgICAgICAgICAgKDB4MDUpCisjZGVmaW5lIFBSSU9SSVRZX1JFQVNPTl9QUk9UT0NPTF9FUlIgICAgICAgICAgICAoMHgwNikKKyNkZWZpbmUgUFJJT1JJVFlfUkVBU09OX0RBVEFfT1VUX1BBUklUWV9FUlIgICAgICgweDA3KQorI2RlZmluZSBQUklPUklUWV9SRUFTT05fREFUQV9PVVRfQ1JDX0VSUiAgICAgICAgKDB4MDgpCisjZGVmaW5lIFBSSU9SSVRZX1JFQVNPTl9UQVJHRVRfQlVTWSAgICAgICAgICAgICAoMHgwOSkKKyNkZWZpbmUgUFJJT1JJVFlfUkVBU09OX1VOS05PV04gICAgICAgICAgICAgICAgICgweEZGKQorCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfVEFSR0VUX0NNRF9CVUZGRVJfUE9TVF9FUlJPUl9SRVBMWQoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQcmlvcml0eVJlYXNvbjsgICAgICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVwbHlXb3JkOyAgICAgICAgICAgICAgICAgIC8qIDE0aCAqLworfSBNU0dfVEFSR0VUX0NNRF9CVUZGRVJfUE9TVF9FUlJPUl9SRVBMWSwKKyAgTVBJX1BPSU5URVIgUFRSX01TR19UQVJHRVRfQ01EX0JVRkZFUl9QT1NUX0VSUk9SX1JFUExZLAorICBUYXJnZXRDbWRCdWZmZXJQb3N0RXJyb3JSZXBseV90LCBNUElfUE9JTlRFUiBwVGFyZ2V0Q21kQnVmZmVyUG9zdEVycm9yUmVwbHlfdDsKKworCit0eXBlZGVmIHN0cnVjdCBfTVBJX1RBUkdFVF9GQ1BfQ01EX0JVRkZFUgoreworICAgIFU4ICAgICAgRmNwTHVuWzhdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgIEZjcENudGxbNF07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICBGY3BDZGJbMTZdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUzMiAgICAgRmNwRGw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxQ2ggKi8KKyAgICBVOCAgICAgIEFsaWFzSW5kZXg7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMjBoICovCisgICAgVTggICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDIxaCAqLworICAgIFUxNiAgICAgT3B0aW9uYWxPeGlkOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAyMmggKi8KK30gTVBJX1RBUkdFVF9GQ1BfQ01EX0JVRkZFUiwgTVBJX1BPSU5URVIgUFRSX01QSV9UQVJHRVRfRkNQX0NNRF9CVUZGRVIsCisgIE1waVRhcmdldEZjcENtZEJ1ZmZlciwgTVBJX1BPSU5URVIgcE1waVRhcmdldEZjcENtZEJ1ZmZlcjsKKworCit0eXBlZGVmIHN0cnVjdCBfTVBJX1RBUkdFVF9TQ1NJX1NQSV9DTURfQlVGRkVSCit7CisgICAgLyogU1BJIExfUSBpbmZvcm1hdGlvbiB1bml0ICovCisgICAgVTggICAgICBMX1FUeXBlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVMTYgICAgIFRhZzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICBMb2dpY2FsVW5pdE51bWJlcls4XTsgICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgRGF0YUxlbmd0aDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICAvKiBTUEkgY29tbWFuZCBpbmZvcm1hdGlvbiB1bml0ICovCisgICAgVTggICAgICBSZXNlcnZlZEZpcnN0Qnl0ZU9mQ29tbWFuZElVOyAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFU4ICAgICAgVGFza0F0dHJpYnV0ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxMWggKi8KKyAgICBVOCAgICAgIFRhc2tNYW5hZ2VtZW50RmxhZ3M7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMTJoICovCisgICAgVTggICAgICBBZGRpdGlvbmFsQ0RCTGVuZ3RoOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDEzaCAqLworICAgIFU4ICAgICAgQ0RCWzE2XTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICAvKiBBbGlhcyBJRCAqLworICAgIFU4ICAgICAgQWxpYXNJRDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAyNGggKi8KKyAgICBVOCAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMjVoICovCisgICAgVTE2ICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDI2aCAqLworfSBNUElfVEFSR0VUX1NDU0lfU1BJX0NNRF9CVUZGRVIsCisgIE1QSV9QT0lOVEVSIFBUUl9NUElfVEFSR0VUX1NDU0lfU1BJX0NNRF9CVUZGRVIsCisgIE1waVRhcmdldFNjc2lTcGlDbWRCdWZmZXIsIE1QSV9QT0lOVEVSIHBNcGlUYXJnZXRTY3NpU3BpQ21kQnVmZmVyOworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVGFyZ2V0IEFzc2lzdCBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UQVJHRVRfQVNTSVNUX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTdGF0dXNDb2RlOyAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0QXNzaXN0RmxhZ3M7ICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUXVldWVUYWc7ICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlcGx5V29yZDsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBMVU5bOF07ICAgICAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVsYXRpdmVPZmZzZXQ7ICAgICAgICAgICAgIC8qIDE4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERhdGFMZW5ndGg7ICAgICAgICAgICAgICAgICAvKiAxQ2ggKi8KKyAgICBTR0VfSU9fVU5JT04gICAgICAgICAgICBTR0xbMV07ICAgICAgICAgICAgICAgICAgICAgLyogMjBoICovCit9IE1TR19UQVJHRVRfQVNTSVNUX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfVEFSR0VUX0FTU0lTVF9SRVFVRVNULAorICBUYXJnZXRBc3Npc3RSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBUYXJnZXRBc3Npc3RSZXF1ZXN0X3Q7CisKKyNkZWZpbmUgVEFSR0VUX0FTU0lTVF9GTEFHU19EQVRBX0RJUkVDVElPTiAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgVEFSR0VUX0FTU0lTVF9GTEFHU19BVVRPX1NUQVRVUyAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgVEFSR0VUX0FTU0lTVF9GTEFHU19ISUdIX1BSSU9SSVRZICAgICAgICAgICAoMHgwNCkKKyNkZWZpbmUgVEFSR0VUX0FTU0lTVF9GTEFHU19DT05GSVJNRUQgICAgICAgICAgICAgICAoMHgwOCkKKyNkZWZpbmUgVEFSR0VUX0FTU0lTVF9GTEFHU19SRVBPU1RfQ01EX0JVRkZFUiAgICAgICAoMHg4MCkKKworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1RBUkdFVF9FUlJPUl9SRVBMWQoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBQcmlvcml0eVJlYXNvbjsgICAgICAgICAgICAgLyogMENoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDBEaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVwbHlXb3JkOyAgICAgICAgICAgICAgICAgIC8qIDE0aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zZmVyQ291bnQ7ICAgICAgICAgICAgICAvKiAxOGggKi8KK30gTVNHX1RBUkdFVF9FUlJPUl9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19UQVJHRVRfRVJST1JfUkVQTFksCisgIFRhcmdldEVycm9yUmVwbHlfdCwgTVBJX1BPSU5URVIgcFRhcmdldEVycm9yUmVwbHlfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFRhcmdldCBTdGF0dXMgU2VuZCBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfVEFSR0VUX1NUQVRVU19TRU5EX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBTdGF0dXNDb2RlOyAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgU3RhdHVzRmxhZ3M7ICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUXVldWVUYWc7ICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlcGx5V29yZDsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBMVU5bOF07ICAgICAgICAgICAgICAgICAgICAgLyogMTBoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgU3RhdHVzRGF0YVNHRTsgICAgICAgICAgICAgIC8qIDE4aCAqLworfSBNU0dfVEFSR0VUX1NUQVRVU19TRU5EX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfVEFSR0VUX1NUQVRVU19TRU5EX1JFUVVFU1QsCisgIFRhcmdldFN0YXR1c1NlbmRSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBUYXJnZXRTdGF0dXNTZW5kUmVxdWVzdF90OworCisjZGVmaW5lIFRBUkdFVF9TVEFUVVNfU0VORF9GTEFHU19BVVRPX0dPT0RfU1RBVFVTICAgKDB4MDEpCisjZGVmaW5lIFRBUkdFVF9TVEFUVVNfU0VORF9GTEFHU19ISUdIX1BSSU9SSVRZICAgICAgKDB4MDQpCisjZGVmaW5lIFRBUkdFVF9TVEFUVVNfU0VORF9GTEFHU19DT05GSVJNRUQgICAgICAgICAgKDB4MDgpCisjZGVmaW5lIFRBUkdFVF9TVEFUVVNfU0VORF9GTEFHU19SRVBPU1RfQ01EX0JVRkZFUiAgKDB4ODApCisKKy8qCisgKiBOT1RFOiBGQ1BfUlNQIGRhdGEgaXMgYmlnLWVuZGlhbi4gV2hlbiB1c2VkIG9uIGEgbGl0dGxlLWVuZGlhbiBzeXN0ZW0sIHRoaXMKKyAqIHN0cnVjdHVyZSBwcm9wZXJseSBvcmRlcnMgdGhlIGJ5dGVzLgorICovCit0eXBlZGVmIHN0cnVjdCBfTVBJX1RBUkdFVF9GQ1BfUlNQX0JVRkZFUgoreworICAgIFU4ICAgICAgUmVzZXJ2ZWQwWzhdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgIFJlc2VydmVkMVsyXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICBGY3BGbGFnczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDBBaCAqLworICAgIFU4ICAgICAgRmNwU3RhdHVzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwQmggKi8KKyAgICBVMzIgICAgIEZjcFJlc2lkOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICBGY3BTZW5zZUxlbmd0aDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgRmNwUmVzcG9uc2VMZW5ndGg7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVOCAgICAgIEZjcFJlc3BvbnNlRGF0YVs4XTsgICAgICAgICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgVTggICAgICBGY3BTZW5zZURhdGFbMzJdOyAvKiBQYWQgdG8gNjQgYnl0ZXMgKi8gICAgIC8qIDIwaCAqLworfSBNUElfVEFSR0VUX0ZDUF9SU1BfQlVGRkVSLCBNUElfUE9JTlRFUiBQVFJfTVBJX1RBUkdFVF9GQ1BfUlNQX0JVRkZFUiwKKyAgTXBpVGFyZ2V0RmNwUnNwQnVmZmVyLCBNUElfUE9JTlRFUiBwTXBpVGFyZ2V0RmNwUnNwQnVmZmVyOworCisvKgorICogTk9URTogVGhlIFNQSSBzdGF0dXMgSVUgaXMgYmlnLWVuZGlhbi4gV2hlbiB1c2VkIG9uIGEgbGl0dGxlLWVuZGlhbiBzeXN0ZW0sCisgKiB0aGlzIHN0cnVjdHVyZSBwcm9wZXJseSBvcmRlcnMgdGhlIGJ5dGVzLgorICovCit0eXBlZGVmIHN0cnVjdCBfTVBJX1RBUkdFVF9TQ1NJX1NQSV9TVEFUVVNfSVUKK3sKKyAgICBVOCAgICAgIFJlc2VydmVkMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgVmFsaWQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgIFN0YXR1czsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTMyICAgICBTZW5zZURhdGFMaXN0TGVuZ3RoOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFUzMiAgICAgUGt0RmFpbHVyZXNMaXN0TGVuZ3RoOyAgICAgICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVOCAgICAgIFNlbnNlRGF0YVs1Ml07IC8qIFBhZCB0aGUgSVUgdG8gNjQgYnl0ZXMgKi8gLyogMENoICovCit9IE1QSV9UQVJHRVRfU0NTSV9TUElfU1RBVFVTX0lVLCBNUElfUE9JTlRFUiBQVFJfTVBJX1RBUkdFVF9TQ1NJX1NQSV9TVEFUVVNfSVUsCisgIFRhcmdldFNjc2lTcGlTdGF0dXNJVV90LCBNUElfUE9JTlRFUiBwVGFyZ2V0U2NzaVNwaVN0YXR1c0lVX3Q7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVGFyZ2V0IE1vZGUgQWJvcnQgUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UQVJHRVRfTU9ERV9BQk9SVF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWJvcnRUeXBlOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXBseVdvcmQ7ICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dFRvQWJvcnQ7ICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfVEFSR0VUX01PREVfQUJPUlQsIE1QSV9QT0lOVEVSIFBUUl9NU0dfVEFSR0VUX01PREVfQUJPUlQsCisgIFRhcmdldE1vZGVBYm9ydF90LCBNUElfUE9JTlRFUiBwVGFyZ2V0TW9kZUFib3J0X3Q7CisKKyNkZWZpbmUgVEFSR0VUX01PREVfQUJPUlRfVFlQRV9BTExfQ01EX0JVRkZFUlMgICAgICAoMHgwMCkKKyNkZWZpbmUgVEFSR0VUX01PREVfQUJPUlRfVFlQRV9BTExfSU8gICAgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgVEFSR0VUX01PREVfQUJPUlRfVFlQRV9FWEFDVF9JTyAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgVEFSR0VUX01PREVfQUJPUlRfVFlQRV9FWEFDVF9JT19SRVFVRVNUICAgICAoMHgwMykKKworLyogVGFyZ2V0IE1vZGUgQWJvcnQgUmVwbHkgKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UQVJHRVRfTU9ERV9BQk9SVF9SRVBMWQoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBBYm9ydENvdW50OyAgICAgICAgICAgICAgICAgLyogMTRoICovCit9IE1TR19UQVJHRVRfTU9ERV9BQk9SVF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19UQVJHRVRfTU9ERV9BQk9SVF9SRVBMWSwKKyAgVGFyZ2V0TW9kZUFib3J0UmVwbHlfdCwgTVBJX1BPSU5URVIgcFRhcmdldE1vZGVBYm9ydFJlcGx5X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBUYXJnZXQgTW9kZSBDb250ZXh0IFJlcGx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZX0lPX0lOREVYX01BU0sgICAgICAgICAoMHgwMDAwM0ZGRikKKyNkZWZpbmUgVEFSR0VUX01PREVfUkVQTFlfSU9fSU5ERVhfU0hJRlQgICAgICAgICgwKQorI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV9JTklUSUFUT1JfSU5ERVhfTUFTSyAgKDB4MDNGRkMwMDApCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZX0lOSVRJQVRPUl9JTkRFWF9TSElGVCAoMTQpCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZX0FMSUFTX01BU0sgICAgICAgICAgICAoMHgwNDAwMDAwMCkKKyNkZWZpbmUgVEFSR0VUX01PREVfUkVQTFlfQUxJQVNfU0hJRlQgICAgICAgICAgICgyNikKKyNkZWZpbmUgVEFSR0VUX01PREVfUkVQTFlfUE9SVF9NQVNLICAgICAgICAgICAgICgweDEwMDAwMDAwKQorI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV9QT1JUX1NISUZUICAgICAgICAgICAgKDI4KQorCisKKyNkZWZpbmUgR0VUX0lPX0lOREVYKHgpICAgICAoKCh4KSAmIFRBUkdFVF9NT0RFX1JFUExZX0lPX0lOREVYX01BU0spICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PiBUQVJHRVRfTU9ERV9SRVBMWV9JT19JTkRFWF9TSElGVCkKKworI2RlZmluZSBTRVRfSU9fSU5ERVgodCwgaSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICgodCkgPSAoKHQpICYgflRBUkdFVF9NT0RFX1JFUExZX0lPX0lOREVYX01BU0spIHwgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChpKSA8PCBUQVJHRVRfTU9ERV9SRVBMWV9JT19JTkRFWF9TSElGVCkgJiAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEFSR0VUX01PREVfUkVQTFlfSU9fSU5ERVhfTUFTSykpCisKKyNkZWZpbmUgR0VUX0lOSVRJQVRPUl9JTkRFWCh4KSAoKCh4KSAmIFRBUkdFVF9NT0RFX1JFUExZX0lOSVRJQVRPUl9JTkRFWF9NQVNLKSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4+IFRBUkdFVF9NT0RFX1JFUExZX0lOSVRJQVRPUl9JTkRFWF9TSElGVCkKKworI2RlZmluZSBTRVRfSU5JVElBVE9SX0lOREVYKHQsIGlpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgKCh0KSA9ICgodCkgJiB+VEFSR0VUX01PREVfUkVQTFlfSU5JVElBVE9SX0lOREVYX01BU0spIHwgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAoKChpaSkgPDwgVEFSR0VUX01PREVfUkVQTFlfSU5JVElBVE9SX0lOREVYX1NISUZUKSAmICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQVJHRVRfTU9ERV9SRVBMWV9JTklUSUFUT1JfSU5ERVhfTUFTSykpCisKKyNkZWZpbmUgR0VUX0FMSUFTKHgpICgoKHgpICYgVEFSR0VUX01PREVfUkVQTFlfQUxJQVNfTUFTSykgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4+IFRBUkdFVF9NT0RFX1JFUExZX0FMSUFTX1NISUZUKQorCisjZGVmaW5lIFNFVF9BTElBUyh0LCBhKSAgKCh0KSA9ICgodCkgJiB+VEFSR0VUX01PREVfUkVQTFlfQUxJQVNfTUFTSykgfCAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoYSkgPDwgVEFSR0VUX01PREVfUkVQTFlfQUxJQVNfU0hJRlQpICYgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQVJHRVRfTU9ERV9SRVBMWV9BTElBU19NQVNLKSkKKworI2RlZmluZSBHRVRfUE9SVCh4KSAoKCh4KSAmIFRBUkdFVF9NT0RFX1JFUExZX1BPUlRfTUFTSykgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4gVEFSR0VUX01PREVfUkVQTFlfUE9SVF9TSElGVCkKKworI2RlZmluZSBTRVRfUE9SVCh0LCBwKSAgKCh0KSA9ICgodCkgJiB+VEFSR0VUX01PREVfUkVQTFlfUE9SVF9NQVNLKSB8ICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKHApIDw8IFRBUkdFVF9NT0RFX1JFUExZX1BPUlRfU0hJRlQpICYgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRBUkdFVF9NT0RFX1JFUExZX1BPUlRfTUFTSykpCisKKy8qIHRoZSBmb2xsb3dpbmcgb2Jzb2xldGUgdmFsdWVzIGFyZSBmb3IgTVBJIHYxLjAgc3VwcG9ydCAqLworI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX01BU0tfSE9TVF9JTkRFWCAgICAgICAoMHgwMDAwMDNGRikKKyNkZWZpbmUgVEFSR0VUX01PREVfUkVQTFlfMDEwMF9TSElGVF9IT1NUX0lOREVYICAgICAgKDApCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19JT0NfSU5ERVggICAgICAgICgweDAwMUZGODAwKQorI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX1NISUZUX0lPQ19JTkRFWCAgICAgICAoMTEpCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfUE9SVF9NQVNLICAgICAgICAgICAgICgweDAwNDAwMDAwKQorI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX1BPUlRfU0hJRlQgICAgICAgICAgICAoMjIpCisjZGVmaW5lIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19JTklUSUFUT1JfSU5ERVggICgweDFGODAwMDAwKQorI2RlZmluZSBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX1NISUZUX0lOSVRJQVRPUl9JTkRFWCAoMjMpCisKKyNkZWZpbmUgR0VUX0hPU1RfSU5ERVhfMDEwMCh4KSAoKCh4KSAmIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19IT1NUX0lOREVYKSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4gVEFSR0VUX01PREVfUkVQTFlfMDEwMF9TSElGVF9IT1NUX0lOREVYKQorCisjZGVmaW5lIFNFVF9IT1NUX0lOREVYXzAxMDAodCwgaGkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgKCh0KSA9ICgodCkgJiB+VEFSR0VUX01PREVfUkVQTFlfMDEwMF9NQVNLX0hPU1RfSU5ERVgpIHwgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAoKChoaSkgPDwgVEFSR0VUX01PREVfUkVQTFlfMDEwMF9TSElGVF9IT1NUX0lOREVYKSAmICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19IT1NUX0lOREVYKSkKKworI2RlZmluZSBHRVRfSU9DX0lOREVYXzAxMDAoeCkgICAoKCh4KSAmIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19JT0NfSU5ERVgpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+PiBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX1NISUZUX0lPQ19JTkRFWCkKKworI2RlZmluZSBTRVRfSU9DX0lOREVYXzAxMDAodCwgaWkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICgodCkgPSAoKHQpICYgflRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19JT0NfSU5ERVgpIHwgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAoKChpaSkgPDwgVEFSR0VUX01PREVfUkVQTFlfMDEwMF9TSElGVF9JT0NfSU5ERVgpICYgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfTUFTS19JT0NfSU5ERVgpKQorCisjZGVmaW5lIEdFVF9JTklUSUFUT1JfSU5ERVhfMDEwMCh4KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgKCgoeCkgJiBUQVJHRVRfTU9ERV9SRVBMWV8wMTAwX01BU0tfSU5JVElBVE9SX0lOREVYKSAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID4+IFRBUkdFVF9NT0RFX1JFUExZXzAxMDBfU0hJRlRfSU5JVElBVE9SX0lOREVYKQorCisjZGVmaW5lIFNFVF9JTklUSUFUT1JfSU5ERVhfMDEwMCh0LCBpaSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAoKHQpID0gKCh0KSAmIH5UQVJHRVRfTU9ERV9SRVBMWV8wMTAwX01BU0tfSU5JVElBVE9SX0lOREVYKSB8ICAgICAgIC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FzZS4KKyAqICAwOC0yOS0wMSAgMDEuMDIuMDIgIEFkZGVkIERJQUdfREFUQV9VUExPQURfSEVBREVSIGFuZCByZWxhdGVkIGRlZmluZXMuCisgKiAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAqLworCisjaWZuZGVmIE1QSV9UT09MX0gKKyNkZWZpbmUgTVBJX1RPT0xfSAorCisjZGVmaW5lIE1QSV9UT09MQk9YX0NMRUFOX1RPT0wgICAgICAgICAgICAgICAgICAgICAgKDB4MDApCisjZGVmaW5lIE1QSV9UT09MQk9YX01FTU9SWV9NT1ZFX1RPT0wgICAgICAgICAgICAgICAgKDB4MDEpCisjZGVmaW5lIE1QSV9UT09MQk9YX0RJQUdfREFUQV9VUExPQURfVE9PTCAgICAgICAgICAgKDB4MDIpCisjZGVmaW5lIE1QSV9UT09MQk9YX0lTVFdJX1JFQURfV1JJVEVfVE9PTCAgICAgICAgICAgKDB4MDMpCisjZGVmaW5lIE1QSV9UT09MQk9YX0ZDX01BTkFHRU1FTlRfVE9PTCAgICAgICAgICAgICAgKDB4MDQpCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBUb29sYm94IHJlcGx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1RPT0xCT1hfUkVQTFkKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUb29sOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0xlbmd0aDsgICAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgICAgICAgICAgLyogMEVoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfVE9PTEJPWF9SRVBMWSwgTVBJX1BPSU5URVIgUFRSX01TR19UT09MQk9YX1JFUExZLAorICBUb29sYm94UmVwbHlfdCwgTVBJX1BPSU5URVIgcFRvb2xib3hSZXBseV90OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVG9vbGJveCBDbGVhbiBUb29sIHJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UT09MQk9YX0NMRUFOX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUb29sOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KK30gTVNHX1RPT0xCT1hfQ0xFQU5fUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19UT09MQk9YX0NMRUFOX1JFUVVFU1QsCisgIFRvb2xib3hDbGVhblJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcFRvb2xib3hDbGVhblJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9OVlNSQU0gICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAxKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9TRUVQUk9NICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDAyKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9GTEFTSCAgICAgICAgICAgICAgICAgICAgICgweDAwMDAwMDA0KQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9CT09UTE9BREVSICAgICAgICAgICAgICAgICgweDA0MDAwMDAwKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9GV19CQUNLVVAgICAgICAgICAgICAgICAgICgweDA4MDAwMDAwKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9GV19DVVJSRU5UICAgICAgICAgICAgICAgICgweDEwMDAwMDAwKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9PVEhFUl9QRVJTSVNUX1BBR0VTICAgICAgICgweDIwMDAwMDAwKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9QRVJTSVNUX01BTlVGQUNUX1BBR0VTICAgICgweDQwMDAwMDAwKQorI2RlZmluZSBNUElfVE9PTEJPWF9DTEVBTl9CT09UX1NFUlZJQ0VTICAgICAgICAgICAgICgweDgwMDAwMDAwKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVG9vbGJveCBNZW1vcnkgTW92ZSByZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBzdHJ1Y3QgX01TR19UT09MQk9YX01FTV9NT1ZFX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUb29sOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFNHRV9TSU1QTEVfVU5JT04gICAgICAgIFNHTDsgICAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KK30gTVNHX1RPT0xCT1hfTUVNX01PVkVfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19UT09MQk9YX01FTV9NT1ZFX1JFUVVFU1QsCisgIFRvb2xib3hNZW1Nb3ZlUmVxdWVzdF90LCBNUElfUE9JTlRFUiBwVG9vbGJveE1lbU1vdmVSZXF1ZXN0X3Q7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBUb29sYm94IERpYWdub3N0aWMgRGF0YSBVcGxvYWQgcmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit0eXBlZGVmIHN0cnVjdCBfTVNHX1RPT0xCT1hfRElBR19EQVRBX1VQTE9BRF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVG9vbDsgICAgICAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFNHRV9TSU1QTEVfVU5JT04gICAgICAgIFNHTDsgICAgICAgICAgICAgICAgICAgICAgICAvKiAxNGggKi8KK30gTVNHX1RPT0xCT1hfRElBR19EQVRBX1VQTE9BRF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX1RPT0xCT1hfRElBR19EQVRBX1VQTE9BRF9SRVFVRVNULAorICBUb29sYm94RGlhZ0RhdGFVcGxvYWRSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBUb29sYm94RGlhZ0RhdGFVcGxvYWRSZXF1ZXN0X3Q7CisKK3R5cGVkZWYgc3RydWN0IF9ESUFHX0RBVEFfVVBMT0FEX0hFQURFUgoreworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIERpYWdEYXRhTGVuZ3RoOyAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGb3JtYXRDb2RlOyAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDA1aCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KK30gRElBR19EQVRBX1VQTE9BRF9IRUFERVIsIE1QSV9QT0lOVEVSIFBUUl9ESUFHX0RBVEFfVVBMT0FEX0hFQURFUiwKKyAgRGlhZ0RhdGFVcGxvYWRIZWFkZXJfdCwgTVBJX1BPSU5URVIgcERpYWdEYXRhVXBsb2FkSGVhZGVyX3Q7CisKKyNkZWZpbmUgTVBJX1RCX0RJQUdfRk9STUFUX1NDU0lfUFJJTlRGXzEgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1RCX0RJQUdfRk9STUFUX1NDU0lfMiAgICAgICAgICAgICAgICAgICAoMHgwMikKKyNkZWZpbmUgTVBJX1RCX0RJQUdfRk9STUFUX1NDU0lfMyAgICAgICAgICAgICAgICAgICAoMHgwMykKKyNkZWZpbmUgTVBJX1RCX0RJQUdfRk9STUFUX0ZDX1RSQUNFXzEgICAgICAgICAgICAgICAoMHgwNCkKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFRvb2xib3ggSVNUV0kgUmVhZCBXcml0ZSByZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfVE9PTEJPWF9JU1RXSV9SRUFEX1dSSVRFX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBUb29sOyAgICAgICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgICAgICAgICAvKiAwQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXNOdW07ICAgICAgICAgICAgICAgICAgICAgLyogMERoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE51bUFkZHJlc3NCeXRlczsgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgICAgICAgICAgLyogMTFoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgRGF0YUxlbmd0aDsgICAgICAgICAgICAgICAgIC8qIDEyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIERldmljZUFkZHI7ICAgICAgICAgICAgICAgICAvKiAxNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBZGRyMTsgICAgICAgICAgICAgICAgICAgICAgLyogMTVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQWRkcjI7ICAgICAgICAgICAgICAgICAgICAgIC8qIDE2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFkZHIzOyAgICAgICAgICAgICAgICAgICAgICAvKiAxN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDU7ICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDFDaCAqLworfSBNU0dfVE9PTEJPWF9JU1RXSV9SRUFEX1dSSVRFX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfVE9PTEJPWF9JU1RXSV9SRUFEX1dSSVRFX1JFUVVFU1QsCisgIFRvb2xib3hJc3R3aVJlYWRXcml0ZVJlcXVlc3RfdCwgTVBJX1BPSU5URVIgcFRvb2xib3hJc3R3aVJlYWRXcml0ZVJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfVEJfSVNUV0lfRkxBR1NfV1JJVEUgICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfVEJfSVNUV0lfRkxBR1NfUkVBRCAgICAgICAgICAgICAgICAgICAgICgweDAxKQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVG9vbGJveCBGQyBNYW5hZ2VtZW50IHJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogQWN0aW9uSW5mbyBmb3IgQnVzIGFuZCBUYXJnZXRJZCAqLwordHlwZWRlZiBzdHJ1Y3QgX01QSV9UQl9GQ19NQU5BR0VfQlVTX1RJRF9BSQoreworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdXM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVGFyZ2V0SWQ7ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworfSBNUElfVEJfRkNfTUFOQUdFX0JVU19USURfQUksIE1QSV9QT0lOVEVSIFBUUl9NUElfVEJfRkNfTUFOQUdFX0JVU19USURfQUksCisgIE1waVRiRmNNYW5hZ2VCdXNUaWRBaV90LCBNUElfUE9JTlRFUiBwTXBpVGJGY01hbmFnZUJ1c1RpZEFpX3Q7CisKKy8qIEFjdGlvbkluZm8gZm9yIHBvcnQgaWRlbnRpZmllciAqLwordHlwZWRlZiBzdHJ1Y3QgX01QSV9UQl9GQ19NQU5BR0VfUElEX0FJCit7CisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgUG9ydElkZW50aWZpZXI7ICAgICAgICAgICAgIC8qIDAwaCAqLworfSBNUElfVEJfRkNfTUFOQUdFX1BJRF9BSSwgTVBJX1BPSU5URVIgUFRSX01QSV9UQl9GQ19NQU5BR0VfUElEX0FJLAorICBNcGlUYkZjTWFuYWdlUGlkQWlfdCwgTVBJX1BPSU5URVIgcE1waVRiRmNNYW5hZ2VQaWRBaV90OworCisvKiB1bmlvbiBvZiBBY3Rpb25JbmZvICovCit0eXBlZGVmIHVuaW9uIF9NUElfVEJfRkNfTUFOQUdFX0FJX1VOSU9OCit7CisgICAgTVBJX1RCX0ZDX01BTkFHRV9CVVNfVElEX0FJICAgICBCdXNUaWQ7CisgICAgTVBJX1RCX0ZDX01BTkFHRV9QSURfQUkgICAgICAgICBQb3J0OworfSBNUElfVEJfRkNfTUFOQUdFX0FJX1VOSU9OLCBNUElfUE9JTlRFUiBQVFJfTVBJX1RCX0ZDX01BTkFHRV9BSV9VTklPTiwKKyAgTXBpVGJGY01hbmFnZUFpVW5pb25fdCwgTVBJX1BPSU5URVIgcE1waVRiRmNNYW5hZ2VBaVVuaW9uX3Q7CisKK3R5cGVkZWYgc3RydWN0IF9NU0dfVE9PTEJPWF9GQ19NQU5BR0VfUkVRVUVTVAoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBUb29sOyAgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ7ICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgIEFjdGlvbjsgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAvKiAwRGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAgICAgLyogMEVoICovCisgICAgTVBJX1RCX0ZDX01BTkFHRV9BSV9VTklPTiAgIEFjdGlvbkluZm87ICAgICAgICAgICAgIC8qIDEwaCAqLworfSBNU0dfVE9PTEJPWF9GQ19NQU5BR0VfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19UT09MQk9YX0ZDX01BTkFHRV9SRVFVRVNULAorICBUb29sYm94RmNNYW5hZ2VSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBUb29sYm94RmNNYW5hZ2VSZXF1ZXN0X3Q7CisKKy8qIGRlZmluZXMgZm9yIHRoZSBBY3Rpb24gZmllbGQgKi8KKyNkZWZpbmUgTVBJX1RCX0ZDX01BTkFHRV9BQ1RJT05fRElTQ19BTEwgICAgICAgICAgICAoMHgwMCkKKyNkZWZpbmUgTVBJX1RCX0ZDX01BTkFHRV9BQ1RJT05fRElTQ19QSUQgICAgICAgICAgICAoMHgwMSkKKyNkZWZpbmUgTVBJX1RCX0ZDX01BTkFHRV9BQ1RJT05fRElTQ19CVVNfVElEICAgICAgICAoMHgwMikKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIERpYWdub3N0aWMgQnVmZmVyIFBvc3QgcmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfRElBR19CVUZGRVJfUE9TVF9SRVFVRVNUCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVHJhY2VMZXZlbDsgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlclR5cGU7ICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBFeHRlbmRlZFR5cGU7ICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgQnVmZmVyTGVuZ3RoOyAgICAgICAgICAgICAgIC8qIDEwaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFByb2R1Y3RTcGVjaWZpY1s0XTsgICAgICAgICAvKiAxNGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAgICAgLyogMThoICovCisgICAgU0dFX1NJTVBMRV9VTklPTiAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDI4aCAqLworfSBNU0dfRElBR19CVUZGRVJfUE9TVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0RJQUdfQlVGRkVSX1BPU1RfUkVRVUVTVCwKKyAgRGlhZ0J1ZmZlclBvc3RSZXF1ZXN0X3QsIE1QSV9QT0lOVEVSIHBEaWFnQnVmZmVyUG9zdFJlcXVlc3RfdDsKKworI2RlZmluZSBNUElfRElBR19CVUZfVFlQRV9UUkFDRSAgICAgICAgICAgICAgICAgICAgICgweDAwKQorI2RlZmluZSBNUElfRElBR19CVUZfVFlQRV9TTkFQU0hPVCAgICAgICAgICAgICAgICAgICgweDAxKQorI2RlZmluZSBNUElfRElBR19CVUZfVFlQRV9FWFRFTkRFRCAgICAgICAgICAgICAgICAgICgweDAyKQorCisjZGVmaW5lIE1QSV9ESUFHX0VYVEVOREVEX1FUQUcgICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAwMDEpCisKKworLyogRGlhZ25vc3RpYyBCdWZmZXIgUG9zdCByZXBseSAqLwordHlwZWRlZiBzdHJ1Y3QgX01TR19ESUFHX0JVRkZFUl9QT1NUX1JFUExZCit7CisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAgICAgICAgIC8qIDAwaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEJ1ZmZlclR5cGU7ICAgICAgICAgICAgICAgICAvKiAwMWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgICAgICAgICAgLyogMDJoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAgICAgICAgIC8qIDAzaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgICAgICAgICAvKiAwNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgICAgICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAgICAgICAgIC8qIDA3aCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgICAgICAgICAvKiAwOGggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgICAgICAgICAgLyogMENoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgSU9DU3RhdHVzOyAgICAgICAgICAgICAgICAgIC8qIDBFaCAqLworICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgICAgICAgICAvKiAxMGggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2Zlckxlbmd0aDsgICAgICAgICAgICAgLyogMTRoICovCit9IE1TR19ESUFHX0JVRkZFUl9QT1NUX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0RJQUdfQlVGRkVSX1BPU1RfUkVQTFksCisgIERpYWdCdWZmZXJQb3N0UmVwbHlfdCwgTVBJX1BPSU5URVIgcERpYWdCdWZmZXJQb3N0UmVwbHlfdDsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIERpYWdub3N0aWMgUmVsZWFzZSByZXF1ZXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc3RydWN0IF9NU0dfRElBR19SRUxFQVNFX1JFUVVFU1QKK3sKKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgICAgICAgICAgLyogMDBoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVmZmVyVHlwZTsgICAgICAgICAgICAgICAgIC8qIDAxaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgICAgICAgICAvKiAwMmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgICAgICAgICAgLyogMDNoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAgICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgICAgICAgICAvKiAwNmggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgICAgICAgICAgLyogMDdoICovCisgICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAgICAgICAgIC8qIDA4aCAqLworfSBNU0dfRElBR19SRUxFQVNFX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfRElBR19SRUxFQVNFX1JFUVVFU1QsCisgIERpYWdSZWxlYXNlUmVxdWVzdF90LCBNUElfUE9JTlRFUiBwRGlhZ1JlbGVhc2VSZXF1ZXN0X3Q7CisKKworLyogRGlhZ25vc3RpYyBSZWxlYXNlIHJlcGx5ICovCit0eXBlZGVmIHN0cnVjdCBfTVNHX0RJQUdfUkVMRUFTRV9SRVBMWQoreworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgICAgICAgICAvKiAwMGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBCdWZmZXJUeXBlOyAgICAgICAgICAgICAgICAgLyogMDFoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAgICAgICAgIC8qIDAyaCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgICAgICAgICAvKiAwM2ggKi8KKyAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAgICAgLyogMDRoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAgICAgICAgIC8qIDA2aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgICAgICAgICAvKiAwN2ggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgICAgICAgICAgLyogMDhoICovCisgICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAgICAgICAgIC8qIDBDaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgICAgICAgICAvKiAwRWggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NMb2dJbmZvOyAgICAgICAgICAgICAgICAgLyogMTBoICovCit9IE1TR19ESUFHX1JFTEVBU0VfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfRElBR19SRUxFQVNFX1JFUExZLAorICBEaWFnUmVsZWFzZVJlcGx5X3QsIE1QSV9QT0lOVEVSIHBEaWFnUmVsZWFzZVJlcGx5X3Q7CisKKworI2VuZGlmCisKKwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX3R5cGUuaCBiL2RyaXZlcnMvbWVzc2FnZS9mdXNpb24vbHNpL21waV90eXBlLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjM5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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKi8KKworI2lmbmRlZiBNUElfVFlQRV9ICisjZGVmaW5lIE1QSV9UWVBFX0gKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRGVmaW5lIE1QSV9QT0lOVEVSIGlmIGl0IGhhc24ndCBhbHJlYWR5IGJlZW4gZGVmaW5lZC4gQnkgZGVmYXVsdCBNUElfUE9JTlRFUgorICogaXMgZGVmaW5lZCB0byBiZSBhIG5lYXIgcG9pbnRlci4gTVBJX1BPSU5URVIgY2FuIGJlIGRlZmluZWQgYXMgYSBmYXIgcG9pbnRlcgorICogYnkgZGVmaW5pbmcgTVBJX1BPSU5URVIgYXMgImZhciAqIiBiZWZvcmUgdGhpcyBoZWFkZXIgZmlsZSBpcyBpbmNsdWRlZC4KKyAqLworI2lmbmRlZiBNUElfUE9JTlRFUgorI2RlZmluZSBNUElfUE9JTlRFUiAgICAgKgorI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqICAgICAgICAgICAgICAgQiBhIHMgaSBjICAgIFQgeSBwIGUgcworKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3R5cGVkZWYgc2lnbmVkICAgY2hhciAgIFM4OwordHlwZWRlZiB1bnNpZ25lZCBjaGFyICAgVTg7Cit0eXBlZGVmIHNpZ25lZCAgIHNob3J0ICBTMTY7Cit0eXBlZGVmIHVuc2lnbmVkIHNob3J0ICBVMTY7CisKKwordHlwZWRlZiBpbnQzMl90ICAgUzMyOwordHlwZWRlZiB1X2ludDMyX3QgVTMyOworCisvKgorICogIFRoZSBvbmx5IHdheSBjcmFwIGJlbG93IGNvdWxkIHdvcmsgb24gYmlnLWVuZGlhbiBib3hlbiB3b3VsZCBiZSBpZiBpdAorICogIHdhc24ndCB1c2VkIGF0IGFsbC4KKyAqLworCit0eXBlZGVmIHN0cnVjdCBfUzY0Cit7CisgICAgVTMyICAgICAgICAgIExvdzsKKyAgICBTMzIgICAgICAgICAgSGlnaDsKK30gUzY0OworCit0eXBlZGVmIHN0cnVjdCBfVTY0Cit7CisgICAgVTMyICAgICAgICAgIExvdzsKKyAgICBVMzIgICAgICAgICAgSGlnaDsKK30gVTY0OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIFBvaW50ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordHlwZWRlZiBTOCAgICAgICpQUzg7Cit0eXBlZGVmIFU4ICAgICAgKlBVODsKK3R5cGVkZWYgUzE2ICAgICAqUFMxNjsKK3R5cGVkZWYgVTE2ICAgICAqUFUxNjsKK3R5cGVkZWYgUzMyICAgICAqUFMzMjsKK3R5cGVkZWYgVTMyICAgICAqUFUzMjsKK3R5cGVkZWYgUzY0ICAgICAqUFM2NDsKK3R5cGVkZWYgVTY0ICAgICAqUFU2NDsKKworCisjZW5kaWYKKwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9tcHRiYXNlLmMgYi9kcml2ZXJzL21lc3NhZ2UvZnVzaW9uL21wdGJhc2UuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45NDJjYzFjCi0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9tZXNzYWdlL2Z1c2lv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qLworI2luY2x1ZGUgPGFzbS9pby5oPgorI2lmZGVmIENPTkZJR19NVFJSCisjaW5jbHVkZSA8YXNtL210cnIuaD4KKyNlbmRpZgorI2lmZGVmIF9fc3BhcmNfXworI2luY2x1ZGUgPGFzbS9pcnEuaD4JCQkvKiBuZWVkZWQgZm9yIF9faXJxX2l0b2EoKSBwcm90byAqLworI2VuZGlmCisKKyNpbmNsdWRlICJtcHRiYXNlLmgiCisKKy8qPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09Ki8KKyNkZWZpbmUgbXlfTkFNRQkJIkZ1c2lvbiBNUFQgYmFzZSBkcml2ZXIiCisjZGVmaW5lIG15X1ZFUlNJT04JTVBUX0xJTlVYX1ZFUlNJT05fQ09NTU9OCisjZGVmaW5lIE1ZTkFNCQkibXB0YmFzZSIKKworTU9EVUxFX0FVVEhPUihNT0RVTEVBVVRIT1IpOworTU9EVUxFX0RFU0NSSVBUSU9OKG15X05BTUUpOworTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOworCisvKgorICogIGNtZCBsaW5lIHBhcmFtZXRlcnMKKyAqLworI2lmZGVmIE1GQ05UCitzdGF0aWMgaW50IG1mY291bnRlciA9IDA7CisjZGVmaW5lIFBSSU5UX01GX0NPVU5UIDIwMDAwCisjZW5kaWYKKworLyo9LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0qLworLyoKKyAqICBQdWJsaWMgZGF0YS4uLgorICovCitpbnQgbXB0X2xhbl9pbmRleCA9IC0xOworaW50IG1wdF9zdG1faW5kZXggPSAtMTsKKworc3RydWN0IHByb2NfZGlyX2VudHJ5ICptcHRfcHJvY19yb290X2RpcjsKKworI2RlZmluZSBXSE9JTklUX1VOS05PV04JCTB4QUEKKworLyo9LT0tPS09LT0tPS09LT0tPS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ZXJfZGlzcG9zZShpb2MpOworCisJcGNpX3NldF9kcnZkYXRhKHBkZXYsIE5VTEwpOworfQorCisvKj0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPSovCisvKgorICoJbXB0YmFzZV9zaHV0ZG93biAtCisgKgorICovCitzdGF0aWMgdm9pZAorbXB0YmFzZV9zaHV0ZG93bihzdHJ1Y3QgZGV2aWNlICogZGV2KQoreworCWludCBpaTsKKworCS8qIGNhbGwgcGVyIGRldmljZSBkcml2ZXIgc2h1dGRvd24gZW50cnkgcG9pbnQgKi8KKwlmb3IoaWk9MDsgaWk8TVBUX01BWF9QUk9UT0NPTF9EUklWRVJTOyBpaSsrKSB7CisJCWlmKE1wdERldmljZURyaXZlckhhbmRsZXJzW2lpXSAmJgorCQkgIE1wdERldmljZURyaXZlckhhbmRsZXJzW2lpXS0+c2h1dGRvd24pIHsKKwkJCU1wdERldmljZURyaXZlckhhbmRsZXJzW2lpXS0+c2h1dGRvd24oZGV2KTsKKwkJfQorCX0KKworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUG93ZXIgTWFuYWdlbWVudAorICovCisjaWZkZWYgQ09ORklHX1BNCisvKj0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPSovCisvKgorICoJbXB0YmFzZV9zdXNwZW5kIC0gRnVzaW9uIE1QVCBiYXNlIGRyaXZlciBzdXNwZW5kIHJvdXRpbmUuCisgKgorICoKKyAqLworc3RhdGljIGludAorbXB0YmFzZV9zdXNwZW5kKHN0cnVjdCBwY2lfZGV2ICpwZGV2LCB1MzIgc3RhdGUpCit7CisJdTMyIGRldmljZV9zdGF0ZTsKKwlNUFRfQURBUFRFUi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bHVkZSA8bGludXgva2VybmVsLmg+CisjaW5jbHVkZSA8bGludXgvc2xhYi5oPgorI2luY2x1ZGUgPGxpbnV4L21pc2NkZXZpY2UuaD4KKyNpbmNsdWRlIDxsaW51eC9zcGlubG9jay5oPgorI2luY2x1ZGUgPGxpbnV4L3ZlcnNpb24uaD4KKyNpbmNsdWRlIDxsaW51eC93b3JrcXVldWUuaD4KKyNpbmNsdWRlIDxsaW51eC9kZWxheS5oPgorLy8gI2luY2x1ZGUgPGxpbnV4L3RyZGV2aWNlLmg+CisKKyNpbmNsdWRlIDxhc20vdWFjY2Vzcy5oPgorI2luY2x1ZGUgPGFzbS9pby5oPgorCisgICAgLyogT3ZlcnJpZGUgbXB0YmFzZS5oIGJ5IHByZS1kZWZpbmluZyB0aGVzZSEgKi8KKyAgICAjZGVmaW5lIE1PRFVMRUFVVEhPUiAiTm9haCBSb21lciwgRWRkaWUgQy4gRG9zdCIKKworI2luY2x1ZGUgIm1wdGJhc2UuaCIKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBMQU5BTUUJCSJGdXNpb24gTVBUIExBTiBkcml2ZXIiCisjZGVmaW5lIExBTlZFUgkJTVBUX0xJTlVYX1ZFUlNJT05fQ09NTU9OCisKKyNpZmRlZiBNT0RVTEUKK01PRFVMRV9BVVRIT1IoTU9EVUxFQVVUSE9SKTsKK01PRFVMRV9ERVNDUklQVElPTihMQU5BTUUpOworI2VuZGlmCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTVBUX0xBTl9NQVhfQlVDS0VUU19PVVQgMjU2CisjZGVmaW5lIE1QVF9MQU5fQlVDS0VUX1RIUkVTSAkxOCAvKiA5IGJ1Y2tldHMgaW4gb25lIG1lc3NhZ2UgKi8KKyNkZWZ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ciB3YXMgcGFzc2VkCisgICAgICBFTlhJTyAgICAgICBJbnZhbGlkIElPUCBudW1iZXIKKyAgICAgIEVOT0JVRlMgICAgIEJ1ZmZlciBub3QgbGFyZ2UgZW5vdWdoLiAgSWYgdGhpcyBvY2N1cnMsIHRoZSByZXF1aXJlZAorICAgICAgICAgICAgICAgICAgYnVmZmVyIGxlbmd0aCBpcyB3cml0dGVuIGludG8gKihsY3QtPnJlc2xlbikKKworVkkuIFNldHR0aW5nIFBhcmFtZXRlcnMKKyAgIAorICAgU1lOT1BTSVMgCisgCisgICBpb2N0bChmZCwgSTJPUEFSTVNFVCwgc3RydWN0IGkyb19wYXJtX3NldGdldCAqb3BzKTsKKworICAgICAgc3RydWN0IGkyb19jbWRfcHNldGdldAorICAgICAgeworICAgICAgICAgdTMyICAgaW9wOyAgICAgIC8qIElPUCB1bml0IG51bWJlciAqLworICAgICAgICAgdTMyICAgdGlkOyAgICAgIC8qIFRhcmdldCBkZXZpY2UgVElEICovCisgICAgICAgICB2b2lkICAqb3BidWY7ICAgLyogT3BlcmF0aW9uIExpc3QgYnVmZmVyICovCisgICAgICAgICB1MzIgICBvcGxlbjsgICAgLyogT3BlcmF0aW9uIExpc3QgYnVmZmVyIGxlbmd0aCBpbiBieXRlcyAqLworICAgICAgICAgdm9pZCAgKnJlc2J1ZjsgIC8qIFJlc3VsdCBMaXN0IGJ1ZmZlciAqLworICAgICAgICAgdTMyICAgKnJlc2xlbjsgIC8qIFJlc3VsdCBMaXN0IGJ1ZmZlciBsZW5ndGggaW4gYnl0ZXMgKi8KKyAgICAgIH07CisKKyAgIERFU0NSSVBUSU9OCisKKyAgIFRoaXMgZnVuY3Rpb24gcG9zdHMgYSBVdGlsUGFyYW1zU2V0IG1lc3NhZ2UgdG8gdGhlIGRldmljZSBpZGVudGlmaWVkCisgICBieSBvcHMtPmlvcCBhbmQgb3BzLT50aWQuICBUaGUgb3BlcmF0aW9uIGxpc3QgZm9yIHRoZSBtZXNzYWdlIGlzIAor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5vIGlzIHNldCBhcHByb3ByaWF0bHk6CisKKyAgICAgIEVGQVVMVCAgICAgIEludmFsaWQgdXNlciBzcGFjZSBwb2ludGVyIHdhcyBwYXNzZWQKKyAgICAgIEVOWElPICAgICAgIEludmFsaWQgSU9QIG51bWJlcgorICAgICAgRVRJTUVET1VUICAgVGltZW91dCB3YWl0aW5nIGZvciByZXBseSBtZXNzYWdlCisgICAgICBFTk9NRU0gICAgICBLZXJuZWwgbWVtb3J5IGFsbG9jYXRpb24gZXJyb3IKKyAgICAgICAgIAorWC4gUmVtb3ZpbmcgU29mdHdhcmUKKyAgIAorICAgU1lOT1BTSVMgCisgCisgICBpb2N0bChmZCwgSTJPU1dERUwsIHN0cnVjdCBpMm9fc3dfeGZlciAqc3cpOworCisgICAgICBzdHJ1Y3QgaTJvX3N3X3hmZXIKKyAgICAgIHsKKyAgICAgICAgIHUzMiAgIGlvcDsgICAgICAvKiBJT1AgdW5pdCBudW1iZXIgKi8KKyAgICAgICAgIHU4ICAgIGZsYWdzOyAJIC8qIFJlbW92ZUZsYWdzICovCisgICAgICAgICB1OCAgICBzd190eXBlOyAgLyogU29mdHdhcmUgdHlwZSAqLworICAgICAgICAgdTMyICAgc3dfaWQ7ICAgIC8qIFNvZnR3YXJlIElEICovCisgICAgICAgICB2b2lkICAqYnVmOyAgICAgLyogVW51c2VkICovCisgICAgICAgICB1MzIgICAqc3dsZW47ICAgLyogTGVuZ3RoIG9mIHRoZSBzb2Z0d2FyZSBkYXRhICovICAgICAgICAKKyAgICAgICAgIHUzMiAgICptYXhmcmFnOyAvKiBVbnVzZWQgKi8KKyAgICAgICAgIHUzMiAgICpjdXJmcmFnOyAvKiBVbnVzZWQgKi8KKyAgICAgIH07CisKKyAgIERFU0NSSVBUSU9OCisKKyAgIFRoaXMgZnVuY3Rpb24gcmVtb3ZlcyBzb2Z0d2FyZSBmcm9tIHRoZSBJT1AgaWRlbnRpZmllZCBieSBzdy0+aW9wLgorICAgVGhlIFJlbW92ZUZsY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LRVJOX0RFQlVHICJFWEVDX0JJT1NfSU5GT19TRVQsICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfQk9PVF9ERVZJQ0VfU0VUOgorCQlwcmludGsoS0VSTl9ERUJVRyAiRVhFQ19CT09UX0RFVklDRV9TRVQsICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfQ09ORklHX1ZBTElEQVRFOgorCQlwcmludGsoS0VSTl9ERUJVRyAiRVhFQ19DT05GSUdfVkFMSURBVEUsICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfQ09OTl9TRVRVUDoKKwkJcHJpbnRrKEtFUk5fREVCVUcgIkVYRUNfQ09OTl9TRVRVUCwgIik7CisJCWJyZWFrOworCWNhc2UgSTJPX0NNRF9ERE1fREVTVFJPWToKKwkJcHJpbnRrKEtFUk5fREVCVUcgIkVYRUNfRERNX0RFU1RST1ksICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfRERNX0VOQUJMRToKKwkJcHJpbnRrKEtFUk5fREVCVUcgIkVYRUNfRERNX0VOQUJMRSwgIik7CisJCWJyZWFrOworCWNhc2UgSTJPX0NNRF9ERE1fUVVJRVNDRToKKwkJcHJpbnRrKEtFUk5fREVCVUcgIkVYRUNfRERNX1FVSUVTQ0UsICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfRERNX1JFU0VUOgorCQlwcmludGsoS0VSTl9ERUJVRyAiRVhFQ19ERE1fUkVTRVQsICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfRERNX1NVU1BFTkQ6CisJCXByaW50ayhLRVJOX0RFQlVHICJFWEVDX0RETV9TVVNQRU5ELCAiKTsKKwkJYnJlYWs7CisJY2FzZSBJMk9fQ01EX0RFVklDRV9BU1NJR046CisJCXByaW50ayhLRVJOX0RFQlVHICJFWEVDX0RFVklDRV9BU1NJR04sICIpOworCQlicmVhazsKKwljYXNlIEkyT19DTURfREVWSUNFX1JFTEVBU0U6CisJCXByaW50ayhLRVJOX0RFQlVHICJFWEV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wlpbnQgbGVuZ3RoOworCWludCBpOworCWludCBzdGF0ZTsKKworCWlmIChwWzNdICE9IDApIHsKKwkJcHJpbnRrKEtFUk5fRVJSCisJCSAgICAgICAiJXM6IEhSVCB0YWJsZSBmb3IgY29udHJvbGxlciBpcyB0b28gbmV3IGEgdmVyc2lvbi5cbiIsCisJCSAgICAgICBjLT5uYW1lKTsKKwkJcmV0dXJuOworCX0KKworCWNvdW50ID0gcFswXSB8IChwWzFdIDw8IDgpOworCWxlbmd0aCA9IHBbMl07CisKKwlwcmludGsoS0VSTl9JTkZPICIlczogSFJUIGhhcyAlZCBlbnRyaWVzIG9mICVkIGJ5dGVzIGVhY2guXG4iLAorCSAgICAgICBjLT5uYW1lLCBjb3VudCwgbGVuZ3RoIDw8IDIpOworCisJcm93cyArPSAyOworCisJZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKwkJcHJpbnRrKEtFUk5fSU5GTyAiQWRhcHRlciAlMDhYOiAiLCByb3dzWzBdKTsKKwkJcCA9ICh1OCAqKSAocm93cyArIDEpOworCQlkID0gKHU4ICopIChyb3dzICsgMik7CisJCXN0YXRlID0gcFsxXSA8PCA4IHwgcFswXTsKKworCQlwcmludGsoS0VSTl9ERUJVRyAiVElEICUwNFg6WyIsIHN0YXRlICYgMHhGRkYpOworCQlzdGF0ZSA+Pj0gMTI7CisJCWlmIChzdGF0ZSAmICgxIDw8IDApKQorCQkJcHJpbnRrKEtFUk5fREVCVUcgIkgiKTsJLyogSGlkZGVuICovCisJCWlmIChzdGF0ZSAmICgxIDw8IDIpKSB7CisJCQlwcmludGsoS0VSTl9ERUJVRyAiUCIpOwkvKiBQcmVzZW50ICovCisJCQlpZiAoc3RhdGUgJiAoMSA8PCAxKSkKKwkJCQlwcmludGsoS0VSTl9ERUJVRyAiQyIpOwkvKiBDb250cm9sbGVkICovCisJCX0KKwkJaWYgKHN0YXRlID4gOSkKKwkJCXByaW50ayhLRVJOX0RFQlVHICIqIik7CS8qIEhhcmQg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b2YodTMyKSAqIDIpKSB7CisJCQlwcmludGsoS0VSTl9XQVJOSU5HCisJCQkgICAgICAgIiVzOiBDb3VsZCBub3QgY29weSBtZXNzYWdlIGNvbnRleHQgRlJPTSB1c2VyXG4iLAorCQkJICAgICAgIGMtPm5hbWUpOworCQkJcmNvZGUgPSAtRUZBVUxUOworCQl9CisJCWlmIChjb3B5X3RvX3VzZXIodXNlcl9yZXBseSwgcmVwbHksIHJlcGx5X3NpemUpKSB7CisJCQlwcmludGsoS0VSTl9XQVJOSU5HCisJCQkgICAgICAgIiVzOiBDb3VsZCBub3QgY29weSByZXBseSBUTyB1c2VyXG4iLCBjLT5uYW1lKTsKKwkJCXJjb2RlID0gLUVGQVVMVDsKKwkJfQorCX0KKworICAgICAgY2xlYW51cDoKKwlrZnJlZShyZXBseSk7CisJcmV0dXJuIHJjb2RlOworfQorCisjZWxzZQorCitzdGF0aWMgaW50IGkyb19jZmdfcGFzc3RocnUodW5zaWduZWQgbG9uZyBhcmcpCit7CisJc3RydWN0IGkyb19jbWRfcGFzc3RocnUgX191c2VyICpjbWQgPQorCSAgICAoc3RydWN0IGkyb19jbWRfcGFzc3RocnUgX191c2VyICopYXJnOworCXN0cnVjdCBpMm9fY29udHJvbGxlciAqYzsKKwl1MzIgX191c2VyICp1c2VyX21zZzsKKwl1MzIgKnJlcGx5ID0gTlVMTDsKKwl1MzIgX191c2VyICp1c2VyX3JlcGx5ID0gTlVMTDsKKwl1MzIgc2l6ZSA9IDA7CisJdTMyIHJlcGx5X3NpemUgPSAwOworCXUzMiByY29kZSA9IDA7CisJdm9pZCAqc2dfbGlzdFtTR19UQUJMRVNJWkVdOworCXUzMiBzZ19vZmZzZXQgPSAwOworCXUzMiBzZ19jb3VudCA9IDA7CisJaW50IHNnX2luZGV4ID0gMDsKKwl1MzIgaSA9IDA7CisJdm9pZCAqcCA9IE5VTEw7CisJaTJvX3N0YXR1c19ibG9jayAqc2I7CisJc3RydWN0IGkyb19tZXNzYWdlIF9faW9t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tFUk5fV0FSTklORworCQkJCQkgICAgICAgIiVzOiBDb3VsZCBub3QgY29weSAlcCBUTyB1c2VyICV4XG4iLAorCQkJCQkgICAgICAgYy0+bmFtZSwgc2dfbGlzdFtqXSwKKwkJCQkJICAgICAgIHNnW2pdLmFkZHJfYnVzKTsKKwkJCQkJcmNvZGUgPSAtRUZBVUxUOworCQkJCQlnb3RvIGNsZWFudXA7CisJCQkJfQorCQkJfQorCQl9CisJfQorCisJLyogQ29weSBiYWNrIHRoZSByZXBseSB0byB1c2VyIHNwYWNlICovCisJaWYgKHJlcGx5X3NpemUpIHsKKwkJLy8gd2Ugd3JvdGUgb3VyIG93biB2YWx1ZXMgZm9yIGNvbnRleHQgLSBub3cgcmVzdG9yZSB0aGUgdXNlciBzdXBwbGllZCBvbmVzCisJCWlmIChjb3B5X2Zyb21fdXNlcihyZXBseSArIDIsIHVzZXJfbXNnICsgMiwgc2l6ZW9mKHUzMikgKiAyKSkgeworCQkJcHJpbnRrKEtFUk5fV0FSTklORworCQkJICAgICAgICIlczogQ291bGQgbm90IGNvcHkgbWVzc2FnZSBjb250ZXh0IEZST00gdXNlclxuIiwKKwkJCSAgICAgICBjLT5uYW1lKTsKKwkJCXJjb2RlID0gLUVGQVVMVDsKKwkJfQorCQlpZiAoY29weV90b191c2VyKHVzZXJfcmVwbHksIHJlcGx5LCByZXBseV9zaXplKSkgeworCQkJcHJpbnRrKEtFUk5fV0FSTklORworCQkJICAgICAgICIlczogQ291bGQgbm90IGNvcHkgcmVwbHkgVE8gdXNlclxuIiwgYy0+bmFtZSk7CisJCQlyY29kZSA9IC1FRkFVTFQ7CisJCX0KKwl9CisKKyAgICAgIGNsZWFudXA6CisJa2ZyZWUocmVwbHkpOworCXJldHVybiByY29kZTsKK30KKyNlbmRpZgorCisvKgorICogSU9DVEwgSGFuZGxlcgorICovCitzdGF0aWMgaW50IGkyb19jZmdfaW9jdGwoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZwLC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m9wZXJ0aWVzICYgMHgxKQorCQkJc2VxX3ByaW50ZihzZXEsICJUYWJsZSAgIik7CisJCWVsc2UKKwkJCXNlcV9wcmludGYoc2VxLCAiU2NhbGFyICIpOworCQlpZiAocHJvcGVydGllcyAmIDB4MikKKwkJCXNlcV9wcmludGYoc2VxLCAiICsgIik7CisJCWVsc2UKKwkJCXNlcV9wcmludGYoc2VxLCAiIC0gIik7CisJCWlmIChwcm9wZXJ0aWVzICYgMHg0KQorCQkJc2VxX3ByaW50ZihzZXEsICIgICsgIik7CisJCWVsc2UKKwkJCXNlcV9wcmludGYoc2VxLCAiICAtICIpOworCQlpZiAocHJvcGVydGllcyAmIDB4OCkKKwkJCXNlcV9wcmludGYoc2VxLCAiICArICIpOworCQllbHNlCisJCQlzZXFfcHJpbnRmKHNlcSwgIiAgLSAiKTsKKworCQlzZXFfcHJpbnRmKHNlcSwgIlxuIik7CisJfQorCisJaWYgKHJlc3VsdC0+bW9yZV9mbGFnKQorCQlzZXFfcHJpbnRmKHNlcSwgIlRoZXJlIGlzIG1vcmUuLi5cbiIpOworICAgICAgb3V0OgorCWtmcmVlKHJlc3VsdCk7CisJcmV0dXJuIDA7Cit9CisKKy8qIEdlbmVyaWMgZ3JvdXAgRjAwMWggLSBQaHlzaWNhbCBEZXZpY2UgVGFibGUgKHRhYmxlKSAqLworc3RhdGljIGludCBpMm9fc2VxX3Nob3dfcGh5c19kZXZpY2Uoc3RydWN0IHNlcV9maWxlICpzZXEsIHZvaWQgKnYpCit7CisJc3RydWN0IGkyb19kZXZpY2UgKmQgPSAoc3RydWN0IGkyb19kZXZpY2UgKilzZXEtPnByaXZhdGU7CisJaW50IHRva2VuOworCWludCBpOworCisJc3RydWN0IHsKKwkJdTE2IHJlc3VsdF9jb3VudDsKKwkJdTE2IHBhZDsKKwkJdTE2IGJsb2NrX3NpemU7CisJCXU4IGJsb2NrX3N0YXR1czsKKwkJdTggZXJyb3JfaW5mb19zaXplOworCQl1MTYgcm93X2NvdW50Owor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tCS0JSW52ZW50IGRpc2sgZ2VvbWV0cnkKKyAqCUBzZGV2OiBzY3NpIGRldmljZQorICoJQGRldjogYmxvY2sgbGF5ZXIgZGV2aWNlCisgKglAY2FwYWNpdHk6IHNpemUgaW4gc2VjdG9ycworICoJQGlwOiBnZW9tZXRyeSBhcnJheQorICoKKyAqCVRoaXMgaXMgYW55b25lcyBndWVzcyBxdWl0ZSBmcmFua2x5LiBXZSB1c2UgdGhlIHNhbWUgcnVsZXMgZXZlcnlvbmUKKyAqCWVsc2UgYXBwZWFycyB0byBhbmQgaG9wZS4gSXQgc2VlbXMgdG8gd29yay4KKyAqLworCitzdGF0aWMgaW50IGkyb19zY3NpX2Jpb3NfcGFyYW0oc3RydWN0IHNjc2lfZGV2aWNlICpzZGV2LAorCQkJICAgICAgIHN0cnVjdCBibG9ja19kZXZpY2UgKmRldiwgc2VjdG9yX3QgY2FwYWNpdHksCisJCQkgICAgICAgaW50ICppcCkKK3sKKwlpbnQgc2l6ZTsKKworCXNpemUgPSBjYXBhY2l0eTsKKwlpcFswXSA9IDY0OwkJLyogaGVhZHMgICAgICAgICAgICAgICAgICAgICAgICAqLworCWlwWzFdID0gMzI7CQkvKiBzZWN0b3JzICAgICAgICAgICAgICAgICAgICAgICovCisJaWYgKChpcFsyXSA9IHNpemUgPj4gMTEpID4gMTAyNCkgewkvKiBjeWxpbmRlcnMsIHRlc3QgZm9yIGJpZyBkaXNrICovCisJCWlwWzBdID0gMjU1OwkvKiBoZWFkcyAgICAgICAgICAgICAgICAgICAgICAgICovCisJCWlwWzFdID0gNjM7CS8qIHNlY3RvcnMgICAgICAgICAgICAgICAgICAgICAgKi8KKwkJaXBbMl0gPSBzaXplIC8gKDI1NSAqIDYzKTsJLyogY3lsaW5kZXJzICAgICAgICAgICAgICAgICAgICAqLworCX0KKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHN0cnVjdCBzY3NpX2hvc3RfdGVtcGxhdGUgaTJvX3Njc2lfaG9zdF90ZW1wbGF0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CBzdHJ1Y3QgcGNpX2RldmljZV9pZCAqaWQpCit7CisJc3RydWN0IGkyb19jb250cm9sbGVyICpjOworCWludCByYzsKKworCXByaW50ayhLRVJOX0lORk8gImkybzogQ2hlY2tpbmcgZm9yIFBDSSBJMk8gY29udHJvbGxlcnMuLi5cbiIpOworCisJaWYgKChwZGV2LT5jbGFzcyAmIDB4ZmYpID4gMSkgeworCQlwcmludGsoS0VSTl9XQVJOSU5HICJpMm86IEkyTyBjb250cm9sbGVyIGZvdW5kIGJ1dCBkb2VzIG5vdCAiCisJCSAgICAgICAic3VwcG9ydCBJMk8gMS41IChza2lwcGluZykuXG4iKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJaWYgKChyYyA9IHBjaV9lbmFibGVfZGV2aWNlKHBkZXYpKSkgeworCQlwcmludGsoS0VSTl9XQVJOSU5HICJpMm86IEkyTyBjb250cm9sbGVyIGZvdW5kIGJ1dCBjb3VsZCBub3QgYmUiCisJCSAgICAgICAiIGVuYWJsZWQuXG4iKTsKKwkJcmV0dXJuIHJjOworCX0KKworCXByaW50ayhLRVJOX0lORk8gImkybzogSTJPIGNvbnRyb2xsZXIgZm91bmQgb24gYnVzICVkIGF0ICVkLlxuIiwKKwkgICAgICAgcGRldi0+YnVzLT5udW1iZXIsIHBkZXYtPmRldmZuKTsKKworCWlmIChwY2lfc2V0X2RtYV9tYXNrKHBkZXYsIERNQV8zMkJJVF9NQVNLKSkgeworCQlwcmludGsoS0VSTl9XQVJOSU5HICJpMm86IEkyTyBjb250cm9sbGVyIG9uIGJ1cyAlZCBhdCAlZDogTm8gIgorCQkgICAgICAgInN1aXRhYmxlIERNQSBhdmFpbGFibGUhXG4iLCBwZGV2LT5idXMtPm51bWJlciwKKwkJICAgICAgIHBkZXYtPmRldmZuKTsKKwkJcmMgPSAtRU5PREVWOworCQlnb3RvIGRpc2FibGU7CisJfQorCisJcGNpX3NldF9tYXN0ZXIocGRldik7CisKKwljID0gaTJvX2lvcF9hbGxvY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