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AlZC4lZCIsCQkJCVwKKyAgICAgICAgICAgIG1ham9yLCBtaW5vciwJCQkJCQkJXAorICAgICAgICAgICAgRkRfUFJPSkVDVF9WRVJTSU9OX01BSk9SLCBGRF9QUk9KRUNUX1ZFUlNJT05fTUlOT1IpOwkJXAorICAgICAgICByZXR1cm4gRUlOVkFMOwkJCQkJCQkJXAorICAgIH0JCQkJCQkJCQkJXAorICAgIGlmIChleHRlbnNpb25fbG9hZGVkKSB7CQkJCQkJCQlcCisgICAgICAgIFRSQUNFX0VSUk9SKCJFeHRlbnNpb24gKCIgX25hbWUgIikgY2Fubm90IGJlIGxvYWRlZCB0d2ljZSEiKTsJCVwKKyAgICAgICAgcmV0dXJuIEVOT1RTVVA7CQkJCQkJCQlcCisgICAgfQkJCQkJCQkJCQlcCisgICAgZXh0ZW5zaW9uX2xvYWRlZCsrOwkJCQkJCQkJXAorICAgIHJldHVybiAoX3J1bGVzZnVuY3Rpb24pKGNvbmZmaWxlKTsJCQkJCQkJXAorfQkJCQkJCQlcCitpbnQgZmRfZXh0X3BhcnNlbG9jYWxydWxlcyhjaGFyICpjb25mZmlsZSkgewkJCQkJXAorICAgIHJldHVybiAoX3J1bGVzZnVuY3Rpb24pKGNvbmZmaWxlKTsJCQkJCVwKK30JCQkJCQkJCQkKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9CisjZW5kaWYKKworI2VuZGlmIC8qIF9FWFRFTlNJT05fSCAqLworCisjaWYgMAorc3RhdGljIGludCBkaWN0X2VudHJ5KGNoYXIgKiBjb25mZmlsZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCit7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIGludCB4ID0gKF9kaWN0ZnVuYykoY29uZmZpbGUpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIGlmICh4ICE9IDApIHJldHVybiB4OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICByZXR1cm4gKF9ydWxlc2Z1bmN0aW9uKShjb25mZmlsZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9IAorI2VuZGlmCmRpZmYgLS1naXQgYS9pbmNsdWRlL2ZyZWVEaWFtZXRlci9mcmVlRGlhbWV0ZXItaG9zdC5oLmluIGIvaW5jbHVkZS9mcmVlRGlhbWV0ZXIvZnJlZURpYW1ldGVyLWhvc3QuaC5pbgpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xNTM5YjRhCi0tLSAvZGV2L251bGwKKysrIGIvaW5jbHVkZS9mcmVlRGlhbWV0ZXIvZnJlZURpYW1ldGVyLWhvc3QuaC5pbgpAQCAtMCwwICsxLDEwNiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBTb2Z0d2FyZSBMaWNlbnNlIEFncmVlbWVudCAoQlNEIExpY2Vuc2UpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiBBdXRob3I6IFNlYmFzdGllbiBEZWN1Z2lzIDxzZGVjdWdpc0BmcmVlZGlhbWV0ZXIubmV0PgkJCQkJCQkgKgorKgkJCQkJCQkJCQkJCQkgKgorKiBDb3B5cmlnaHQgKGMpIDIwMTUsIFdJREUgUHJvamVjdCBhbmQgTklDVAkJCQkJCQkJICoKKyogQWxsIHJpZ2h0cyByZXNlcnZlZC4JCQkJCQkJCQkJCSAqCisqIAkJCQkJCQkJCQkJCQkgKgorKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIG9mIHRoaXMgc29mdHdhcmUgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dCBtb2RpZmljYXRpb24sIGFyZSAgK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hlIGNvbnRlbnQgdG8gZGlzcGxheSB3aGF0IHlvdSBuZWVkICovCisjZGVmaW5lIEdOVVRMU19UUkFDRSggX19jYWxsX18pIHsJCQkJCVwKKwlUUkFDRV9DQUxMKCJDaGVjazogJXMiLCAjX19jYWxsX18gKTsJCQkJXAorCShfX2NhbGxfXyk7CQkJCQkJCVwKK30KKworCisjaWZuZGVmIEVYQ0xVREVfREVQUkVDQVRFRAorLyogTWFjcm8gZm9yIHRyYW5zaXRpb24sIHJlcGxhY2Ugd2l0aCBDSEVDS19HTlVUTFNfR0VOICovCisjZGVmaW5lIENIRUNLX0dOVVRMU19ETyggX19jYWxsX18sIF9fZmFsbGJhY2tfXyApCVwKKwlDSEVDS19HTlVUTFNfR0VOKCBGRF9MT0dfRVJST1IsIF9fY2FsbF9fLCBfX2ZhbGxiYWNrX18gICkKKworI2VuZGlmIC8qIEVYQ0xVREVfREVQUkVDQVRFRCAqLworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgIElOSVRJQUxJWkFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworCisvKiBJbml0aWFsaXplIHRoZSBsaWJmZGNvcmUgaW50ZXJuYWxzLiBUaGlzIGFsc28gaW5pdGlhbGl6ZXMgbGliZmRwcm90byAqLworaW50IGZkX2NvcmVfaW5pdGlhbGl6ZSh2b2lkKTsKKworLyogQSBzdHJpbmcgZGVzY3JpYmluZyB0aGUgdmVyc2lvbiBvZiB0aGUgbGlicmFyeSAqLworZXh0ZXJuIGNvbnN0IGNoYXIgZmRfY29yZV92ZXJzaW9uW107CisKKy8qIFBhcnNlIHRoZSBmcmVlRGlhbWV0ZXIuY29uZiBjb25maWd1cmF0aW9uIGZpbGUsIGxvYWQgdGhlIGV4dGVuc2lvbnMgKi8KK2ludCBmZF9jb3JlX3BhcnNlY29uZihjb25zdCBjaGFyICogY29uZmZpbGUpOworCisvKiBTdGFydCB0aGUgc2VydmVyICYgY2xpZW50IHRocmVhZHMgKi8KK2ludCBmZF9jb3JlX3N0YXJ0KHZvaWQpOworCisvKiBCbG9jayB1bnRpbCB0aGUgZnJhbWV3b3JrIGhhcyBjb21wbGV0ZWQgaXRzIGluaXRpYWxpemF0aW9uIC0tIHVzZWZ1bCBmb3IgZXh0ZW5zaW9ucyAqLworaW50IGZkX2NvcmVfd2FpdHN0YXJ0Y29tcGxldGUodm9pZCk7CisKKy8qIEluaXRpYWxpemUgc2h1dGRvd24gb2YgdGhlIGZyYW1ld29yayAqLworaW50IGZkX2NvcmVfc2h1dGRvd24odm9pZCk7CisKKy8qIFdhaXQgZm9yIHRoZSBzaHV0ZG93biB0byBiZSBjb21wbGV0ZSAtLSB0aGlzIHNob3VsZCBhbHdheXMgYmUgY2FsbGVkIGFmdGVyIGZkX2NvcmVfc2h1dGRvd24gKi8KK2ludCBmZF9jb3JlX3dhaXRfc2h1dGRvd25fY29tcGxldGUodm9pZCk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIENPTkZJRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBTdHJ1Y3R1cmUgdG8gaG9sZCB0aGUgY29uZmlndXJhdGlvbiBvZiB0aGUgZnJlZURpYW1ldGVyIGRhZW1vbiAqLworI2RlZmluZQlFWUVDX0NPTkZJRwkweEMwMTFGMTYKK3N0cnVjdCBmZF9jb25maWcgeworCWludAkJIGNuZl9leWVjOwkvKiBFeWUgY2F0Y2hlcjogRVlFQ19DT05GSUcgKi8KKwkKKwlj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GNhbGxlZCBvbmNlIHRoZSBoYW5kc2hha2UgaXMgY29tcGxldGVkLiBUaGlzIG5ldyBjYWxsYmFjayByZWNlaXZlcyB0aGUgaW5mb3JtYXRpb24KKyAqIHN0cnVjdHVyZSBhcyBwYXJhbWV0ZXIgKHdpdGggcGlyX2NlcnRfbGlzdCBzZXQpIGFuZCByZXR1cm5zIDAgaWYgdGhlIGNyZWRlbnRpYWxzIGFyZSBjb3JyZWN0LAorICogb3IgYW4gZXJyb3IgY29kZSBvdGhlcndpc2UuIElmIHRoZSBlcnJvciBjb2RlIGlzIHJlY2VpdmVkLCB0aGUgY29ubmVjdGlvbiBpcyBjbG9zZWQgYW5kIHRoZSAKKyAqIHBlZXIgaXMgZGVzdHJveWVkLgorICogTm90ZSB0aGF0IGZyZWVEaWFtZXRlciBhbHJlYWR5IGFjaGlldmVzIHNvbWUgdXN1YWwgY2hlY2tzLiBUaGUgY2FsbGJhY2sgbWF5IGJlIHVzZWQgdG8gZW5mb3JjZQorICogYWRkaXRpb25hbCByZXN0cmljdGlvbnMuCisgKgorICogUkVUVVJOIFZBTFVFOgorICogIDAgICAgICAJOiBUaGUgYXV0aG9yaXphdGlvbiBkZWNpc2lvbiBoYXMgYmVlbiB3cml0dGVuIGluIHRoZSBsb2NhdGlvbiBwb2ludGVkIGJ5IGF1dGguCisgKiAgITAgCQk6IEFuIGVycm9yIG9jY3VycmVkLgorICovCisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qCisgKiBGVU5DVElPTjoJZmRfbXNnX3NlbmQsIGZkX21zZ19zZW5kX3RpbWVvdXQgIAorICoKKyAqIFBBUkFNRVRFUlM6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GVuZCBvZiB0aGUgc2lkIGlmIHByb3ZpZGVkKSAqLworaW50IGZkX21zZ19uZXdfc2Vzc2lvbiggc3RydWN0IG1zZyAqIG1zZywgb3MwX3Qgb3B0LCBzaXplX3Qgb3B0bGVuICk7CisKKworLyogUGFyc2UgYSBtZXNzYWdlIGFnYWluc3Qgb3VyIGRpY3Rpb25hcnksIAorCXJldHVybiAwIGluIGNhc2Ugb2Ygc3VjY2Vzcy4KKwlsb2cgcGFyc2luZyBlcnJvciAmIHJldHVybiBlcnJvciBjb2RlIGluIGNhc2Ugb2YgZmFpbHVyZSBpbiBwYXJzaW5nLiAKKwlJbiBhZGRpdGlvbiwgaWYgdGhlIGVycm9yIGNvZGUgaXMgRUJBRE1TRyAodGhlIG1lc3NhZ2UgZG9lcyBub3QgZm9sbG93IG91ciBkaWN0aW9uYXJ5KSAKKwkJaWYgKm1zZyB3YXMgYSByZXF1ZXN0LCAqbXNnIGlzIE5VTEwgYW5kICplcnJvciBjb250YWlucyB0aGUgZXJyb3IgbWVzc2FnZSByZWFkeSB0byBzZW5kIGJhY2sgb24gcmV0dXJuCisJCWlmICptc2cgd2FzIGFuIGFuc3dlciwgKm1zZyBpcyB1bnRvdWNoZWQgYW5kICplcnJvcj09Km1zZyBpZiAqbXNnIHdhcyBhbiBlcnJvciBtZXNzYWdlLCAqZXJyb3IgaXMgbnVsbCBvdGhlcndpc2UgKi8KK2ludCBmZF9tc2dfcGFyc2Vfb3JfZXJyb3IoIHN0cnVjdCBtc2cgKiogbXNnLCBzdHJ1Y3QgbXNnICoqZXJyb3IgKTsKKworCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgRElTUEFUQ0ggICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCis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Gl0IG1heSBiZSBjYWxsZWQgYnkgc2V2ZXJhbCB0aHJlYWRzIGF0IHRoZSBzYW1lIHRpbWUgCisgKiAgKGZvciBkaWZmZXJlbnQgbWVzc2FnZXMpCisgKgorICogUkVUVVJOIFZBTFVFOgorICogIDAgICAgICAJOiBPcGVyYXRpb24gY29tcGxldGUuCisgKiAgITAgCQk6IEFuIGVycm9yIG9jY3VycmVkLgorICovCisKKy8qCisgKiBGVU5DVElPTjoJZmRfcnRfb3V0X3VucmVnaXN0ZXIKKyAqCisgKiBQQVJBTUVURVJTOgorICogIGhhbmRsZXIgICAgIDogVGhlIGhhbmRsZXIgb2YgdGhlIGNhbGxiYWNrIHRoYXQgbXVzdCBiZSB1bnJlZ2lzdGVyZWQuCisgKiAgY2JkYXRhCTogV2lsbCByZWNlaXZlIHRoZSBkYXRhIHJlZ2lzdGVyZWQgd2l0aCB0aGUgY2FsbGJhY2ssIHRoYXQgY2FuIGJlIGZyZWVkIGlmIG5lZWRlZC4KKyAqCisgKiBERVNDUklQVElPTjogCisgKiAgIFJlbW92ZXMgYSBjYWxsYmFjayBmcm9tIHRoZSBsaXN0IG9mIHJlZ2lzdGVyZWQgY2FsbGJhY2tzLgorICoKKyAqIFJFVFVSTiBWQUxVRToKKyAqICAwICAgICAgCTogVGhlIGNhbGxiYWNrIGlzIHVucmVnaXN0ZXJlZC4KKyAqICBFSU5WQUwgCTogQSBwYXJhbWV0ZXIgaXMgaW52YWxpZC4KKyAqLworaW50IGZkX3J0X291dF91bnJlZ2lzdGVyICggc3RydWN0IGZkX3J0X291dF9oZGwgKiBoYW5kbGVyLCB2b2lkICoqIGNiZGF0YSApOworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgIEVWRU5UUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09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sIGludCAqIGNvbW1vbl9mb3VuZCk7CitpbnQgZmRfYXBwX2VtcHR5KHN0cnVjdCBmZF9saXN0ICogbGlzdCk7CisKKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBNT05JVE9SSU5HICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qIFRoZXNlIGZ1bmN0aW9ucyBhbGxvdyBhbiBleHRlbnNpb24gdG8gY29sbGVjdCBzdGF0ZSBpbmZvcm1hdGlvbiBhYm91dCB0aGUKKyAqIGZyYW1ld29yaywgYXMgd2VsbCBhcyBiZWluZyBob29rZWQgYXQgc29tZSBrZXkgY2hlY2twb2ludHMgaW4gdGhlIHByb2Nlc3NpbmcKKyAqIGZvciBsb2dnaW5nIG9yIHN0YXRpc3RpY3MgcHVycG9zZS4KKyAqLworIAorCisvKiBDQUxMQkFDSzogCWZkX2hvb2tfY2IKKyAqCisgKiBQQVJBTUVURVJTOgorICogIHR5cGUJOiBUaGUgdHlwZSBvZiBob29rIHRoYXQgdHJpZ2dlcmVkIHRoaXMgY2FsbCwgaW4gY2FzZSBzYW1lIGNiIGlzIHJlZ2lzdGVyZWQgZm9yIHNldmVyYWwgaG9va3MuCisgKiAgbXNnIAk6IElmIHJlbGV2YW50LCB0aGUgcG9pbnRlciB0byB0aGUgbWVzc2FnZSB0cmlnZ2VyaW5nIHRoZSBjYWxsLiBOVUxMIG90aGVyd2lzZS4KKyAqICBwZWVyICAgICAgICA6IElmIHJlbGV2YW50LCB0aGUgcG9pbnRlciB0byB0aGUgcGVlciBhc3NvY2lhdGVkIHdpdGggdGhlIGNhbGwuIE5VTEwgb3RoZXJ3aXNlLgorICogIG90aGVyCTogRm9yIHNvbWUgY2FsbGJhY2tzLCB0aGUgcmV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09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBFT0YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNpZmRlZiBfX2NwbHVzcGx1cworfQorI2VuZGlmCisKKyNlbmRpZiAvKiBfTElCRkRDT1JFX0ggKi8KZGlmZiAtLWdpdCBhL2luY2x1ZGUvZnJlZURpYW1ldGVyL2xpYmZkcHJvdG8uaCBiL2luY2x1ZGUvZnJlZURpYW1ldGVyL2xpYmZkcHJvdG8uaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lMGQwNzQ0Ci0tLSAvZGV2L251bGwKKysrIGIvaW5jbHVkZS9mcmVlRGlhbWV0ZXIvbGliZmRwcm90by5oCkBAIC0wLDAgKzEsMzI1NCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiBTb2Z0d2FyZSBMaWNlbnNlIEFncmVlbWVudCAoQlNEIExpY2Vuc2UpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiBBdXRob3I6IFNlYmFzdGllbiBEZWN1Z2lzIDxzZGVjdWdpc0BmcmVlZGlhbWV0ZXIubmV0PgkJCQkJCQkgKgorKgkJCQkJCQkJCQkJCQkgKgorKiBDb3B5cmlnaHQgKGMpIDIwMTUsIFdJREUgUHJvamVjdCBhbmQgTklDVAkJCQkJCQkJICoKKyogQWxsIHJpZ2h0cyByZXNlcnZlZC4JCQkJCQkJCQkJCSAqCisqIAkJCQkJCQkJCQkJCQkgKgorKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIG9mIHRoaXMgc29mdHdhcmUgaW4gc291cm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c2libGUgKi8KKyNpZiBkZWZpbmVkKF9fR05VQ19fKQorIyBkZWZpbmUgR0NDX0RJQUdfRE9fUFJBR01BKHgpIF9QcmFnbWEgKCN4KQorIyBkZWZpbmUgR0NDX0RJQUdfUFJBR01BKHgpIEdDQ19ESUFHX0RPX1BSQUdNQShHQ0MgZGlhZ25vc3RpYyB4KQorIyBpZiAoKF9fR05VQ19fICogMTAwKSArIF9fR05VQ19NSU5PUl9fKSA+PSA0MDYJCS8qIDQuNi54ICovCisjICBkZWZpbmUgR0NDX0RJQUdfT0ZGKHgpIEdDQ19ESUFHX1BSQUdNQShwdXNoKSBcCisgICAgIEdDQ19ESUFHX1BSQUdNQShpZ25vcmVkIHgpCisjICBkZWZpbmUgR0NDX0RJQUdfT04oeCkgR0NDX0RJQUdfUFJBR01BKHBvcCkKKyMgZWxzZQkJCQkJCQkvKiBvbGRlciAqLworIyAgZGVmaW5lIEdDQ19ESUFHX09GRih4KSBHQ0NfRElBR19QUkFHTUEoaWdub3JlZCB4KQorIyAgZGVmaW5lIEdDQ19ESUFHX09OKHgpICBHQ0NfRElBR19QUkFHTUEod2FybmluZyB4KQorIyBlbmRpZgorI2Vsc2UKKyMgZGVmaW5lIEdDQ19ESUFHX09GRih4KQorIyBkZWZpbmUgR0NDX0RJQUdfT04oeCkKKyNlbmRpZgorCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgQ09OU1RBTlRTICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKyNkZWZpbmUgRElBTUVURVJfUE9SVAkJMzg2OAorI2RlZmluZSBESUFNRVRFUl9TRUNVUkVfUE9SVAk1ODY4CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIElOSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBUaGlzIGZ1bmN0aW9uIG11c3QgYmUgY2FsbGVkIGZpcnN0LCBiZWZvcmUgYW55IGNhbGwgdG8gYW5vdGhlciBsaWJyYXJ5IGZ1bmN0aW9uICovCitpbnQgZmRfbGlicHJvdG9faW5pdCh2b2lkKTsgLyogbm90ZSBpZiB5b3UgYXJlIHVzaW5nIGxpYmZkY29yZSwgaXQgaGFuZGxlcyB0aGlzIGFscmVhZHkgKi8KKworLyogQ2FsbCB0aGlzIG9uZSB3aGVuIHRoZSBhcHBsaWNhdGlvbiB0ZXJtaW5hdGVzLCB0byBkZXN0cm95IGludGVybmFsIHRocmVhZHMgKi8KK3ZvaWQgZmRfbGlicHJvdG9fZmluaSh2b2lkKTsKKworLyogUmV0cmlldmUgdGhlIHZlcnNpb24gb2YgdGhlIGJpbmFyeSAqLworZXh0ZXJuIGNvbnN0IGNoYXIgZmRfbGlicHJvdG9fdmVyc2lvbltdOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgREVCVUcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKworLyoKKyAqIEZVTkNUSU9OOglmZF9sb2cKKyAqCisgKiBQQVJBTUVURVJTOgorICogIGxvZ2xldmVsCTogSW50ZWdlciwgaG93IGltcG9ydGFudCB0aGUgbWVzc2FnZSBpcy4gVmFsaWQgdmFsdWVzIGFyZSBtYWNyb3MgRkRfTE9HXyoKKyAqICBmb3JtYXQgCTogU2FtZSBm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gJWQgLS0gIiwgZmRfYnJlYWtoZXJlKCkpOworaW50IGZkX2JyZWFraGVyZSh2b2lkKTsKKworLyogSGVscGVyIGZvciB0cmFjaW5nIHRoZSBDSEVDS18qIG1hY3JvcyBiZWxvdyAtLSB2ZXJ5IHZlcnkgdmVyYm9zZSBjb2RlIGV4ZWN1dGlvbiEgKi8KKyNkZWZpbmUgVFJBQ0VfQ0FMTCggc3RyLi4uICkgCVwKKwkgCUxPR19BKCBzdHIgKQorCisvKiBGb3IgZGV2ZWxvcG1lbnQgb25seSwgdG8ga2VlcCB0cmFjayBvZiBUT0RPIGxvY2F0aW9ucyBpbiB0aGUgY29kZSAqLworI2lmbmRlZiBFUlJPUlNfT05fVE9ETworIyBkZWZpbmUgVE9ETyggX21zZywgX2FyZ3MuLi4gKSBcCisJCUxPR19GKCAiVE9ETzogIiBfbXNnICwgIyNfYXJncyk7CisjZWxzZSAvKiBFUlJPUlNfT05fVE9ETyAqLworIyBkZWZpbmUgVE9ETyggX21zZywgX2FyZ3MuLi4gKSBcCisJCSJUT0RPIiA9IF9tc2cgIyMgX2FyZ3M7IC8qIGp1c3QgYSBzdHVwaWQgY29tcGlsYXRpb24gZXJyb3IgdG8gc3BvdCB0aGUgdG9kbyAqLworI2VuZGlmIC8qIEVSUk9SU19PTl9UT0RPICovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICBFUlJPUiBDSEVDS0lORyBNQUNSTyAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBNYWNyb3MgdG8gY2hlY2sgYSByZXR1cm4gdmFsdWUgYW5kIGJyYW5jaCBvdXQgaW4gY2FzZSBvZiBlcnJvci4KKyAqIFRoZXNlIG1hY3JvIGFkZGl0aW9uYWxseSBwcm92aWRlIHRo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ICAgICBUUkFDRV9DQUxMKCJDaGVjazogJXMiLCAjX19jYWxsX18gKTsJCQkJCQkgICAgICAgXAorCSAgICAgICBfX3B0cl9fID0gKHZvaWQgKikoX19jYWxsX18pOwkJCQkJCQkgICAgICAgXAorCSAgICAgICBpZiAoX19wdHJfXyA9PSBOVUxMKSB7CQkJCQkJCQkgICAgICAgXAorCQkgICAgICAgaW50IF9fcmV0X18gPSBlcnJubzsJCQkJCQkJICAgICAgIFwKKwkJICAgICAgIExPRyhmYWlsbGV2ZWwsICJFUlJPUjogaW4gJyVzJyA6XHQlcyIsICAjX19jYWxsX18gLCBzdHJlcnJvcihfX3JldF9fKSk7ICAgICAgICAgXAorCQkgICAgICAgX19mYWxsYmFja19fOwkJCQkJCQkJICAgICAgIFwKKwkgICAgICAgfQkJCQkJCQkJCQkgICAgICAgXAorfQorCisvKiBDaGVjayBwYXJhbWV0ZXJzIGF0IGZ1bmN0aW9uIGVudHJ5LCBleGVjdXRlIGZhbGxiYWNrIG9uIGVycm9yICovCisjZGVmaW5lIENIRUNLX1BBUkFNU19HRU4oIGZhaWxsZXZlbCwgX19ib29sX18sIF9fZmFsbGJhY2tfXyApIHsJCQkJCSAgICAgICBcCisJICAgICAgIFRSQUNFX0NBTEwoIkNoZWNrOiAlcyIsICNfX2Jvb2xfXyApOwkJCQkJCSAgICAgICBcCisJICAgICAgIGlmICggISAoX19ib29sX18pICkgewkJCQkJCQkJICAgICAgIFwKKwkJICAgICAgIGludCBfX3JldF9fID0gRUlOVkFMOwkJCQkJCQkgICAgICAgXAorCQkgICAgICAgTE9HKGZhaWxsZXZlbCwgIkVSUk9SOiBpbnZhbGlkIHBhcmFtZXRlciAnJXMnIiwgICNfX2Jvb2xfXyApOyAgCSAgICAgICAJICAgICAgIFwKKwkJICAgICAgIF9fZmFsbGJhY2tfXzsJCQkJCQkJCSAgICAgICBcCisJICAgICAgIH0JCQkJCQkJCQkJICAgICAgIFwKK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICBDT01QQVRJQklMSVRZIE1BQ1JPUywgVE8gQkUgUkVNT1ZFRAkJICAgICAgKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qIFJlZGVmaW5lIHRoZSBvbGQgbWFjcm9zIGZvciB0cmFuc2l0aW9uIG9mIHRoZSBjb2RlICovCisjaWZuZGVmIEVYQ0xVREVfREVQUkVDQVRFRAorCisjZGVmaW5lIE1BUktfREVQUkVDQVRFRAkvKiBfX2F0dHJpYnV0ZV9fICgoZGVwcmVjYXRlZCkpICovCisKK2VudW0gb2xkX2xldmVscyB7CisJTk9ORSA9IDAsCisJSU5GTyA9IDEsCisJRlVMTCA9IDIsCisJQU5OT1lJTkcgPSA0LAorCUZDVFMgPSA2LAorCUNBTEwgPSA5Cit9IE1BUktfREVQUkVDQVRFRDsKKworc3RhdGljIF9faW5saW5lX18gaW50IG9sZF9UUkFDRV9CT09MKCBlbnVtIG9sZF9sZXZlbHMgbGV2ZWwsIGNvbnN0IGNoYXIgKiBmaWxlLCBjb25zdCBjaGFyICogZnVuYyApIE1BUktfREVQUkVDQVRFRAoreworCWlmICgoZmRfZGVidWdfb25lX2Z1bmN0aW9uICYmICFzdHJjbXAoZmRfZGVidWdfb25lX2Z1bmN0aW9uLCBmdW5jKSkKKwkJfHwgKGZkX2RlYnVnX29uZV9maWxlICYmICFzdHJjbXAoZmRfZGVidWdfb25lX2ZpbGUsIGZpbGUpICkpCisJCXJldHVybiAyOyAvKiBMZXZlbCBvdmVycmlkZSAqLworCWlmICgoaW50KWxldmVsIDw9IGZkX2dfZGVidWdfbHZsKQorCQlyZXR1cm4gMTsgLyogTm9ybWFsIGxldmVsICovCisJcmV0dXJuIDA7ICAvKiBObyB0cmFjZSAqLworfQorI2RlZmluZSBUUkFDRV9CT09MKGxldmVsKSAgb2xkX1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KCAoX19jYWxsX18pLCAwLCAsIF9fZmFsbGJhY2tfXyApCisKKyMgZGVmaW5lIENIRUNLX1BPU0lYKCBfX2NhbGxfXyApCVwKKwkJQ0hFQ0tfUE9TSVhfRE8oIChfX2NhbGxfXyksIHJldHVybiBfX3JldF9fICkKKwkJCisjIGRlZmluZSBDSEVDS19NQUxMT0NfRE8oIF9fY2FsbF9fLCBfX2ZhbGxiYWNrX18gKSB7IAkJCQkgICAJCSAgICAgICBcCisJICAgICAgIHZvaWQgKiAgX19wdHJfXzsgCQkJCQkJCQkgICAgICAgXAorCSAgICAgICBUUkFDRV9DQUxMKCJDaGVjazogJXMiLCAjX19jYWxsX18gKTsJCQkJCQkgICAgICAgXAorCSAgICAgICBfX3B0cl9fID0gKHZvaWQgKikoX19jYWxsX18pOwkJCQkJCQkgICAgICAgXAorCSAgICAgICBpZiAoX19wdHJfXyA9PSBOVUxMKSB7CQkJCQkJCQkgICAgICAgXAorCQkgICAgICAgaW50IF9fcmV0X18gPSBlcnJubzsJCQkJCQkJICAgICAgIFwKKwkJICAgICAgVFJBQ0VfRVJST1IoIkVSUk9SOiBpbiAnJXMnIDpcdCVzIiwgICNfX2NhbGxfXyAsIHN0cmVycm9yKF9fcmV0X18pKTsgICAgICAgICAgICAgXAorCQkgICAgICAgX19mYWxsYmFja19fOwkJCQkJCQkJICAgICAgIFwKKwkgICAgICAgfQkJCQkJCQkJCQkgICAgICAgXAorfQorCisjIGRlZmluZSBDSEVDS19NQUxMT0MoIF9fY2FsbF9fICkJXAorCQlDSEVDS19NQUxMT0NfRE8oIChfX2NhbGxfXyksIHJldHVybiBfX3JldF9fICkKKwkKKyMgZGVmaW5lIENIRUNLX1BBUkFNU19ETyggX19ib29sX18sIF9fZmFsbGJhY2tfXyApIHsJCQkJCSAgICAgICAJICAgICAgIFwKKwkgICAgICAgVFJBQ0VfQ0FMTCgiQ2hlY2s6ICVzIiwgI19fYm9vbF9fICk7CQkJCQkJICAgICAgIFwKKwkgICAgICAgaWYgKCAhIChfX2Jvb2xfXykgKSB7CQkJCQkJCQkgICAgICAgXAorCQkgICAgICAgaW50IF9fcmV0X18gPSBFSU5WQUw7CQkJCQkJCSAgICAgICBcCisJCSAgICAgICBUUkFDRV9FUlJPUigiRVJST1I6IEludmFsaWQgcGFyYW1ldGVyICclcycsICVkIiwgICNfX2Jvb2xfXywgX19yZXRfXyApOyAgICAgICAgIFwKKwkJICAgICAgIF9fZmFsbGJhY2tfXzsJCQkJCQkJCSAgICAgICBcCisJICAgICAgIH0JCQkJCQkJCQkJICAgICAgIFwKK30KKworIyBkZWZpbmUgQ0hFQ0tfUEFSQU1TKCBfX2Jvb2xfXyApCVwKKwkJQ0hFQ0tfUEFSQU1TX0RPKCAoX19ib29sX18pLCByZXR1cm4gX19yZXRfXyApCisKKyMgZGVmaW5lIENIRUNLX0ZDVF9ETwlDSEVDS19QT1NJWF9ETworIyBkZWZpbmUgQ0hFQ0tfRkNUCUNIRUNLX1BPU0lYCisKKyNlbmRpZiAvKiBFWENMVURFX0RFUFJFQ0FURUQgKi8KKwkgICAgICAgCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qCU9wdGltaXplZCBjb2RlOiByZW1vdmUgYWxsIGRlYnVnZ2luZyBjb2RlCSAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisjaWZkZWYgU1RSSVBfREVCVUdfQ09ERQorI3VuZGVmIExPR19ECisjdW5kZWYgTE9HX04KKyN1bmRlZiBMT0dfRQorI3VuZGVmIExPR19GCisjdW5kZWYgTE9HX0JVRkZFUgorCisjZGVmaW5lIExPR19EKGZvcm1hdCxhcmdzLi4uICkgLyogbm9vcCAqLworI2RlZmluZSBMT0dfTihmb3JtYXQsYXJncy4uLikgZmRfbG9nKEZEX0xPR19OT1RJQ0UsIGZvcm1hdCwgIyMgYXJncykKK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ZGVmIEhBVkVfU1RSTkRVUAorY2hhciAqIHN0cm5kdXAgKGNoYXIgKnN0ciwgc2l6ZV90IGxlbik7CisjZW5kaWYgLyogSEFWRV9TVFJORFVQICovCisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgQklOQVJZIFNUUklOR1MgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBDb21wdXRlIGEgaGFzaCB2YWx1ZSBvZiBhIGJpbmFyeSBzdHJpbmcuIAorVGhlIGhhc2ggbXVzdCByZW1haW4gbG9jYWwgdG8gdGhpcyBtYWNoaW5lLCB0aGVyZSBpcyBubyBndWFyYW50ZWUgdGhhdCBzYW1lIGlucHV0Cit3aWxsIGdpdmUgc2FtZSBvdXRwdXQgb24gYSBkaWZmZXJlbnQgc3lzdGVtIChlbmRpYW5uZXNzKSAqLwordWludDMyX3QgZmRfb3NfaGFzaCAoIHVpbnQ4X3QgKiBzdHJpbmcsIHNpemVfdCBsZW4gKTsKKworLyogVGhpcyB0eXBlIHVzZWQgZm9yIGJpbmFyeSBzdHJpbmdzIHRoYXQgY29udGFpbiBubyBcMCBleGNlcHQgYXMgdGhlaXIgbGFzdCBjaGFyYWN0ZXIuIAorSXQgbWVhbnMgc29tZSBzdHJpbmcgb3BlcmF0aW9ucyBjYW4gYmUgdXNlZCBvbiBpdC4gKi8KK3R5cGVkZWYgdWludDhfdCAqIG9zMF90OworCisvKiBTYW1lIGFzIHN0cmR1cCBidXQgZm9yIG9zMF90IHN0cmluZ3MgKi8KK29zMF90IG9zMGR1cF9pbnQob3MwX3Qgcywgc2l6ZV90IGwpOworI2RlZmluZSBvczBkdXAoIF9zLCBfbCkgICh2b2lkICopb3MwZHVwX2ludCgob3MwX3QpKF9zKSwgX2wpCis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0cmFuc3BvcnQgaXMgMCAoZGVmYXVsdCkgb3IgSVBQUk9UT18qIG9uIHJldHVybi4KKyAgKnByb3RvIGlzIDAgKGRlZmF1bHQpIG9yICdkJyAoZGlhbWV0ZXIpLCAncicgKHJhZGl1cyksIG9yICd0JyAodGFjYWNzKykgb24gcmV0dXJuLgorICAqLworaW50IGZkX29zX3BhcnNlX0RpYW1ldGVyVVJJKHVpbnQ4X3QgKiB1cmksIHNpemVfdCB1cmlzeiwgRGlhbUlkX3QgKiBkaWFtaWQsIHNpemVfdCAqIGRpYW1pZGxlbiwgaW50ICogc2VjdXJlLCB1aW50MTZfdCAqIHBvcnQsIGludCAqIHRyYW5zcG9ydCwgY2hhciAqcHJvdG8pOworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgVEhSRUFEUyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qIFRlcm1pbmF0ZSBhIHRocmVhZCAqLworc3RhdGljIF9faW5saW5lX18gaW50IGZkX3Rocl90ZXJtKHB0aHJlYWRfdCAqIHRoKQoreworCXZvaWQgKiB0aF9yZXQgPSBOVUxMOworCQorCUNIRUNLX1BBUkFNUyh0aCk7CisJCisJLyogVGVzdCBpZiBpdCB3YXMgYWxyZWFkeSB0ZXJtaW5hdGVkICovCisJaWYgKCp0aCA9PSAocHRocmVhZF90KU5VTEwpCisJCXJldHVybiAwOworCQorCS8qIENhbmNlbCB0aGUgdGhyZWFkIGlmIGl0IGlzIHN0aWxsIHJ1bm5pbmcgLSBpZ25vcmUgZXJyb3IgaWYgaXQgd2FzIGFscmVhZHkgdGVybWluYXRlZCAqLworCSh2b2lkKSBwdGhyZWFkX2NhbmNlbCgqdGgpOworCQorCS8qIFRoZW4gam9pbiB0aG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twdHIpCit7CisJaWYgKHNvY2twdHIgJiYgKCooaW50ICopc29ja3B0ciA+IDApKSB7CisJCUNIRUNLX1NZU19ETyggY2xvc2UoKihpbnQgKilzb2NrcHRyKSwgLyogaWdub3JlICovICk7CisJCSooaW50ICopc29ja3B0ciA9IC0xOworCX0KK30KKworCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgTElTVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKKy8qIFRoZSBmb2xsb3dpbmcgc3RydWN0dXJlIHJlcHJlc2VudHMgYSBjaGFpbmVkIGxpc3QgZWxlbWVudCAgKi8KK3N0cnVjdCBmZF9saXN0IHsKKwlzdHJ1Y3QgZmRfbGlzdCAJKm5leHQ7IC8qIG5leHQgZWxlbWVudCBpbiB0aGUgbGlzdCAqLworCXN0cnVjdCBmZF9saXN0IAkqcHJldjsgLyogcHJldmlvdXMgZWxlbWVudCBpbiB0aGUgbGlzdCAqLworCXN0cnVjdCBmZF9saXN0IAkqaGVhZDsgLyogaGVhZCBvZiB0aGUgbGlzdCAqLworCXZvaWQJCSpvOyAgICAvKiBhZGRpdGlvbmFsIHBvaW50ZXIsIHVzZWQgZm9yIGFueSBwdXJwb3NlIChleDogc3RhcnQgb2YgdGhlIHBhcmVudCBvYmplY3QpICovCit9OworCisvKiBJbml0aWFsaXplIGEgbGlzdCBlbGVtZW50ICovCisjZGVmaW5lIEZEX0xJU1RfSU5JVElBTElaRVIoIF9saXN0X25hbWUgKSBcCisJeyAubmV4dCA9ICYgX2xpc3RfbmFtZSwgLnByZXYgPSAmIF9saXN0X25hbWUsIC5oZWFkID0gJiBfbGlzdF9uYW1lLCAubyA9IE5VTEwgfQorI2RlZmluZSBGRF9MSVNUX0lOSVRJQ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bmQgaXQgaXMgcmV0dXJuZWQgaW4gcmVmX2R1cGxpY2F0ZSAqLworaW50IGZkX2xpc3RfaW5zZXJ0X29yZGVyZWQoIHN0cnVjdCBmZF9saXN0ICogaGVhZCwgc3RydWN0IGZkX2xpc3QgKiBpdGVtLCBpbnQgKCpjbXBfZmN0KSh2b2lkICosIHZvaWQgKiksIHZvaWQgKiogcmVmX2R1cGxpY2F0ZSk7CisKKy8qIFVubGluayBhbiBpdGVtIGZyb20gYSBsaXN0ICovCit2b2lkIGZkX2xpc3RfdW5saW5rICggc3RydWN0IGZkX2xpc3QgKiBpdGVtICk7CisKKworCisKKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgRElDVElPTkFSWSAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KKworLyogU3RydWN0dXJlIHRoYXQgY29udGFpbnMgdGhlIGNvbXBsZXRlIGRpY3Rpb25hcnkgZGVmaW5pdGlvbnMgKi8KK3N0cnVjdCBkaWN0aW9uYXJ5OworCisvKiBTdHJ1Y3R1cmUgdGhhdCBjb250YWlucyBhIGRpY3Rpb25hcnkgb2JqZWN0ICovCitzdHJ1Y3QgZGljdF9vYmplY3Q7CisKKy8qIFR5cGVzIG9mIG9iamVjdCBpbiB0aGUgZGljdGlvbmFyeS4gKi8KK2VudW0gZGljdF9vYmplY3RfdHlwZSB7CisJRElDVF9WRU5ET1IJPSAxLAkvKiBWZW5kb3IgKi8KKwlESUNUX0FQUExJQ0FUSU9OLAkvKiBEaWFtZXRlciBBcHBsaWNhdGlvbiAqLworCURJQ1RfVFlQRSwJCS8qIEFWUCBkYXRhIHR5cGUgKi8KKwlESUNUX0VOVU1WQUwsCQkvKiBOYW1lZCBjb25zdGFudCAodmFsdWUgb2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Ck7CisJIHJldCA9IGZkX2RpY3Rfc2VhcmNoICggZGljdCwgRElDVF9WRU5ET1IsIFZFTkRPUl9PRl9BUFBMSUNBVElPTiwgYXBwbGksICZ2ZW5kb3IsIEVOT0VOVCk7CisgfQorIAorIC0gZmRfZGljdF9nZXR2YWw6CisgU2FtcGxlIGNvZGUgdG8gcmV0cmlldmUgdGhlIGRhdGEgZnJvbSBhbiBhcHBsaWNhdGlvbiBvYmplY3Q6CisgeworCSBpbnQgcmV0OworCSBzdHJ1Y3QgZGljdF9vYmplY3QgKiBhcHBsaTsKKwkgc3RydWN0IGRpY3RfYXBwbGljYXRpb25fZGF0YSBhcHBsX2RhdGE7CisJIHJldCA9IGZkX2RpY3Rfc2VhcmNoICggZGljdCwgRElDVF9BUFBMSUNBVElPTiwgQVBQTElDQVRJT05fQllfTkFNRSwgIm15IHZlbmRvcidzIGFwcGxpY2F0aW9uIiwgJmFwcGxpLCBFTk9FTlQpOworCSByZXQgPSBmZF9kaWN0X2dldHZhbCAoIGFwcGxpLCAmYXBwbF9kYXRhICk7CisJIHByaW50ZigibXkgYXBwbGljYXRpb24gaWQ6ICVzXG4iLCBhcHBsX2RhdGEuYXBwbGljYXRpb25faWQgKTsKKyB9CisKKyovCisKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVHlwZSBvYmplY3QgCisgKgorICogVGhlc2UgdHlwZXMgYXJlIHVzZWQgdG8gbWFuYWdlIEFWUCBkYXRhIHR5cGVzIGluIHRoZSBkaWN0aW9uYXJ5CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisKKy8qIFR5cGUgdG8gc3RvcmUgYW55IEFWUCB2YWx1ZSAqLyAKK3VuaW9uIGF2cF92YWx1ZSB7CisJc3RydWN0IHsKKwkJdWludDhfdC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WRkcmVzcyBjaGVjayAqLworaW50IGZkX2RpY3RmY3RfQ2hhckluT1NfY2hlY2sodm9pZCAqIGRhdGEsIHVuaW9uIGF2cF92YWx1ZSAqIHZhbCwgY2hhciAqKiBlcnJvcl9tc2cpOworCisKKy8qKioqLworCisvKioqCisgKiAgQVBJIHVzYWdlIDoKKworLSBmZF9kaWN0X25ldzoKKyBUaGUgInBhcmVudCIgcGFyYW1ldGVyIG1heSBwb2ludCB0byBhbiBhcHBsaWNhdGlvbiBvYmplY3QsIHdoZW4gYSB0eXBlIGlzIGRlZmluZWQgYnkgYSBEaWFtZXRlciBhcHBsaWNhdGlvbi4gCisgCisgU2FtcGxlIGNvZGU6CisgeworCSBpbnQgcmV0OworCSBzdHJ1Y3QgZGljdF9vYmplY3QgKiBteXR5cGU7CisJIHN0cnVjdCBkaWN0X3R5cGVfZGF0YSBteXR5cGVkYXRhID0gCisJCXsgCisJCSBBVlBfVFlQRV9PQ1RFVFNUUklORywKKwkJICJBZGRyZXNzIiwKKwkJIE5VTEwsCisJCSBOVUxMCisJCX07CisJIHJldCA9IGZkX2RpY3RfbmV3ICggZGljdCwgRElDVF9UWVBFLCAmbXl0eXBlZGF0YSwgTlVMTCwgJm15dHlwZSApOworIH0KKworLSBmZF9kaWN0X3NlYXJjaDoKKyBTYW1wbGUgY29kZToKKyB7CisJIGludCByZXQ7CisJIHN0cnVjdCBkaWN0X29iamVjdCAqIGFkZHJlc3NfdHlwZTsKKwkgcmV0ID0gZmRfZGljdF9zZWFyY2ggKCBkaWN0LCBESUNUX1RZUEUsIFRZUEVfQllfTkFNRSwgIkFkZHJlc3MiLCAmYWRkcmVzc190eXBlLCBFTk9FTlQpOworIH0KKyAKKyovCisKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRW51bWVyYXRlZCB2YWx1ZXMgb2JqZWN0IAorICoKKyAqIFRoZXNlIHR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RlIGlmIGl0IHdhcyBmb3VuZCkuCisgKiAgRUlOVkFMIAk6IEEgcGFyYW1ldGVyIGlzIGludmFsaWQuCisgKi8KK2ludCBmZF9zZXNzX3N0YXRlX3JldHJpZXZlICggc3RydWN0IHNlc3Npb25faGFuZGxlciAqIGhhbmRsZXIsIHN0cnVjdCBzZXNzaW9uICogc2Vzc2lvbiwgc3RydWN0IHNlc3Nfc3RhdGUgKiogc3RhdGUgKTsgCisKKworLyogRm9yIGRlYnVnICovCitERUNMQVJFX0ZEX0RVTVBfUFJPVE9UWVBFKGZkX3Nlc3NfZHVtcCwgc3RydWN0IHNlc3Npb24gKiBzZXNzaW9uLCBpbnQgd2l0aF9zdGF0ZXMpOworREVDTEFSRV9GRF9EVU1QX1BST1RPVFlQRShmZF9zZXNzX2R1bXBfaGRsLCBzdHJ1Y3Qgc2Vzc2lvbl9oYW5kbGVyICogaGFuZGxlcik7CisKKy8qIEZvciBzdGF0aXN0aWNzIC8gbW9uaXRvcmluZzogZ2V0IHRoZSBudW1iZXIgb2Ygc3RydWN0IHNlc3Npb24gaW4gbWVtb3J5ICovCitpbnQgZmRfc2Vzc19nZXRjb3VudCh1aW50MzJfdCAqY250KTsKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgUk9VVElORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBUaGUgZm9sbG93aW5nIGZ1bmN0aW9ucyBhcmUgaGVscGVycyBmb3IgdGhlIHJvdXRpbmcgbW9kdWxlLiAKKyAgVGhlIHJvdXRpbmcgZGF0YSBpcyBzdG9yZWQgaW4gdGhlIG1lc3NhZ2UgaXRzZWxmLiAqLworCisvKiBTdHJ1Y3R1cmUgdGhhdCBjb250YWlucyB0aGUgcm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MgcGFyYW1ldGVyLgorICogQXMgYSBzaWRlIGVmZmVjdCwgYWxsIGNoaWxkcmVuIG9iamVjdHMgYXJlIGFsc28gdXBkYXRlZC4gVGhlcmVmb3JlLCBhbGwgYXZwX3ZhbHVlIGZpZWxkcyBvZgorICogdGhlIGNoaWxkcmVuIEFWUHMgbXVzdCBiZSBzZXQsIG9yIGFuIGVycm9yIHdpbGwgb2NjdXIuCisgKgorICogUkVUVVJOIFZBTFVFOgorICogIDAgICAgICAJOiBUaGUgc2l6ZSBoYXMgYmVlbiByZWNvbXB1dGVkLgorICogIEVJTlZBTCAJOiBBIHBhcmFtZXRlciBpcyBpbnZhbGlkLgorICovCitpbnQgZmRfbXNnX3VwZGF0ZV9sZW5ndGggKCBtc2dfb3JfYXZwICogb2JqZWN0ICk7CisKKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworLyogICAgICAgICAgICAgICAgICAgICAgICAgRElTUEFUQ0ggICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworCisvKiBEaXNwYXRjaCBtb2R1bGUgKHBhc3NpbmcgaW5jb21pbmcgbWVzc2FnZXMgdG8gZXh0ZW5zaW9ucyByZWdpc3RlcmVkIGNhbGxiYWNrcykKKyAqIGlzIHNwbGl0IGJldHdlZW4gdGhlIGxpYnJhcnkgYW5kIHRoZSBkYWVtb24uCisgKgorICogVGhlIGxpYnJhcnkgcHJvdmlkZXMgdGhlIHN1cHBvcnQgZm9yIGFzc29jaWF0aW5nIGRpc3BhdGNoIGNhbGxiYWNrcyB3aXRoCisgKiBkaWN0aW9uYXJ5IG9iamVjdHMuCisgKgorICogVGhlIGRhZW1vbiBpcyByZXNwb25zaWJsZSBmb3IgY2FsbGluZyB0aGUgY2FsbGJhY2tzIGZvciBhIG1lc3NhZ2Ugd2hlbiB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