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CisJCQl1MTYgbGVuZ3RoLCBjaGFyICptb2RfbHZsKQoreworCXN0cnVjdCBhcHBsZGF0YV9wcm9kdWN0X2lkIGlkID0geworCQkucHJvZF9uciAgICA9IHsweEQzLCAweEM5LCAweEQ1LCAweEU0LAorCQkJICAgICAgIDB4RTcsIDB4RDIsIDB4RDl9LAkvKiAiTElOVVhLUiIgKi8KKwkJLnByb2RfZm4gICAgPSAweEQ1RDMsCQkJLyogIk5MIiAqLworCQkudmVyc2lvbl9uciA9IDB4RjJGNiwJCQkvKiAiMjYiICovCisJCS5yZWxlYXNlX25yID0gMHhGMEYxLAkJCS8qICIwMSIgKi8KKwl9OworCisJaWQucmVjb3JkX25yID0gcmVjb3JkX25yOworCWlkLm1vZF9sdmwgPSAobW9kX2x2bFswXSkgPDwgOCB8IG1vZF9sdmxbMV07CisJcmV0dXJuIGFwcGxkYXRhX2FzbSgmaWQsIGZ1bmN0aW9uLCAodm9pZCAqKSBidWZmZXIsIGxlbmd0aCk7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqIHRpbWVyLCB3b3JrLCBESUFHIDxFTkQ+ICoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAvcHJvYyBzdHVmZiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjZGVmaW5lIEFQUExEQVRBX0FERF9USU1FUgkwCisjZGVmaW5lIEFQUExEQVRBX0RFTF9USU1FUgkxCisjZGVmaW5lIEFQUExEQVRBX01PRF9USU1FUgkyCisKKy8qCisgKiBfX2FwcGxkYXRhX3Z0aW1lcl9zZXR1cCgpCisgKgorICogQWRkLCBkZWxldGUgb3IgbW9kaWZ5IHZpcnR1YWwgdGltZXJzIG9uIGFsbCBvbmxpbmUgY3B1cy4KKyAqIFRoZSBjYWxsZXIgbmVlZHMgdG8gZ2V0IHRoZSBhcHBsZGF0YV90aW1lcl9sb2NrIHNwaW5sb2NrLgorICovCitzdG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cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKiogL3Byb2Mgc3R1ZmYgPEVORD4gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKiBtb2R1bGUtb3BzIG1hbmFnZW1lbnQgKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogYXBwbGRhdGFfcmVnaXN0ZXJfb3BzKCkKKyAqCisgKiB1cGRhdGUgb3BzIGxpc3QsIHJlZ2lzdGVyIC9wcm9jL3N5cyBlbnRyaWVzCisgKi8KK2ludCBhcHBsZGF0YV9yZWdpc3Rlcl9vcHMoc3RydWN0IGFwcGxkYXRhX29wcyAqb3BzKQoreworCWlmIChvcHMtPnNpemUgPiBBUFBMREFUQV9NQVhfUkVDX1NJWkUpCisJCXJldHVybiAtRUlOVkFMOworCisJb3BzLT5jdGxfdGFibGUgPSBremFsbG9jKDQgKiBzaXplb2Yoc3RydWN0IGN0bF90YWJsZSksIEdGUF9LRVJORUwpOworCWlmICghb3BzLT5jdGxfdGFibGUpCisJCXJldHVybiAtRU5PTUVNOworCisJbXV0ZXhfbG9jaygmYXBwbGRhdGFfb3BzX211dGV4KTsKKwlsaXN0X2FkZCgmb3BzLT5saXN0LCAmYXBwbGRhdGFfb3BzX2xpc3QpOworCW11dGV4X3VubG9jaygmYXBwbGRhdGFfb3BzX211dGV4KTsKKworCW9wcy0+Y3RsX3RhYmxlWzBdLnByb2NuYW1lID0gYXBwbGRhdGFfcHJvY19uYW1lOworCW9wcy0+Y3RsX3RhYmxlWzBdLm1heGxlbiAgID0gMDsKKwlvcHMtPmN0bF90YWJsZVswXS5tb2RlICAgICA9IFNfSVJVR08gfCBTX0lYVUdPOworCW9wcy0+Y3RsX3RhYmxlWzBdLmNoaWxkICAgID0gJm9wcy0+Y3RsX3RhYmxlWzJdOworCisJb3BzLT5jdGxfdGFibGVbMl0ucHJvY25hbWUgPSBvcHMtPm5hbWU7CisJb3BzLT5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HR5cGUsIHZvaWQgKmhkcikKK3sKKwlpZiAodHlwZSA9PSBJTkZPX1NJTVBMRSkKKwkJcmV0dXJuICgoc3RydWN0IGluZm9fYmxrX2hkciAqKWhkciktPmZsYWdzOworCWVsc2UgLyogSU5GT19FWFQgKi8KKwkJcmV0dXJuICgoc3RydWN0IHhfaW5mb19ibGtfaGRyICopaGRyKS0+ZmxhZ3M7Cit9CisKK3N0YXRpYyBpbmxpbmUgX191MTYgaW5mb19ibGtfaGRyX19wY3B1cyhlbnVtIGRpYWcyMDRfZm9ybWF0IHR5cGUsIHZvaWQgKmhkcikKK3sKKwlpZiAodHlwZSA9PSBJTkZPX1NJTVBMRSkKKwkJcmV0dXJuICgoc3RydWN0IGluZm9fYmxrX2hkciAqKWhkciktPnBoeXNfY3B1czsKKwllbHNlIC8qIElORk9fRVhUICovCisJCXJldHVybiAoKHN0cnVjdCB4X2luZm9fYmxrX2hkciAqKWhkciktPnBoeXNfY3B1czsKK30KKworLyogUGFydGl0aW9uIGhlYWRlciAqLworCitzdHJ1Y3QgcGFydF9oZHIgeworCV9fdTggcG47CisJX191OCBjcHVzOworCWNoYXIgcmVzZXJ2ZWRbNl07CisJY2hhciBwYXJ0X25hbWVbTFBBUl9OQU1FX0xFTl07Cit9IF9fYXR0cmlidXRlX18gKChwYWNrZWQpKTsKKworc3RydWN0IHhfcGFydF9oZHIgeworCV9fdTggIHBuOworCV9fdTggIGNwdXM7CisJX191OCAgcmNwdXM7CisJX191OCAgcGZsYWc7CisJX191MzIgbWx1OworCWNoYXIgIHBhcnRfbmFtZVtMUEFSX05BTUVfTEVOXTsKKwljaGFyICBscGNfbmFtZVs4XTsKKwljaGFyICBvc19uYW1lWzhdOworCV9fdTY0IG9ubGluZV9jczsKKwlfX3U2NCBvbmxpbmVfZXM7CisJX191OCAgdXBpZDsKKwljaGFyICByZXNlcnZlZDFbM107CisJX191MzIgZ3JvdXBfbWx1OworCWNoYXIgIGdyb3VwX25hbWVbOF07CisJY2hhciAgc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GIpCisJCTogIj1kIiAocmVzaWR1YWxfY250KSwgIitkIiAocmMpIDogIjAiICgmcGFybV9saXN0KSA6ICJtZW1vcnkiKTsKKworCWlmICgocmMgIT0gMCApICYmIChyYyAhPSAtMikpCisJCXJldHVybiByYzsKKwllbHNlCisJCXJldHVybiAtcmVzaWR1YWxfY250OworfQorCisvKgorICogQWxsb2NhdGUgYnVmZmVyIGZvciAicXVlcnkiIGFuZCBzdG9yZSBkaWFnIDJmYyBhdCAib2Zmc2V0IgorICovCitzdGF0aWMgdm9pZCAqZGlhZzJmY19zdG9yZShjaGFyICpxdWVyeSwgdW5zaWduZWQgaW50ICpjb3VudCwgaW50IG9mZnNldCkKK3sKKwl2b2lkICpkYXRhOworCWludCBzaXplOworCisJZG8geworCQlzaXplID0gZGlhZzJmYygwLCBxdWVyeSwgTlVMTCk7CisJCWlmIChzaXplIDwgMCkKKwkJCXJldHVybiBFUlJfUFRSKC1FQUNDRVMpOworCQlkYXRhID0gdm1hbGxvYyhzaXplICsgb2Zmc2V0KTsKKwkJaWYgKCFkYXRhKQorCQkJcmV0dXJuIEVSUl9QVFIoLUVOT01FTSk7CisJCWlmIChkaWFnMmZjKHNpemUsIHF1ZXJ5LCBkYXRhICsgb2Zmc2V0KSA9PSAwKQorCQkJYnJlYWs7CisJCXZmcmVlKGRhdGEpOworCX0gd2hpbGUgKDEpOworCSpjb3VudCA9IChzaXplIC8gc2l6ZW9mKHN0cnVjdCBkaWFnMmZjX2RhdGEpKTsKKworCXJldHVybiBkYXRhOworfQorCitzdGF0aWMgdm9pZCBkaWFnMmZjX2ZyZWUoY29uc3Qgdm9pZCAqZGF0YSkKK3sKKwl2ZnJlZShkYXRhKTsKK30KKworI2RlZmluZSBBVFRSSUJVVEUoZGlyLCBuYW1lLCBtZW1iZXIpIFwKK2RvIHsgXAorCXZvaWQgKnJjOyBcCisJcmMgPSBoeXBmc19jcmVhdGVfdTY0KGRpciwgbmFtZSwgbWVtYmVyKTsgXAorCWlmIChJU19F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CQkJCQkJCQlcCisJdHlwZWNoZWNrKGF0b21pY190ICosIHB0cik7CQkJCQlcCisJYXNtIHZvbGF0aWxlKAkJCQkJCQlcCisJCSIJbAklMCwlMlxuIgkJCQlcCisJCSIwOglscgklMSwlMFxuIgkJCQlcCisJCW9wX3N0cmluZyAiCSUxLCUzXG4iCQkJCVwKKwkJIgljcwklMCwlMSwlMlxuIgkJCQlcCisJCSIJamwJMGIiCQkJCQlcCisJCTogIj0mZCIgKG9sZF92YWwpLCAiPSZkIiAobmV3X3ZhbCksICIrUSIgKChwdHIpLT5jb3VudGVyKVwKKwkJOiAiZCIgKG9wX3ZhbCkJCQkJCQlcCisJCTogImNjIiwgIm1lbW9yeSIpOwkJCQkJXAorCW9sZF92YWw7CQkJCQkJCVwKK30pCisKKyNlbmRpZiAvKiBDT05GSUdfSEFWRV9NQVJDSF9aMTk2X0ZFQVRVUkVTICovCisKK3N0YXRpYyBpbmxpbmUgaW50IGF0b21pY19yZWFkKGNvbnN0IGF0b21pY190ICp2KQoreworCWludCBjOworCisJYXNtIHZvbGF0aWxlKAorCQkiCWwJJTAsJTFcbiIKKwkJOiAiPWQiIChjKSA6ICJRIiAodi0+Y291bnRlcikpOworCXJldHVybiBjOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYXRvbWljX3NldChhdG9taWNfdCAqdiwgaW50IGkpCit7CisJYXNtIHZvbGF0aWxlKAorCQkiCXN0CSUxLCUwXG4iCisJCTogIj1RIiAodi0+Y291bnRlcikgOiAiZCIgKGkpKTsKK30KKworc3RhdGljIGlubGluZSBpbnQgYXRvbWljX2FkZF9yZXR1cm4oaW50IGksIGF0b21pY190ICp2KQoreworCXJldHVybiBfX0FUT01JQ19MT09QKHYsIGksIF9fQVRPTUlDX0FERCwgX19BVE9NSUNfQkFSUklFUikgKyBpOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYXRvbWljX2FkZChpbnQgaSwgYXRvbWljX3QgKnYpCit7CisjaWZkZWYgQ09ORklHX0hBVkVfTUFSQ0hfWjE5Nl9GRUFUVVJFUworCWlmIChfX2J1aWx0aW5fY29uc3RhbnRfcChpKSAmJiAoaSA+IC0xMjkpICYmIChpIDwgMTI4KSkgeworCQlhc20gdm9sYXRpbGUoCisJCQkiYXNpCSUwLCUxXG4iCisJCQk6ICIrUSIgKHYtPmNvdW50ZXIpCisJCQk6ICJpIiAoaSkKKwkJCTogImNjIiwgIm1lbW9yeSIpOworCQlyZXR1cm47CisJfQorI2VuZGlmCisJX19BVE9NSUNfTE9PUCh2LCBpLCBfX0FUT01JQ19BREQsIF9fQVRPTUlDX05PX0JBUlJJRVIpOworfQorCisjZGVmaW5lIGF0b21pY19hZGRfbmVnYXRpdmUoX2ksIF92KQkoYXRvbWljX2FkZF9yZXR1cm4oX2ksIF92KSA8IDApCisjZGVmaW5lIGF0b21pY19pbmMoX3YpCQkJYXRvbWljX2FkZCgxLCBfdikKKyNkZWZpbmUgYXRvbWljX2luY19yZXR1cm4oX3YpCQlhdG9taWNfYWRkX3JldHVybigxLCBfdikKKyNkZWZpbmUgYXRvbWljX2luY19hbmRfdGVzdChfdikJCShhdG9taWNfYWRkX3JldHVybigxLCBfdikgPT0gMCkKKyNkZWZpbmUgYXRvbWljX3N1YihfaSwgX3YpCQlhdG9taWNfYWRkKC0oaW50KShfaSksIF92KQorI2RlZmluZSBhdG9taWNfc3ViX3JldHVybihfaSwgX3YpCWF0b21pY19hZGRfcmV0dXJuKC0oaW50KShfaSksIF92KQorI2RlZmluZSBhdG9taWNfc3ViX2FuZF90ZXN0KF9pLCBfdikJKGF0b21pY19zdWJfcmV0dXJuKF9pLCBfdikgPT0gMCkKKyNkZWZpbmUgYXRvbWljX2RlYyhfdikJCQlhdG9taWNfc3ViKDEsIF92KQorI2RlZmluZSBhdG9taWNfZGVjX3JldHVybihfdikJCWF0b21pY19zdWJfcmV0dXJuKDEsIF92KQorI2RlZmluZSBhdG9taWNfZGVjX2FuZF90ZXN0KF92KQkJKGF0b21pY19zdWJfcmV0dXJuKDEsIF92KSA9PSAwKQorCisjZGVmaW5lIEFUT01JQ19PUChvcCwgT1ApCQkJCQkJXAorc3RhdGljIGlubGluZSB2b2lkIGF0b21pY18jI29wKGludCBpLCBhdG9taWNfdCAqdikJCQlcCit7CQkJCQkJCQkJXAorCV9fQVRPTUlDX0xPT1AodiwgaSwgX19BVE9NSUNfIyNPUCwgX19BVE9NSUNfTk9fQkFSUklFUik7CVwKK30KKworQVRPTUlDX09QKGFuZCwgQU5EKQorQVRPTUlDX09QKG9yLCBPUikKK0FUT01JQ19PUCh4b3IsIFhPUikKKworI3VuZGVmIEFUT01JQ19PUAorCisjZGVmaW5lIGF0b21pY194Y2hnKHYsIG5ldykgKHhjaGcoJigodiktPmNvdW50ZXIpLCBuZXcpKQorCitzdGF0aWMgaW5saW5lIGludCBhdG9taWNfY21weGNoZyhhdG9taWNfdCAqdiwgaW50IG9sZCwgaW50IG5ldykKK3sKKwlhc20gdm9sYXRpbGUoCisJCSIJY3MJJTAsJTIsJTEiCisJCTogIitkIiAob2xkKSwgIitRIiAodi0+Y291bnRlcikKKwkJOiAiZCIgKG5ldykKKwkJOiAiY2MiLCAibWVtb3J5Iik7CisJcmV0dXJuIG9sZDsKK30KKworc3RhdGljIGlubGluZSBpbnQgX19hdG9taWNfYWRkX3VubGVzcyhhdG9taWNfdCAqdiwgaW50IGEsIGludCB1KQoreworCWludCBjLCBvbGQ7CisJYyA9IGF0b21pY19yZWFkKHYpOworCWZvciAoOzspIHsKKwkJaWYgKHVubGlrZWx5KGMgPT0gdSkpCisJCQlicmVhazsKKwkJb2xkID0gYXRvbWljX2NtcHhjaGcodiwgYywgYyArIGEpOworCQlpZiAobGlrZWx5KG9sZCA9PSBjKSkKKwkJCWJyZWFrOworCQljID0gb2xkOworCX0KKwlyZXR1cm4gYzsKK30KKworCisjdW5kZWYgX19BVE9NSUNfTE9PUAorCisjZGVmaW5lIEFUT01JQzY0X0lOSVQoaSkgIHsgKGkpIH0KKworI2RlZmluZSB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ovCisjZGVmaW5lIFJfMzkwX1RMU19MT0FECQkzNwkvKiBUYWcgZm9yIGxvYWQgaW5zbiBpbiBUTFMgY29kZS4gKi8KKyNkZWZpbmUgUl8zOTBfVExTX0dEQ0FMTAkzOAkvKiBUYWcgZm9yIGZ1bmN0aW9uIGNhbGwgaW4gZ2VuZXJhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5bmFtaWMgVExTIGNvZGUuICAqLworI2RlZmluZSBSXzM5MF9UTFNfTERDQUxMCTM5CS8qIFRhZyBmb3IgZnVuY3Rpb24gY2FsbCBpbiBsb2NhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5bmFtaWMgVExTIGNvZGUuICAqLworI2RlZmluZSBSXzM5MF9UTFNfR0QzMgkJNDAJLyogRGlyZWN0IDMyIGJpdCBmb3IgZ2VuZXJhbCBkeW5hbWljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWFkIGxvY2FsIGRhdGEuICAqLworI2RlZmluZSBSXzM5MF9UTFNfR0Q2NAkJNDEJLyogRGlyZWN0IDY0IGJpdCBmb3IgZ2VuZXJhbCBkeW5hbWljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWFkIGxvY2FsIGRhdGEuICAqLworI2RlZmluZSBSXzM5MF9UTFNfR09USUUxMgk0MgkvKiAxMiBiaXQgR09UIG9mZnNldCBmb3Igc3RhdGljIFRMUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrIG9mZnNldC4gICovCisjZGVmaW5lIFJfMzkwX1RMU19HT1RJRTMyCTQzCS8qIDMyIGJpdCBHT1Qgb2Zmc2V0IGZvciBzdGF0aWMgVExTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2sgb2Zmc2V0LiAgKi8KKyNkZWZpbmUgUl8zOTBfVExTX0dPVElFNjQJNDQJLyogNjQgYml0IEdPVCBvZmZzZXQgZm9yIHN0YXRpYyBUTFMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jayBvZmZzZXQuICAqLworI2RlZmluZSBSXzM5MF9UTFNfTERNMzIJCTQ1CS8qIERpcmVjdCAzMiBiaXQgZm9yIGxvY2FsIGR5bmFtaWMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJlYWQgbG9jYWwgZGF0YSBpbiBMRCBjb2RlLiAgKi8KKyNkZWZpbmUgUl8zOTBfVExTX0xETTY0CQk0NgkvKiBEaXJlY3QgNjQgYml0IGZvciBsb2NhbCBkeW5hbWljCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWFkIGxvY2FsIGRhdGEgaW4gTEQgY29kZS4gICovCisjZGVmaW5lIFJfMzkwX1RMU19JRTMyCQk0NwkvKiAzMiBiaXQgYWRkcmVzcyBvZiBHT1QgZW50cnkgZm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVnYXRlZCBzdGF0aWMgVExTIGJsb2NrIG9mZnNldC4gICovCisjZGVmaW5lIFJfMzkwX1RMU19JRTY0CQk0OAkvKiA2NCBiaXQgYWRkcmVzcyBvZiBHT1QgZW50cnkgZm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVnYXRlZCBzdGF0aWMgVExTIGJsb2NrIG9mZnNldC4gICovCisjZGVmaW5lIFJfMzkwX1RMU19JRUVOVAkJNDkJLyogMzIgYml0IHJlbC4gb2Zmc2V0IHRvIEdPVCBlbnRyeSBmb3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWdhdGVkIHN0YXRpYyBUTFMgYmxvY2sgb2Zmc2V0LiAgKi8KKyNkZWZpbmUgUl8zOTBfVExTX0xFMzIJCTUwCS8qIDMyIGJpdCBuZWdhdGVkIG9mZnNldCByZWxhdGl2ZSB0bworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpYyBUTFMgYmxvY2suICAqLworI2RlZmluZSBSXzM5MF9UTFNfTEU2NAkJNTEJLyogNjQgYml0IG5lZ2F0ZWQgb2Zmc2V0IHJlbGF0aXZlIHRvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljIFRMUyBibG9jay4gICovCisjZGVmaW5lIFJfMzkwX1RMU19MRE8zMgkJNTIJLyogMzIgYml0IG9mZnNldCByZWxhdGl2ZSB0byBUTFMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jay4gICovCisjZGVmaW5lIFJfMzkwX1RMU19MRE82NAkJNTMJLyogNjQgYml0IG9mZnNldCByZWxhdGl2ZSB0byBUTFMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jay4gICovCisjZGVmaW5lIFJfMzkwX1RMU19EVFBNT0QJNTQJLyogSUQgb2YgbW9kdWxlIGNvbnRhaW5pbmcgc3ltYm9sLiAgKi8KKyNkZWZpbmUgUl8zOTBfVExTX0RUUE9GRgk1NQkvKiBPZmZzZXQgaW4gVExTIGJsb2NrLiAgKi8KKyNkZWZpbmUgUl8zOTBfVExTX1RQT0ZGCQk1NgkvKiBOZWdhdGUgb2Zmc2V0IGluIHN0YXRpYyBUTFMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jay4gICovCisjZGVmaW5lIFJfMzkwXzIwCQk1NwkvKiBEaXJlY3QgMjAgYml0LiAgKi8KKyNkZWZpbmUgUl8zOTBfR09UMjAJCTU4CS8qIDIwIGJpdCBHT1Qgb2Zmc2V0LiAgKi8KKyNkZWZpbmUgUl8zOTBfR09UUExUMjAJCTU5CS8qIDIwIGJpdCBvZmZzZXQgdG8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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBpZiAoKF9GUF9GUkFDX0hJR0hfUkFXXyMjZnMoWCkgJiBfRlBfUU5BTkJJVF8jI2ZzKSAgICAgICAgICBcCisgICAgICAgICYmICEoX0ZQX0ZSQUNfSElHSF9SQVdfIyNmcyhZKSAmIF9GUF9RTkFOQklUXyMjZnMpKSAgICAgXAorICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgUiMjX3MgPSBZIyNfczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgIF9GUF9GUkFDX0NPUFlfIyN3YyhSLFkpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICBSIyNfcyA9IFgjI19zOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgX0ZQX0ZSQUNfQ09QWV8jI3djKFIsWCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIFIjI19jID0gRlBfQ0xTX05BTjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgfSB3aGlsZSAoMCkKKworLyogU29tZSBhc3NlbWJseSB0byBzcGVlZCB0aGluZ3MgdXAuICovCisjZGVmaW5l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JDSF9TVFJJTkdfQykKKworc3RhdGljIGlubGluZSB2b2lkICptZW1jaHIoY29uc3Qgdm9pZCAqIHMsIGludCBjLCBzaXplX3QgbikKK3sKKwlyZWdpc3RlciBpbnQgcjAgYXNtKCIwIikgPSAoY2hhcikgYzsKKwljb25zdCB2b2lkICpyZXQgPSBzICsgbjsKKworCWFzbSB2b2xhdGlsZSgKKwkJIjA6CXNyc3QJJTAsJTFcbiIKKwkJIglqbwkwYlxuIgorCQkiCWpsCTFmXG4iCisJCSIJbGEJJTAsMFxuIgorCQkiMToiCisJCTogIithIiAocmV0KSwgIismYSIgKHMpIDogImQiIChyMCkgOiAiY2MiKTsKKwlyZXR1cm4gKHZvaWQgKikgcmV0OworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgKm1lbXNjYW4odm9pZCAqcywgaW50IGMsIHNpemVfdCBuKQoreworCXJlZ2lzdGVyIGludCByMCBhc20oIjAiKSA9IChjaGFyKSBjOworCWNvbnN0IHZvaWQgKnJldCA9IHMgKyBuOworCisJYXNtIHZvbGF0aWxlKAorCQkiMDoJc3JzdAklMCwlMVxuIgorCQkiCWpvCTBiXG4iCisJCTogIithIiAocmV0KSwgIismYSIgKHMpIDogImQiIChyMCkgOiAiY2MiKTsKKwlyZXR1cm4gKHZvaWQgKikgcmV0OworfQorCitzdGF0aWMgaW5saW5lIGNoYXIgKnN0cmNhdChjaGFyICpkc3QsIGNvbnN0IGNoYXIgKnNyYykKK3sKKwlyZWdpc3RlciBpbnQgcjAgYXNtKCIwIikgPSAwOworCXVuc2lnbmVkIGxvbmcgZHVtbXk7CisJY2hhciAqcmV0ID0gZHN0OworCisJYXNtIHZvbGF0aWxlKAorCQkiMDoJc3JzdAklMCwlMVxuIgorCQkiCWpvCTBiXG4iCisJCSIxOgltdnN0CSUwLCUyXG4iCisJCSIJam8JMWIiCisJCTogIj0mYSIgKGR1bW15KSwgIithIiAoZHN0KSwgIithIiAoc3JjKQorCQk6ICJkIiAocjApLCAiMCIgKDApID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gICAgICAgIHVuc2lnbmVkIGludCBjaGFucV9sZW47ICAgICAvKiBsZW5ndGggb2YgY2hhbnEgKi8KKyAgICAgICAgY2hhciB0eXBlWzRdOyAgICAgICAgICAgICAgIC8qIGZyb20gZGlzY2lwbGluZS5uYW1lLCAnbm9uZScgZm9yIHVua25vd24gKi8KKyAgICAgICAgdW5zaWduZWQgaW50IHN0YXR1czsgICAgICAgIC8qIGN1cnJlbnQgZGV2aWNlIGxldmVsICovCisgICAgICAgIHVuc2lnbmVkIGludCBsYWJlbF9ibG9jazsgICAvKiB3aGVyZSB0byBmaW5kIHRoZSBWT0xTRVIgKi8KKyAgICAgICAgdW5zaWduZWQgaW50IEZCQV9sYXlvdXQ7ICAgIC8qIGZpeGVkIGJsb2NrIHNpemUgKGxpa2UgQUlYVk9MKSAqLworICAgICAgICB1bnNpZ25lZCBpbnQgY2hhcmFjdGVyaXN0aWNzX3NpemU7CisgICAgICAgIHVuc2lnbmVkIGludCBjb25mZGF0YV9zaXplOworICAgICAgICBjaGFyIGNoYXJhY3RlcmlzdGljc1s2NF07ICAgLyogZnJvbSByZWFkX2RldmljZV9jaGFyYWN0ZXJpc3RpY3MgKi8KKyAgICAgICAgY2hhciBjb25maWd1cmF0aW9uX2RhdGFbMjU2XTsgLyogZnJvbSByZWFkX2NvbmZpZ3VyYXRpb25fZGF0YSAqLworICAgICAgICB1bnNpZ25lZCBpbnQgZm9ybWF0OyAgICAgICAgICAvKiBmb3JtYXQgaW5mbyBsaWtlIGZvcm1hdHRlZC9jZGwvbGRsLy4uLiAqLworICAgICAgICB1bnNpZ25lZCBpbnQgZmVhdHVyZXM7ICAgICAgICAvKiBkYXNkIGZlYXR1cmVzIGxpa2UgJ3JvJywuLi4gICAgICAgICAgICAqLworICAgICAgICB1bnNpZ25lZCBpbnQgcmVzZXJ2ZWQwOyAgICAgICAvKiByZXNlcnZlZCBmb3IgZnVydGhlciB1c2UgLC4uLiAgICAgICAgICAqLworICAgICAgICB1bnNpZ25lZCB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vICovCisgICAgICAgIHVuc2lnbmVkIGludCByZWFsX2Rldm5vOyAgICAvKiBmb3IgYWxpYXNlcyAqLworICAgICAgICB1bnNpZ25lZCBpbnQgc2NoaWQ7ICAgICAgICAgLyogUy8zOTAgc3ViY2hhbm5lbCBpZGVudGlmaWVyICovCisgICAgICAgIHVuc2lnbmVkIGludCBjdV90eXBlICA6IDE2OyAvKiBmcm9tIFNlbnNlSUQgKi8KKyAgICAgICAgdW5zaWduZWQgaW50IGN1X21vZGVsIDogIDg7IC8qIGZyb20gU2Vuc2VJRCAqLworICAgICAgICB1bnNpZ25lZCBpbnQgZGV2X3R5cGUgOiAxNjsgLyogZnJvbSBTZW5zZUlEICovCisgICAgICAgIHVuc2lnbmVkIGludCBkZXZfbW9kZWwgOiA4OyAvKiBmcm9tIFNlbnNlSUQgKi8KKyAgICAgICAgdW5zaWduZWQgaW50IG9wZW5fY291bnQ7IAorICAgICAgICB1bnNpZ25lZCBpbnQgcmVxX3F1ZXVlX2xlbjsgCisgICAgICAgIHVuc2lnbmVkIGludCBjaGFucV9sZW47ICAgICAvKiBsZW5ndGggb2YgY2hhbnEgKi8KKyAgICAgICAgY2hhciB0eXBlWzRdOyAgICAgICAgICAgICAgIC8qIGZyb20gZGlzY2lwbGluZS5uYW1lLCAnbm9uZScgZm9yIHVua25vd24gKi8KKyAgICAgICAgdW5zaWduZWQgaW50IHN0YXR1czsgICAgICAgIC8qIGN1cnJlbnQgZGV2aWNlIGxldmVsICovCisgICAgICAgIHVuc2lnbmVkIGludCBsYWJlbF9ibG9jazsgICAvKiB3aGVyZSB0byBmaW5kIHRoZSBWT0xTRVIgKi8KKyAgICAgICAgdW5zaWduZWQgaW50IEZCQV9sYXlvdXQ7ICAgIC8qIGZpeGVkIGJsb2NrIHNpemUgKGxpa2UgQUlYVk9MKSAqLworICAgICAgICB1bnNpZ25lZCBpbnQgY2hhcmFjdGVyaXN0aWNzX3NpemU7CisgICAgICAgIHVuc2lnbmVkIGludCBjb25mZGF0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ZWQpKSBkYXNkX3N5bW1pb19wYXJtc190OworCisvKgorICogRGF0YSByZXR1cm5lZCBieSBTZW5zZSBQYXRoIEdyb3VwIElEIChTTklEKQorICovCitzdHJ1Y3QgZGFzZF9zbmlkX2RhdGEgeworCXN0cnVjdCB7CisJCV9fdTggZ3JvdXA6MjsKKwkJX191OCByZXNlcnZlOjI7CisJCV9fdTggbW9kZToxOworCQlfX3U4IHJlczozOworCX0gX19hdHRyaWJ1dGVfXyAoKHBhY2tlZCkpIHBhdGhfc3RhdGU7CisJX191OCBwZ2lkWzExXTsKK30gX19hdHRyaWJ1dGVfXyAoKHBhY2tlZCkpOworCitzdHJ1Y3QgZGFzZF9zbmlkX2lvY3RsX2RhdGEgeworCXN0cnVjdCBkYXNkX3NuaWRfZGF0YSBkYXRhOworCV9fdTggcGF0aF9tYXNrOworfSBfX2F0dHJpYnV0ZV9fICgocGFja2VkKSk7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTRUNUSU9OOiBEZWZpbml0aW9uIG9mIElPQ1RMcworICoKKyAqIEhlcmUgaXN0IGhvdyB0aGUgaW9jdGwtbnIgc2hvdWxkIGJlIHVzZWQ6CisgKiAgICAwIC0gICAzMSAgIERBU0QgZHJpdmVyIGl0c2VsZgorICogICAzMiAtICAyMzkgICBzdGlsbCBvcGVuCisgKiAgMjQwIC0gIDI1NSAgIHJlc2VydmVkIGZvciBFTUMgCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogRGlzYWJsZSB0aGUgdm9sdW1lIChmb3IgTGludXgpICovCisjZGVmaW5lIEJJT0RBU0RESVNBQkxFIF9JTyhEQVNEX0lPQ1RMX0xFVFRFUiwwKSAKKy8qIEVuYWJsZSB0aGUgdm9sdW1lIChmb3IgTGludXgpICov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M5MF9TSUdOQUxfSAorCisjaW5jbHVkZSA8bGludXgvdHlwZXMuaD4KKyNpbmNsdWRlIDxsaW51eC90aW1lLmg+CisKKy8qIEF2b2lkIHRvbyBtYW55IGhlYWRlciBvcmRlcmluZyBwcm9ibGVtcy4gICovCitzdHJ1Y3Qgc2lnaW5mbzsKK3N0cnVjdCBwdF9yZWdzOworCisjaWZuZGVmIF9fS0VSTkVMX18KKy8qIEhlcmUgd2UgbXVzdCBjYXRlciB0byBsaWJjcyB0aGF0IHBva2UgYWJvdXQgaW4ga2VybmVsIGhlYWRlcnMuICAqLworCisjZGVmaW5lIE5TSUcgICAgICAgICAgICAzMgordHlwZWRlZiB1bnNpZ25lZCBsb25nIHNpZ3NldF90OworCisjZW5kaWYgLyogX19LRVJORUxfXyAqLworCisjZGVmaW5lIFNJR0hVUCAgICAgICAgICAgMQorI2RlZmluZSBTSUdJTlQgICAgICAgICAgIDIKKyNkZWZpbmUgU0lHUVVJVCAgICAgICAgICAzCisjZGVmaW5lIFNJR0lMTCAgICAgICAgICAgNAorI2RlZmluZSBTSUdUUkFQICAgICAgICAgIDUKKyNkZWZpbmUgU0lHQUJSVCAgICAgICAgICA2CisjZGVmaW5lIFNJR0lPVCAgICAgICAgICAgNgorI2RlZmluZSBTSUdCVVMgICAgICAgICAgIDcKKyNkZWZpbmUgU0lHRlBFICAgICAgICAgICA4CisjZGVmaW5lIFNJR0tJTEwgICAgICAgICAgOQorI2RlZmluZSBTSUdVU1IxICAgICAgICAgMTAKKyNkZWZpbmUgU0lHU0VHViAgICAgICAgIDExCisjZGVmaW5lIFNJR1VTUjIgICAgICAgICAxMgorI2RlZmluZSBTSUdQSVBFICAgICAgICAgMTMKKyNkZWZpbmUgU0lHQUxSTSAgICAgICAgIDE0CisjZGVmaW5lIFNJR1RFUk0gICAgICAgICAxNQorI2RlZmluZSBTSUdTVEtGTFQgICAgICAgMTYKKyNkZWZpbmUgU0lHQ0hMRCAgICAgICAgIDE3CisjZGVmaW5lIFN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B3ZSBtdXN0IGNhdGVyIHRvIGxpYmNzIHRoYXQgcG9rZSBhYm91dCBpbiBrZXJuZWwgaGVhZGVycy4gICovCisKK3N0cnVjdCBzaWdhY3Rpb24geworICAgICAgICB1bmlvbiB7CisgICAgICAgICAgX19zaWdoYW5kbGVyX3QgX3NhX2hhbmRsZXI7CisgICAgICAgICAgdm9pZCAoKl9zYV9zaWdhY3Rpb24pKGludCwgc3RydWN0IHNpZ2luZm8gKiwgdm9pZCAqKTsKKyAgICAgICAgfSBfdTsKKyNpZm5kZWYgX19zMzkweF9fIC8qIGxvdmVseSAqLworICAgICAgICBzaWdzZXRfdCBzYV9tYXNrOworICAgICAgICB1bnNpZ25lZCBsb25nIHNhX2ZsYWdzOworICAgICAgICB2b2lkICgqc2FfcmVzdG9yZXIpKHZvaWQpOworI2Vsc2UgIC8qIF9fczM5MHhfXyAqLworICAgICAgICB1bnNpZ25lZCBsb25nIHNhX2ZsYWdzOworICAgICAgICB2b2lkICgqc2FfcmVzdG9yZXIpKHZvaWQpOworCXNpZ3NldF90IHNhX21hc2s7CisjZW5kaWYgLyogX19zMzkweF9fICovCit9OworCisjZGVmaW5lIHNhX2hhbmRsZXIgICAgICBfdS5fc2FfaGFuZGxlcgorI2RlZmluZSBzYV9zaWdhY3Rpb24gICAgX3UuX3NhX3NpZ2FjdGlvbgorCisjZW5kaWYgLyogX19LRVJORUxfXyAqLworCit0eXBlZGVmIHN0cnVjdCBzaWdhbHRzdGFjayB7CisgICAgICAgIHZvaWQgX191c2VyICpzc19zcDsKKyAgICAgICAgaW50IHNzX2ZsYWdzOworICAgICAgICBzaXplX3Qgc3Nfc2l6ZTsKK30gc3RhY2tfdDsKKworCisjZW5kaWYgLyogX1VBUElfQVNNUzM5MF9TSUdOQUxfSCAqLwpkaWZmIC0tZ2l0IGEvYXJjaC9zMzkwL2luY2x1ZGUvdWFwaS9hc20vc29ja2V0LmggYi9hcmNoL3MzOTAvaW5jbHVkZS91YXBpL2FzbS9zb2NrZX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2lnbmVkIHNob3J0IHN0X21vZGU7CisgICAgICAgIHVuc2lnbmVkIHNob3J0IHN0X25saW5rOworICAgICAgICB1bnNpZ25lZCBzaG9ydCBzdF91aWQ7CisgICAgICAgIHVuc2lnbmVkIHNob3J0IHN0X2dpZDsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgc3RfcmRldjsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgX19wYWQyOworICAgICAgICB1bnNpZ25lZCBsb25nICBzdF9zaXplOworICAgICAgICB1bnNpZ25lZCBsb25nICBzdF9ibGtzaXplOworICAgICAgICB1bnNpZ25lZCBsb25nICBzdF9ibG9ja3M7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgIHN0X2F0aW1lOworICAgICAgICB1bnNpZ25lZCBsb25nICBzdF9hdGltZV9uc2VjOworICAgICAgICB1bnNpZ25lZCBsb25nICBzdF9tdGltZTsKKyAgICAgICAgdW5zaWduZWQgbG9uZyAgc3RfbXRpbWVfbnNlYzsKKyAgICAgICAgdW5zaWduZWQgbG9uZyAgc3RfY3RpbWU7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgIHN0X2N0aW1lX25zZWM7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgIF9fdW51c2VkNDsKKyAgICAgICAgdW5zaWduZWQgbG9uZyAgX191bnVzZWQ1OworfTsKKworLyogVGhpcyBtYXRjaGVzIHN0cnVjdCBzdGF0NjQgaW4gZ2xpYmMyLjEsIGhlbmNlIHRoZSBhYnNvbHV0ZWx5CisgKiBpbnNhbmUgYW1vdW50cyBvZiBwYWRkaW5nIGFyb3VuZCBkZXZfdCdzLgorICovCitzdHJ1Y3Qgc3RhdDY0IHsKKyAgICAgICAgdW5zaWduZWQgbG9uZyBsb25nCXN0X2RldjsKKyAgICAgICAgdW5zaWduZWQgaW50ICAgIF9fcGFkMTsKKyNkZWZpbmUgU1RBVDY0X0hBU19CUk9LRU5fU1RfSU5PICAgICAgICAxCisgICAgICAgIHVuc2lnbmVkIGxv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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqCSAgIGVuYWJsZXMgdXNlciBwcm9ncmFtcyB0byBkaXNwbGF5IG1lc3NhZ2VzIGFuZCBjb250cm9sIGVuY3J5cHRpb24KKyAqCSAgIG9uIHMzOTAgdGFwZSBkZXZpY2VzCisgKgorICoJICAgQ29weXJpZ2h0IElCTSBDb3JwLiAyMDAxLCAyMDA2CisgKgkgICBBdXRob3Iocyk6IE1pY2hhZWwgSG9semhldSA8aG9semhldUBkZS5pYm0uY29tPgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9UQVBFMzkwX0gKKyNkZWZpbmUgX1RBUEUzOTBfSAorCisjZGVmaW5lIFRBUEUzOTBfRElTUExBWSBfSU9XKCdkJywgMSwgc3RydWN0IGRpc3BsYXlfc3RydWN0KQorCisvKgorICogVGhlIFRBUEUzOTBfRElTUExBWSBpb2N0bCBjYWxscyB0aGUgTG9hZCBEaXNwbGF5IGNvbW1hbmQKKyAqIHdoaWNoIHRyYW5zZmVycyAxNyBieXRlcyBvZiBkYXRhIGZyb20gdGhlIGNoYW5uZWwgdG8gdGhlIHN1YnN5c3RlbToKKyAqICAgICAtIDEgZm9ybWF0IGNvbnRyb2wgYnl0ZSwgYW5kCisgKiAgICAgLSB0d28gOC1ieXRlIG1lc3NhZ2VzCisgKgorICogRm9ybWF0IGNvbnRyb2wgYnl0ZToKKyAqICAgMC0yOiBOZXcgTWVzc2FnZSBPdmVybGF5CisgKiAgICAgMzogQWx0ZXJuYXRlIE1lc3NhZ2VzCisgKiAgICAgNDogQmxpbmsgTWVzc2FnZQorICogICAgIDU6IERpc3BsYXkgTG93L0hpZ2ggTWVzc2FnZQorICogICAgIDY6IFJlc2VydmVkCisgKiAgICAgNzogQXV0b21hdGljIExvY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fdW51c2VkWzEyOCAtIHNpemVvZihzaWdzZXRfdCldOworfTsKKworI2VuZGlmIC8qICFfQVNNX1MzOTBfVUNPTlRFWFRfSCAqLwpkaWZmIC0tZ2l0IGEvYXJjaC9zMzkwL2luY2x1ZGUvdWFwaS9hc20vdW5pc3RkLmggYi9hcmNoL3MzOTAvaW5jbHVkZS91YXBpL2FzbS91bmlzdGQuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zNGVjMjAyCi0tLSAvZGV2L251bGwKKysrIGIvYXJjaC9zMzkwL2luY2x1ZGUvdWFwaS9hc20vdW5pc3RkLmgKQEAgLTAsMCArMSw0MDUgQEAKKy8qCisgKiAgUzM5MCB2ZXJzaW9uCisgKgorICogIERlcml2ZWQgZnJvbSAiaW5jbHVkZS9hc20taTM4Ni91bmlzdGQuaCIKKyAqLworCisjaWZuZGVmIF9VQVBJX0FTTV9TMzkwX1VOSVNURF9IXworI2RlZmluZSBfVUFQSV9BU01fUzM5MF9VTklTVERfSF8KKworLyoKKyAqIFRoaXMgZmlsZSBjb250YWlucyB0aGUgc3lzdGVtIGNhbGwgbnVtYmVycy4KKyAqLworCisjZGVmaW5lIF9fTlJfZXhpdCAgICAgICAgICAgICAgICAgMQorI2RlZmluZSBfX05SX2ZvcmsgICAgICAgICAgICAgICAgIDIKKyNkZWZpbmUgX19OUl9yZWFkICAgICAgICAgICAgICAgICAzCisjZGVmaW5lIF9fTlJfd3JpdGUgICAgICAgICAgICAgICAgNAorI2RlZmluZSBfX05SX29wZW4gICAgICAgICAgICAgICAgIDUKKyNkZWZpbmUgX19OUl9jbG9zZSAgICAgICAgICAgICAgICA2CisjZGVmaW5lIF9fTlJfcmVzdGFydF9zeXNjYWxsCSAgNworI2RlZmluZSBfX05SX2NyZWF0ICAgICAgICAgICAgICAgIDgKKyNkZWZpbmUgX19OUl9saW5rICAgICAgICAgICAgICAgICA5CisjZGVmaW5lIF9fTlJfdW5saW5rICAgICAgICAgICAgICAxMAorI2RlZmluZSBfX05SX2V4ZWN2ZSAgICAgICAgICAgICAgMTEKKyNkZWZpbmUgX19OUl9jaGRpciAgICAgICAgICAgICAgIDEyCisjZGVmaW5lIF9fTlJfbWtub2QgICAgICAgICAgICAgICAxNAorI2RlZmluZSBfX05SX2NobW9kICAgICAgICAgICAgICAgMTUKKyNkZWZpbmUgX19OUl9sc2VlayAgICAgICAgICAgICAgIDE5CisjZGVmaW5lIF9fTlJfZ2V0cGlkICAgICAgICAgICAgICAyMAorI2RlZmluZSBfX05SX21vdW50ICAgICAgICAgICAgICAgMjEKKyNkZWZpbmUgX19OUl91bW91bnQgICAgICAgICAgICAgIDIyCisjZGVmaW5lIF9fTlJfcHRyYWNlICAgICAgICAgICAgICAyNgorI2RlZmluZSBfX05SX2FsYXJtICAgICAgICAgICAgICAgMjcKKyNkZWZpbmUgX19OUl9wYXVzZSAgICAgICAgICAgICAgIDI5CisjZGVmaW5lIF9fTlJfdXRpbWUgICAgICAgICAgICAgICAzMAorI2RlZmluZSBfX05SX2FjY2VzcyAgICAgICAgICAgICAgMzMKKyNkZWZpbmUgX19OUl9uaWNlICAgICAgICAgICAgICAgIDM0CisjZGVmaW5lIF9fTlJfc3luYyAgICAgICAgICAgICAgICAzNgorI2RlZmluZSBfX05SX2tpbGwgICAgICAgICAgICAgICAgMzcKKyNkZWZpbmUgX19OUl9yZW5hbWUgICAgICAgICAgICAgIDM4CisjZGVmaW5lIF9fTlJfbWtkaXIgICAgICAgICAgICAgICAzOQorI2RlZmluZSBfX05SX3JtZGlyICAgICAgICAgICAgICAgNDAKKyNkZWZpbmUgX19OUl9kdXAgICAgICAgICAgICAgICAgIDQxCisjZGVmaW5lIF9fTlJfcGlwZSAgICAgICAgICAgICAgICA0MgorI2RlZmluZSBfX05SX3RpbWVzICAgICAgICAgICAgICAgNDMKKyNkZWZpbmUgX19OUl9icmsgICAgICAgICAgICAgICAgIDQ1CisjZGVmaW5lIF9fTlJfc2lnbmFsICAgICAgICAgICAgICA0OAorI2RlZmluZSBfX05SX2FjY3QgICAgICAgICAgICAgICAgNTEKKyNkZWZpbmUgX19OUl91bW91bnQyICAgICAgICAgICAgIDUyCisjZGVmaW5lIF9fTlJfaW9jdGwgICAgICAgICAgICAgICA1NAorI2RlZmluZSBfX05SX2ZjbnRsICAgICAgICAgICAgICAgNTUKKyNkZWZpbmUgX19OUl9zZXRwZ2lkICAgICAgICAgICAgIDU3CisjZGVmaW5lIF9fTlJfdW1hc2sgICAgICAgICAgICAgICA2MAorI2RlZmluZSBfX05SX2Nocm9vdCAgICAgICAgICAgICAgNjEKKyNkZWZpbmUgX19OUl91c3RhdCAgICAgICAgICAgICAgIDYyCisjZGVmaW5lIF9fTlJfZHVwMiAgICAgICAgICAgICAgICA2MworI2RlZmluZSBfX05SX2dldHBwaWQgICAgICAgICAgICAgNjQKKyNkZWZpbmUgX19OUl9nZXRwZ3JwICAgICAgICAgICAgIDY1CisjZGVmaW5lIF9fTlJfc2V0c2lkICAgICAgICAgICAgICA2NgorI2RlZmluZSBfX05SX3NpZ2FjdGlvbiAgICAgICAgICAgNjcKKyNkZWZpbmUgX19OUl9zaWdzdXNwZW5kICAgICAgICAgIDcyCisjZGVmaW5lIF9fTlJfc2lncGVuZGluZyAgICAgICAgICA3MworI2RlZmluZSBfX05SX3NldGhvc3RuYW1lICAgICAgICAgNzQKKyNkZWZpbmUgX19OUl9zZXRybGltaXQgICAgICAgICAgIDc1CisjZGVmaW5lIF9fTlJfZ2V0cnVzYWdlICAgICAgICAgICA3NworI2RlZmluZSBfX05SX2dldHRpbWVvZmRheSAgICAgICAgNzgKKyNkZWZpbmUgX19OUl9zZXR0aW1lb2ZkYXkgICAgICAgIDc5CisjZGVmaW5lIF9fTlJfc3ltbGluayAgICAgICAgICAgICA4MworI2RlZmluZSBfX05SX3JlYWRsaW5rICAgICAgICAgICAgODUKKyNkZWZpbmUgX19OUl91c2VsaWIgICAgICAgICAgICAgIDg2CisjZGVmaW5lIF9fTlJfc3dhcG9uICAgICAgICAgICAgICA4NworI2RlZmluZSBfX05SX3JlYm9vdCAgICAgICAgICAgICAgODgKKyNkZWZpbmUgX19OUl9yZWFkZGlyICAgICAgICAgICAgIDg5CisjZGVmaW5lIF9fTlJfbW1hcCAgICAgICAgICAgICAgICA5MAorI2RlZmluZSBfX05SX211bm1hcCAgICAgICAgICAgICAgOTEKKyNkZWZpbmUgX19OUl90cnVuY2F0ZSAgICAgICAgICAgIDkyCisjZGVmaW5lIF9fTlJfZnRydW5jYXRlICAgICAgICAgICA5MworI2RlZmluZSBfX05SX2ZjaG1vZCAgICAgICAgICAgICAgOTQKKyNkZWZpbmUgX19OUl9nZXRwcmlvcml0eSAgICAgICAgIDk2CisjZGVmaW5lIF9fTlJfc2V0cHJpb3JpdHkgICAgICAgICA5NworI2RlZmluZSBfX05SX3N0YXRmcyAgICAgICAgICAgICAgOTkKKyNkZWZpbmUgX19OUl9mc3RhdGZzICAgICAgICAgICAgMTAwCisjZGVmaW5lIF9fTlJfc29ja2V0Y2FsbCAgICAgICAgIDEwMgorI2RlZmluZSBfX05SX3N5c2xvZyAgICAgICAgICAgICAxMDMKKyNkZWZpbmUgX19OUl9zZXRpdGltZXIgICAgICAgICAgMTA0CisjZGVmaW5lIF9fTlJfZ2V0aXRpbWVyICAgICAgICAgIDEwNQorI2RlZmluZSBfX05SX3N0YXQgICAgICAgICAgICAgICAxMDYKKyNkZWZpbmUgX19OUl9sc3RhdCAgICAgICAgICAgICAgMTA3CisjZGVmaW5lIF9fTlJfZnN0YXQgICAgICAgICAgICAgIDEwOAorI2RlZmluZSBfX05SX2xvb2t1cF9kY29va2llICAgICAxMTAKKyNkZWZpbmUgX19OUl92aGFuZ3VwICAgICAgICAgICAgMTExCisjZGVmaW5lIF9fTlJfaWRsZSAgICAgICAgICAgICAgIDExMgorI2RlZmluZSBfX05SX3dhaXQ0ICAgICAgICAgICAgICAxMTQKKyNkZWZpbmUgX19OUl9zd2Fwb2ZmICAgICAgICAgICAgMTE1CisjZGVmaW5lIF9fTlJfc3lzaW5mbyAgICAgICAgICAgIDExNgorI2RlZmluZSBfX05SX2lwYyAgICAgICAgICAgICAgICAxMTcKKyNkZWZpbmUgX19OUl9mc3luYyAgICAgICAgICAgICAgMTE4CisjZGVmaW5lIF9fTlJfc2lncmV0dXJuICAgICAgICAgIDExOQorI2RlZmluZSBfX05SX2Nsb25lICAgICAgICAgICAgICAxMjAKKyNkZWZpbmUgX19OUl9zZXRkb21haW5uYW1lICAgICAgMTIxCisjZGVmaW5lIF9fTlJfdW5hbWUgICAgICAgICAgICAgIDEyMgorI2RlZmluZSBfX05SX2FkanRpbWV4ICAgICAgICAgICAxMjQKKyNkZWZpbmUgX19OUl9tcHJvdGVjdCAgICAgICAgICAgMTI1CisjZGVmaW5lIF9fTlJfc2lncHJvY21hc2sgICAgICAgIDEyNgorI2RlZmluZSBfX05SX2NyZWF0ZV9tb2R1bGUgICAgICAxMjcKKyNkZWZpbmUgX19OUl9pbml0X21vZHVsZSAgICAgICAgMTI4CisjZGVmaW5lIF9fTlJfZGVsZXRlX21vZHVsZSAgICAgIDEyOQorI2RlZmluZSBfX05SX2dldF9rZXJuZWxfc3ltcyAgICAxMzAKKyNkZWZpbmUgX19OUl9xdW90YWN0bCAgICAgICAgICAgMTMxCisjZGVmaW5lIF9fTlJfZ2V0cGdpZCAgICAgICAgICAgIDEzMgorI2RlZmluZSBfX05SX2ZjaGRpciAgICAgICAgICAgICAxMzMKKyNkZWZpbmUgX19OUl9iZGZsdXNoICAgICAgICAgICAgMTM0CisjZGVmaW5lIF9fTlJfc3lzZnMgICAgICAgICAgICAgIDEzNQorI2RlZmluZSBfX05SX3BlcnNvbmFsaXR5ICAgICAgICAxMzYKKyNkZWZpbmUgX19OUl9hZnNfc3lzY2FsbCAgICAgICAgMTM3IC8qIFN5c2NhbGwgZm9yIEFuZHJldyBGaWxlIFN5c3RlbSAqLworI2RlZmluZSBfX05SX2dldGRlbnRzICAgICAgICAgICAxNDEKKyNkZWZpbmUgX19OUl9mbG9jayAgICAgICAgICAgICAgMTQzCisjZGVmaW5lIF9fTlJfbXN5bmMgICAgICAgICAgICAgIDE0NAorI2RlZmluZSBfX05SX3JlYWR2ICAgICAgICAgICAgICAxNDUKKyNkZWZpbmUgX19OUl93cml0ZXYgICAgICAgICAgICAgMTQ2CisjZGVmaW5lIF9fTlJfZ2V0c2lkICAgICAgICAgICAgIDE0NworI2RlZmluZSBfX05SX2ZkYXRhc3luYyAgICAgICAgICAxNDgKKyNkZWZpbmUgX19OUl9fc3lzY3RsICAgICAgICAgICAgMTQ5CisjZGVmaW5lIF9fTlJfbWxvY2sgICAgICAgICAgICAgIDE1MAorI2RlZmluZSBfX05SX211bmxvY2sgICAgICAgICAgICAxNTEKKyNkZWZpbmUgX19OUl9tbG9ja2FsbCAgICAgICAgICAgMTUyCisjZGVmaW5lIF9fTlJfbXVubG9ja2FsbCAgICAgICAgIDE1MworI2RlZmluZSBfX05SX3NjaGVkX3NldHBhcmFtICAgICAgICAgICAgIDE1NAorI2RlZmluZSBfX05SX3NjaGVkX2dldHBhcmFtICAgICAgICAgICAgIDE1NQorI2RlZmluZSBfX05SX3NjaGVkX3NldHNjaGVkdWxlciAgICAgICAgIDE1NgorI2RlZmluZSBfX05SX3NjaGVkX2dldHNjaGVkdWxlciAgICAgICAgIDE1NworI2RlZmluZSBfX05SX3NjaGVkX3lpZWxkICAgICAgICAgICAgICAgIDE1OAorI2RlZmluZSBfX05SX3NjaGVkX2dldF9wcmlvcml0eV9tYXggICAgIDE1OQorI2RlZmluZSBfX05SX3NjaGVkX2dldF9wcmlvcml0eV9taW4gICAgIDE2MAorI2RlZmluZSBfX05SX3NjaGVkX3JyX2dldF9pbnRlcnZhbCAgICAgIDE2MQorI2RlZmluZSBfX05SX25hbm9zbGVlcCAgICAgICAgICAxNjIKKyNkZWZpbmUgX19OUl9tcmVtYXAgICAgICAgICAgICAgMTYzCisjZGVmaW5lIF9fTlJfcXVlcnlfbW9kdWxlICAgICAgIDE2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IGNvdW50KTsKK30KKworc3RydWN0IHN0YXQ2NF9lbXUzMSB7CisJdW5zaWduZWQgbG9uZyBsb25nICBzdF9kZXY7CisJdW5zaWduZWQgaW50ICAgIF9fcGFkMTsKKyNkZWZpbmUgU1RBVDY0X0hBU19CUk9LRU5fU1RfSU5PICAgICAgICAxCisJdTMyICAgICAgICAgICAgIF9fc3RfaW5vOworCXVuc2lnbmVkIGludCAgICBzdF9tb2RlOworCXVuc2lnbmVkIGludCAgICBzdF9ubGluazsKKwl1MzIgICAgICAgICAgICAgc3RfdWlkOworCXUzMiAgICAgICAgICAgICBzdF9naWQ7CisJdW5zaWduZWQgbG9uZyBsb25nICBzdF9yZGV2OworCXVuc2lnbmVkIGludCAgICBfX3BhZDM7CisJbG9uZyAgICAgICAgICAgIHN0X3NpemU7CisJdTMyICAgICAgICAgICAgIHN0X2Jsa3NpemU7CisJdW5zaWduZWQgY2hhciAgIF9fcGFkNFs0XTsKKwl1MzIgICAgICAgICAgICAgX19wYWQ1OyAgICAgLyogZnV0dXJlIHBvc3NpYmxlIHN0X2Jsb2NrcyBoaWdoIGJpdHMgKi8KKwl1MzIgICAgICAgICAgICAgc3RfYmxvY2tzOyAgLyogTnVtYmVyIDUxMi1ieXRlIGJsb2NrcyBhbGxvY2F0ZWQuICovCisJdTMyICAgICAgICAgICAgIHN0X2F0aW1lOworCXUzMiAgICAgICAgICAgICBfX3BhZDY7CisJdTMyICAgICAgICAgICAgIHN0X210aW1lOworCXUzMiAgICAgICAgICAgICBfX3BhZDc7CisJdTMyICAgICAgICAgICAgIHN0X2N0aW1lOworCXUzMiAgICAgICAgICAgICBfX3BhZDg7ICAgICAvKiB3aWxsIGJlIGhpZ2ggMzIgYml0cyBvZiBjdGltZSBzb21lZGF5ICovCisJdW5zaWduZWQgbG9uZyAgIHN0X2lubzsKK307CQorCitzdGF0aWMgaW50IGNwX3N0YXQ2NChzdHJ1Y3Qgc3RhdDY0X2VtdTMxIF9fdXNlciAqdWJ1Ziwgc3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dGhlIGhpZ2ggb3JkZXIgYml0IG9mIGFuIDMyIGJpdCBwb2ludGVyIGFuZCBjb252ZXJ0cyBpdCovCisvKiAgICAgICB0byBhIDY0IGJpdCBwb2ludGVyICovCisjZGVmaW5lIEEoX194KSAoKHVuc2lnbmVkIGxvbmcpKChfX3gpICYgMHg3RkZGRkZGRlVMKSkKKyNkZWZpbmUgQUEoX194KQkJCQlcCisJKCh1bnNpZ25lZCBsb25nKShfX3gpKQorCisvKiBOb3cgMzJiaXQgY29tcGF0aWJpbGl0eSB0eXBlcyAqLworc3RydWN0IGlwY19rbHVkZ2VfMzIgeworICAgICAgICBfX3UzMiAgIG1zZ3A7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcG9pbnRlciAgICAgICAgICAgICAgKi8KKyAgICAgICAgX19zMzIgICBtc2d0eXA7Cit9OworCisvKiBhc20vc2lnY29udGV4dC5oICovCit0eXBlZGVmIHVuaW9uCit7CisJX191NjQgICBkOworCV9fdTMyICAgZjsgCit9IGZyZWdfdDMyOworCit0eXBlZGVmIHN0cnVjdAoreworCXVuc2lnbmVkIGludAlmcGM7CisJdW5zaWduZWQgaW50CXBhZDsKKwlmcmVnX3QzMglmcHJzW19fTlVNX0ZQUlNdOyAgICAgICAgICAgICAgCit9IF9zMzkwX2ZwX3JlZ3MzMjsKKwordHlwZWRlZiBzdHJ1Y3QgCit7CisgICAgICAgIF9fdTMyICAgbWFzazsKKyAgICAgICAgX191MzIJYWRkcjsKK30gX3Bzd190MzIgX19hdHRyaWJ1dGVfXyAoKGFsaWduZWQoOCkpKTsKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKwlfcHN3X3QzMglwc3c7CisJX191MzIJCWdwcnNbX19OVU1fR1BSU107CisJX191MzIJCWFjcnNbX19OVU1fQUNSU107Cit9IF9zMzkwX3JlZ3NfY29tbW9uMzI7CisKK3R5cGVkZWYgc3RydWN0Cit7CisJX3MzOTBfcmVnc19jb21tb24zMiByZWdzOworCV9zMzkwX2ZwX3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ICpidWYsIHNpemVfdCBjb3VudCwgdTY0ICpwcG9zKQoreworCXZvaWQgKnNyYyA9ICh2b2lkICopKHVuc2lnbmVkIGxvbmcpKnBwb3M7CisKKwlzcmMgPSBlbGZjb3JlaGRyX25ld21lbSA/IHNyYyA6IHNyYyAtIE9MRE1FTV9CQVNFOworCW1lbWNweShidWYsIHNyYywgY291bnQpOworCSpwcG9zICs9IGNvdW50OworCXJldHVybiBjb3VudDsKK30KKworLyoKKyAqIFJlYWQgZnJvbSBFTEYgbm90ZXMgZGF0YQorICovCitzc2l6ZV90IGVsZmNvcmVoZHJfcmVhZF9ub3RlcyhjaGFyICpidWYsIHNpemVfdCBjb3VudCwgdTY0ICpwcG9zKQoreworCXZvaWQgKnNyYyA9ICh2b2lkICopKHVuc2lnbmVkIGxvbmcpKnBwb3M7CisJaW50IHJjOworCisJaWYgKGVsZmNvcmVoZHJfbmV3bWVtKSB7CisJCW1lbWNweShidWYsIHNyYywgY291bnQpOworCX0gZWxzZSB7CisJCXJjID0gY29weV9mcm9tX29sZG1lbShidWYsIHNyYywgY291bnQpOworCQlpZiAocmMpCisJCQlyZXR1cm4gcmM7CisJfQorCSpwcG9zICs9IGNvdW50OworCXJldHVybiBjb3VudDsKK30KZGlmZiAtLWdpdCBhL2FyY2gvczM5MC9rZXJuZWwvZGVidWcuYyBiL2FyY2gvczM5MC9rZXJuZWwvZGVidWcuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42ZmNhMGU0Ci0tLSAvZGV2L251bGwKKysrIGIvYXJjaC9zMzkwL2tlcm5lbC9kZWJ1Zy5jCkBAIC0wLDAgKzEsMTU0MSBAQAorLyoKKyAqICAgUy8zOTAgZGVidWcgZmFjaWxpdHkKKyAqCisgKiAgICBDb3B5cmlnaHQgSUJNIENvcnAuIDE5OTksIDIwMTIKKyAqCisgKiAgICBBdXRob3Iocyk6IE1pY2hhZWwgSG9semhldSAoaG9semhldUBkZS5pYm0uY29tKSwKKy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VzZXIgKnVzZXJfYnVmLAorCQkJc2l6ZV90IHVzZXJfbGVuLCBsb2ZmX3QgKiBvZmZzZXQpCit7CisgICAgICAgIGNoYXIgaW5wdXRfYnVmWzFdOworICAgICAgICBpbnQgcmMgPSB1c2VyX2xlbjsKKworCWlmICh1c2VyX2xlbiA+IDB4MTAwMDApCisgICAgICAgICAgICAgICAgdXNlcl9sZW4gPSAweDEwMDAwOworICAgICAgICBpZiAoKm9mZnNldCAhPSAwKXsKKwkJcmMgPSAtRVBJUEU7CisgICAgICAgICAgICAgICAgZ290byBvdXQ7CisJfQorICAgICAgICBpZiAoY29weV9mcm9tX3VzZXIoaW5wdXRfYnVmLCB1c2VyX2J1ZiwgMSkpeworICAgICAgICAgICAgICAgIHJjID0gLUVGQVVMVDsKKyAgICAgICAgICAgICAgICBnb3RvIG91dDsKKyAgICAgICAgfQorICAgICAgICBpZihpbnB1dF9idWZbMF0gPT0gJy0nKSB7IAorICAgICAgICAgICAgICAgIGRlYnVnX2ZsdXNoKGlkLCBERUJVR19GTFVTSF9BTEwpOworICAgICAgICAgICAgICAgIGdvdG8gb3V0OworICAgICAgICB9CisgICAgICAgIGlmIChpc2RpZ2l0KGlucHV0X2J1ZlswXSkpIHsKKyAgICAgICAgICAgICAgICBpbnQgYXJlYSA9ICgoaW50KSBpbnB1dF9idWZbMF0gLSAoaW50KSAnMCcpOworICAgICAgICAgICAgICAgIGRlYnVnX2ZsdXNoKGlkLCBhcmVhKTsKKyAgICAgICAgICAgICAgICBnb3RvIG91dDsKKyAgICAgICAgfQorCisJcHJfaW5mbygiRmx1c2hpbmcgZGVidWcgZGF0YSBmYWlsZWQgYmVjYXVzZSAlYyBpcyBub3QgYSB2YWxpZCAiCisJCSAiYXJlYVxuIiwgaW5wdXRfYnVmWzBdKTsKKworb3V0OgorICAgICAgICAqb2Zmc2V0ICs9IHVzZXJfbGVuOworICAgICAgICByZXR1cm4gcmM7ICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgaW5wdXQgY2hhcmFjdGVycyAqLworfQorCisvKgorICogcHJpbnRzIGRlYnVnIGhlYWRlciBpbiByYXcgZm9ybWF0CisgKi8KKworc3RhdGljIGludAorZGVidWdfcmF3X2hlYWRlcl9mbihkZWJ1Z19pbmZvX3QgKiBpZCwgc3RydWN0IGRlYnVnX3ZpZXcgKnZpZXcsCisJCQlpbnQgYXJlYSwgZGVidWdfZW50cnlfdCAqIGVudHJ5LCBjaGFyICpvdXRfYnVmKQoreworICAgICAgICBpbnQgcmM7CisKKwlyYyA9IHNpemVvZihkZWJ1Z19lbnRyeV90KTsKKwltZW1jcHkob3V0X2J1ZixlbnRyeSxzaXplb2YoZGVidWdfZW50cnlfdCkpOworICAgICAgICByZXR1cm4gcmM7Cit9CisKKy8qCisgKiBwcmludHMgZGVidWcgZGF0YSBpbiByYXcgZm9ybWF0CisgKi8KKworc3RhdGljIGludAorZGVidWdfcmF3X2Zvcm1hdF9mbihkZWJ1Z19pbmZvX3QgKiBpZCwgc3RydWN0IGRlYnVnX3ZpZXcgKnZpZXcsCisJCQkgICAgICAgY2hhciAqb3V0X2J1ZiwgY29uc3QgY2hhciAqaW5fYnVmKQoreworCWludCByYzsKKworCXJjID0gaWQtPmJ1Zl9zaXplOworCW1lbWNweShvdXRfYnVmLCBpbl9idWYsIGlkLT5idWZfc2l6ZSk7CisJcmV0dXJuIHJjOworfQorCisvKgorICogcHJpbnRzIGRlYnVnIGRhdGEgaW4gaGV4L2FzY2lpIGZvcm1hdAorICovCisKK3N0YXRpYyBpbnQKK2RlYnVnX2hleF9hc2NpaV9mb3JtYXRfZm4oZGVidWdfaW5mb190ICogaWQsIHN0cnVjdCBkZWJ1Z192aWV3ICp2aWV3LAorCSAgICAJCSAgY2hhciAqb3V0X2J1ZiwgY29uc3QgY2hhciAqaW5fYnVmKQoreworCWludCBpLCByYyA9IDA7CisKKwlmb3IgKGkgPSAwOyBpIDwgaWQtPmJ1Zl9zaXplOyBpKyspIHsKKyAgICAgICAgICAgICAgICByY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UNLICAgQkVMICovCisgICAgIDB4MDAsIDB4MDEsIDB4MDIsIDB4MDMsIDB4MzcsIDB4MkQsIDB4MkUsIDB4MkYsCisgLyowOCAgQlMgICAgSFQgICAgTEYgICAgVlQgICAgRkYgICAgQ1IgICAgU08gICAgU0kgKi8KKyAvKiAgICAgICAgICAgICAgLT5OTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAweDE2LCAweDA1LCAweDE1LCAweDBCLCAweDBDLCAweDBELCAweDBFLCAweDBGLAorIC8qMTAgRExFICAgREMxICAgREMyICAgREMzICAgREM0ICAgTkFLICAgU1lOICAgRVRCICovCisgICAgIDB4MTAsIDB4MTEsIDB4MTIsIDB4MTMsIDB4M0MsIDB4M0QsIDB4MzIsIDB4MjYsCisgLyoxOCBDQU4gICAgRU0gICBTVUIgICBFU0MgICAgRlMgICAgR1MgICAgUlMgICAgVVMgKi8KKyAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPklHUyAtPklSUyAtPklVUyAqLworICAgICAweDE4LCAweDE5LCAweDNGLCAweDI3LCAweDIyLCAweDFELCAweDFFLCAweDFGLAorIC8qMjAgIFNQICAgICAhICAgICAiICAgICAjICAgICAkICAgICAlICAgICAmICAgICAnICovCisgICAgIDB4NDAsIDB4NUEsIDB4N0YsIDB4N0IsIDB4NUIsIDB4NkMsIDB4NTAsIDB4N0QsCisgLyoyOCAgICggICAgICkgICAgICogICAgICsgICAgICwgICAgIC0gICAgLiAgICAgIC8gKi8KKyAgICAgMHg0RCwgMHg1RCwgMHg1QywgMHg0RSwgMHg2QiwgMHg2MCwgMHg0QiwgMHg2MSwKKyAvKjMwICAgMCAgICAgMSAgICAgMiAgICAgMyAgICAgNCAgICAgNSAgICAgNiAgICAgNyAqLworICAgICAweEYwLCAweEYxLCAweEYyLCAweEYzLCAweEY0LCAweEY1LCAweEY2LCAweEY3LAorIC8qMzggICA4ICAgICA5ICAgICA6ICAgICA7ICAgICA8ICAgICA9ICAgICA+ICAgICA/ICovCisgICAgIDB4RjgsIDB4RjksIDB4N0EsIDB4NUUsIDB4NEMsIDB4N0UsIDB4NkUsIDB4NkYsCisgLyo0MCAgIEAgICAgIEEgICAgIEIgICAgIEMgICAgIEQgICAgIEUgICAgIEYgICAgIEcgKi8KKyAgICAgMHg3QywgMHhDMSwgMHhDMiwgMHhDMywgMHhDNCwgMHhDNSwgMHhDNiwgMHhDNywKKyAvKjQ4ICAgSCAgICAgSSAgICAgSiAgICAgSyAgICAgTCAgICAgTSAgICAgTiAgICAgTyAqLworICAgICAweEM4LCAweEM5LCAweEQxLCAweEQyLCAweEQzLCAweEQ0LCAweEQ1LCAweEQ2LAorIC8qNTAgICBQICAgICBRICAgICBSICAgICBTICAgICBUICAgICBVICAgICBWICAgICBXICovCisgICAgIDB4RDcsIDB4RDgsIDB4RDksIDB4RTIsIDB4RTMsIDB4RTQsIDB4RTUsIDB4RTYsCisgLyo1OCAgIFggICAgIFkgICAgIFogICAgIFsgICAgIFwgICAgIF0gICAgIF4gICAgIF8gKi8KKyAgICAgMHhFNywgMHhFOCwgMHhFOSwgMHhCQSwgMHhFMCwgMHhCQiwgMHhCMCwgMHg2RCwKKyAvKjYwICAgYCAgICAgYSAgICAgYiAgICAgYyAgICAgZCAgICAgZSAgICAgZiAgICAgZyAqLworICAgICAweDc5LCAweDgxLCAweDgyLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LAorIC8qNjggICBoICAgICBpICAgICBqICAgICBrICAgICBsICAgICBtICAgICBuICAgICBvICovCisgICAgIDB4ODgsIDB4ODksIDB4OTEsIDB4OTIsIDB4OTMsIDB4OTQsIDB4OTUsIDB4OTYsCisgLyo3MCAgIHAgICAgIHEgICAgIHIgICAgIHMgICAgIHQgICAgIHUgICAgIHYgICAgIHcgKi8KKyAgICAgMHg5NywgMHg5OCwgMHg5OSwgMHhBMiwgMHhBMywgMHhBNCwgMHhBNSwgMHhBNiwKKyAvKjc4ICAgeCAgICAgeSAgICAgeiAgICAgeyAgICAgfCAgICAgfSAgICAgfiAgICBETCAqLworICAgICAweEE3LCAweEE4LCAweEE5LCAweEMwLCAweDRGLCAweEQwLCAweEExLCAweDA3LAorIC8qODAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qODgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qOTAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qOTgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQTAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQTgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQjAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQjgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQzAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qQzgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRDAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRDgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRTAgICAgICAgIHN6CQkJCQkJKi8KKyAgICAgMHgzRiwgMHg1OSwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwKKyAvKkU4Ki8KKyAgICAgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwKKyAvKkYwKi8KKyAgICAgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwKKyAvKkY4Ki8KKyAgICAgMHg5MCwgMHgzRiwgMHgzRiwgMHgzRiwgMHgzRiwgMHhFQSwgMHgzRiwgMHhGRgorfTsKKworLyoKKyAqIEVCQ0RJQyAwMzcgLT4gQVNDSUkgKElCTSBQQyA0MzcpCisgKi8KK19fdTggX2ViY2FzY1syNTZdID0KK3sKKyAvKiAweDAwICAgTlVMICAgU09IICAgU1RYICAgRVRYICAqU0VMICAgIEhUICAqUk5MICAgREVMICovCisgICAgICAgICAgMHgwMCwgMHgwMSwgMHgwMiwgMHgwMywgMHgwNywgMHgwOSwgMHgwNywgMHg3RiwKKyAvKiAweDA4ICAgLUdFICAtU1BTICAtUlBUICAgIFZUICAgIEZGICAgIENSICAgIFNPICAgIFNJICovCisgICAgICAgICAgMHgwNywgMHgwNywgMHgwNywgMHgwQiwgMHgwQywgMHgwRCwgMHgwRSwgMHgwRiwKKyAvKiAweDEwICAgRExFICAgREMxICAgREMyICAgREMzICAtUkVTICAgLU5MICAgIEJTICAtUE9DCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLUVOUCAgLT5MRiAgICAgICAgICAgICAqLworICAgICAgICAgIDB4MTAsIDB4MTEsIDB4MTIsIDB4MTMsIDB4MDcsIDB4MEEsIDB4MDgsIDB4MDcsCisgLyogMHgxOCAgIENBTiAgICBFTSAgLVVCUyAgLUNVMSAgLUlGUyAgLUlHUyAgLUlSUyAgLUlUQgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1JVVMgKi8KKyAgICAgICAgICAweDE4LCAweDE5LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4MjAgICAtRFMgIC1TT1MgICAgRlMgIC1XVVMgIC1CWVAgICAgTEYgICBFVEIgICBFU0MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtSU5QICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgMHgwNywgMHgwNywgMHgxQywgMHgwNywgMHgwNywgMHgwQSwgMHgxNywgMHgxQiwKKyAvKiAweDI4ICAgLVNBICAtU0ZFICAgLVNNICAtQ1NQICAtTUZBICAgRU5RICAgQUNLICAgQkVMCisgICAgICAgICAgICAgICAgICAgICAgIC1TVyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLyAKKyAgICAgICAgICAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA1LCAweDA2LCAweDA3LAorIC8qIDB4MzAgIC0tLS0gIC0tLS0gICBTWU4gICAtSVIgICAtUFAgIC1UUk4gIC1OQlMgICBFT1QgKi8KKyAgICAgICAgICAweDA3LCAweDA3LCAweDE2LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA0LAorIC8qIDB4MzggIC1TQlMgICAtSVQgIC1SRkYgIC1DVTMgICBEQzQgICBOQUsgIC0tLS0gICBTVUIgKi8KKyAgICAgICAgICAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDE0LCAweDE1LCAweDA3LCAweDFBLAorIC8qIDB4NDAgICAgU1AgICBSU1AgICAgICAgICAgIIHkICAgICAgICAgICAgICAtLS0tICAgICAgICovCisgICAgICAgICAgMHgyMCwgMHhGRiwgMHg4MywgMHg4NCwgMHg4NSwgMHhBMCwgMHgwNywgMHg4NiwKKyAvKiAweDQ4ICAgICAgICAgICAgICAgICAgICAgICAuICAgICA8ICAgICAoICAgICArICAgICB8ICovCisgICAgICAgICAgMHg4NywgMHhBNCwgMHg5QiwgMHgyRSwgMHgzQywgMHgyOCwgMHgyQiwgMHg3QywKKyAvKiAweDUwICAgICAmICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLS0tICovCisgICAgICAgICAgMHgyNiwgMHg4MiwgMHg4OCwgMHg4OSwgMHg4QSwgMHhBMSwgMHg4QywgMHgwNywKKyAvKiAweDU4ICAgICAgICAgICCB3yAgICAgISAgICAgJCAgICAgKiAgICAgKSAgICAgOyAgICAgICAqLworICAgICAgICAgIDB4OEQsIDB4RTEsIDB4MjEsIDB4MjQsIDB4MkEsIDB4MjksIDB4M0IsIDB4QUEsCisgLyogMHg2MCAgICAgLSAgICAgLyAgLS0tLSAgICAggcQgIC0tLS0gIC0tLS0gIC0tLS0gICAgICAgKi8KKyAgICAgICAgICAweDJELCAweDJGLCAweDA3LCAweDhFLCAweDA3LCAweDA3LCAweDA3LCAweDhGLAorIC8qIDB4NjggICAgICAgICAgICAgIC0tLS0gICAgICwgICAgICUgICAgIF8gICAgID4gICAgID8gKi8gCisgICAgICAgICAgMHg4MCwgMHhBNSwgMHgwNywgMHgyQywgMHgyNSwgMHg1RiwgMHgzRSwgMHgzRiwKKyAvKiAweDcwICAtLS0tICAgICAgICAtLS0tICAtLS0tICAtLS0tICAtLS0tICAtLS0tICAtLS0tICovCisgICAgICAgICAgMHgwNywgMHg5MCwgMHgwNywgMHgwNywgMHgwNywgMHgwNywgMHgwNywgMHgwNywKKyAvKiAweDc4ICAgICAqICAgICBgICAgICA6ICAgICAjICAgICBAICAgICAnICAgICA9ICAgICAiICovCisgICAgICAgICAgMHg3MCwgMHg2MCwgMHgzQSwgMHgyMywgMHg0MCwgMHgyNywgMHgzRCwgMHgyMiwKKyAvKiAweDgwICAgICAqICAgICBhICAgICBiICAgICBjICAgICBkICAgICBlICAgICBmICAgICBnICovCisgICAgICAgICAgMHgwNywgMHg2MSwgMHg2MiwgMHg2MywgMHg2NCwgMHg2NSwgMHg2NiwgMHg2NywKKyAvKiAweDg4ICAgICBoICAgICBpICAgICAgICAgICAgICAtLS0tICAtLS0tICAtLS0tICAgICAgICovCisgICAgICAgICAgMHg2OCwgMHg2OSwgMHhBRSwgMHhBRiwgMHgwNywgMHgwNywgMHgwNywgMHhGMSwKKyAvKiAweDkwICAgICCBsCAgICAgaiAgICAgayAgICAgbCAgICAgbSAgICAgbiAgICAgbyAgICAgcCAqLworICAgICAgICAgIDB4RjgsIDB4NkEsIDB4NkIsIDB4NkMsIDB4NkQsIDB4NkUsIDB4NkYsIDB4NzAsCisgLyogMHg5OCAgICAgcSAgICAgciAgICAgICAgICAgICAgICAgICAgLS0tLSAgICAgICAgLS0tLSAqLworICAgICAgICAgIDB4NzEsIDB4NzIsIDB4QTYsIDB4QTcsIDB4OTEsIDB4MDcsIDB4OTIsIDB4MDcsCisgLyogMHhBMCAgICAgICAgICAgfiAgICAgcyAgICAgdCAgICAgdSAgICAgdiAgICAgdyAgICAgeCAqLworICAgICAgICAgIDB4RTYsIDB4N0UsIDB4NzMsIDB4NzQsIDB4NzUsIDB4NzYsIDB4NzcsIDB4NzgsCisgLyogMHhBOCAgICAgeSAgICAgeiAgICAgICAgICAgICAgLS0tLSAgLS0tLSAgLS0tLSAgLS0tLSAqLworICAgICAgICAgIDB4NzksIDB4N0EsIDB4QUQsIDB4QUIsIDB4MDcsIDB4MDcsIDB4MDcsIDB4MDcsCisgLyogMHhCMCAgICAgXiAgICAgICAgICAgICAgICAgICAgLS0tLSAgICAggacgIC0tLS0gICAgICAgKi8KKyAgICAgICAgICAweDVFLCAweDlDLCAweDlELCAweEZBLCAweDA3LCAweDA3LCAweDA3LCAweEFDLAorIC8qIDB4QjggICAgICAgIC0tLS0gICAgIFsgICAgIF0gIC0tLS0gIC0tLS0gIC0tLS0gIC0tLS0gKi8KKyAgICAgICAgICAweEFCLCAweDA3LCAweDVCLCAweDVELCAweDA3LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4QzAgICAgIHsgICAgIEEgICAgIEIgICAgIEMgICAgIEQgICAgIEUgICAgIEYgICAgIEcgKi8KKyAgICAgICAgICAweDdCLCAweDQxLCAweDQyLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LAorIC8qIDB4QzggICAgIEggICAgIEkgIC0tLS0gICAgICAgICAgIIH2ICAgICAgICAgICAgICAtLS0tICovCisgICAgICAgICAgMHg0OCwgMHg0OSwgMHgwNywgMHg5MywgMHg5NCwgMHg5NSwgMHhBMiwgMHgwNywKKyAvKiAweEQwICAgICB9ICAgICBKICAgICBLICAgICBMICAgICBNICAgICBOICAgICBPICAgICBQICovCisgICAgICAgICAgMHg3RCwgMHg0QSwgMHg0QiwgMHg0QywgMHg0RCwgMHg0RSwgMHg0RiwgMHg1MCwKKyAvKiAweEQ4ICAgICBRICAgICBSICAtLS0tICAgICAgICAgICCB/CAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgIDB4NTEsIDB4NTIsIDB4MDcsIDB4OTYsIDB4ODEsIDB4OTcsIDB4QTMsIDB4OTgsCisgLyogMHhFMCAgICAgXCAgICAgICAgICAgUyAgICAgVCAgICAgVSAgICAgViAgICAgVyAgICAgWCAqLworICAgICAgICAgIDB4NUMsIDB4RjYsIDB4NTMsIDB4NTQsIDB4NTUsIDB4NTYsIDB4NTcsIDB4NTgsCisgLyogMHhFOCAgICAgWSAgICAgWiAgICAgICAgLS0tLSAgICAggdYgIC0tLS0gIC0tLS0gIC0tLS0gKi8KKyAgICAgICAgICAweDU5LCAweDVBLCAweEZELCAweDA3LCAweDk5LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4RjAgICAgIDAgICAgIDEgICAgIDIgICAgIDMgICAgIDQgICAgIDUgICAgIDYgICAgIDcgKi8KKyAgICAgICAgICAweDMwLCAweDMxLCAweDMyLCAweDMzLCAweDM0LCAweDM1LCAweDM2LCAweDM3LAorIC8qIDB4RjggICAgIDggICAgIDkgIC0tLS0gIC0tLS0gICAgIIHcICAtLS0tICAtLS0tICAtLS0tICovCisgICAgICAgICAgMHgzOCwgMHgzOSwgMHgwNywgMHgwNywgMHg5QSwgMHgwNywgMHgwNywgMHgwNworfTsKKworCisvKgorICogQVNDSUkgKElCTSBQQyA0MzcpICAtPiBFQkNESUMgNTAwCisgKi8KK19fdTggX2FzY2ViY181MDBbMjU2XSA9Cit7CisgLyowMCBOVUwgICBTT0ggICBTVFggICBFVFggICBFT1QgICBFTlEgICBBQ0sgICBCRUwgKi8KKyAgICAgMHgwMCwgMHgwMSwgMHgwMiwgMHgwMywgMHgzNywgMHgyRCwgMHgyRSwgMHgyRiwKKyAvKjA4ICBCUyAgICBIVCAgICBMRiAgICBWVCAgICBGRiAgICBDUiAgICBTTyAgICBTSSAqLworIC8qICAgICAgICAgICAgICAtPk5MICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgIDB4MTYsIDB4MDUsIDB4MTUsIDB4MEIsIDB4MEMsIDB4MEQsIDB4MEUsIDB4MEYsCisgLyoxMCBETEUgICBEQzEgICBEQzIgICBEQzMgICBEQzQgICBOQUsgICBTWU4gICBFVEIgKi8KKyAgICAgMHgxMCwgMHgxMSwgMHgxMiwgMHgxMywgMHgzQywgMHgzRCwgMHgzMiwgMHgyNiwKKyAvKjE4IENBTiAgICBFTSAgIFNVQiAgIEVTQyAgICBGUyAgICBHUyAgICBSUyAgICBVUyAqLworIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+SUdTIC0+SVJTIC0+SVVTICovCisgICAgIDB4MTgsIDB4MTksIDB4M0YsIDB4MjcsIDB4MjIsIDB4MUQsIDB4MUUsIDB4MUYsCisgLyoyMCAgU1AgICAgICEgICAgICIgICAgICMgICAgICQgICAgICUgICAgICYgICAgICcgKi8KKyAgICAgMHg0MCwgMHg0RiwgMHg3RiwgMHg3QiwgMHg1QiwgMHg2QywgMHg1MCwgMHg3RCwKKyAvKjI4ICAgKCAgICAgKSAgICAgKiAgICAgKyAgICAgLCAgICAgLSAgICAuICAgICAgLyAqLworICAgICAweDRELCAweDVELCAweDVDLCAweDRFLCAweDZCLCAweDYwLCAweDRCLCAweDYxLAorIC8qMzAgICAwICAgICAxICAgICAyICAgICAzICAgICA0ICAgICA1ICAgICA2ICAgICA3ICovCisgICAgIDB4RjAsIDB4RjEsIDB4RjIsIDB4RjMsIDB4RjQsIDB4RjUsIDB4RjYsIDB4RjcsCisgLyozOCAgIDggICAgIDkgICAgIDogICAgIDsgICAgIDwgICAgID0gICAgID4gICAgID8gKi8KKyAgICAgMHhGOCwgMHhGOSwgMHg3QSwgMHg1RSwgMHg0QywgMHg3RSwgMHg2RSwgMHg2RiwKKyAvKjQwICAgQCAgICAgQSAgICAgQiAgICAgQyAgICAgRCAgICAgRSAgICAgRiAgICAgRyAqLworICAgICAweDdDLCAweEMxLCAweEMyLCAweEMzLCAweEM0LCAweEM1LCAweEM2LCAweEM3LAorIC8qNDggICBIICAgICBJICAgICBKICAgICBLICAgICBMICAgICBNICAgICBOICAgICBPICovCisgICAgIDB4QzgsIDB4QzksIDB4RDEsIDB4RDIsIDB4RDMsIDB4RDQsIDB4RDUsIDB4RDYsCisgLyo1MCAgIFAgICAgIFEgICAgIFIgICAgIFMgICAgIFQgICAgIFUgICAgIFYgICAgIFcgKi8KKyAgICAgMHhENywgMHhEOCwgMHhEOSwgMHhFMiwgMHhFMywgMHhFNCwgMHhFNSwgMHhFNiwKKyAvKjU4ICAgWCAgICAgWSAgICAgWiAgICAgWyAgICAgXCAgICAgXSAgICAgXiAgICAgXyAqLworICAgICAweEU3LCAweEU4LCAweEU5LCAweDRBLCAweEUwLCAweDVBLCAweDVGLCAweDZELAorIC8qNjAgICBgICAgICBhICAgICBiICAgICBjICAgICBkICAgICBlICAgICBmICAgICBnICovCisgICAgIDB4NzksIDB4ODEsIDB4ODIsIDB4ODMsIDB4ODQsIDB4ODUsIDB4ODYsIDB4ODcsCisgLyo2OCAgIGggICAgIGkgICAgIGogICAgIGsgICAgIGwgICAgIG0gICAgIG4gICAgIG8gKi8KKyAgICAgMHg4OCwgMHg4OSwgMHg5MSwgMHg5MiwgMHg5MywgMHg5NCwgMHg5NSwgMHg5NiwKKyAvKjcwIC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sIDB4M0YsIDB4M0YsCisgLypEMCovCisgICAgIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsCisgLypEOCovCisgICAgIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsIDB4M0YsCisgLypFMCAgICAgICAgc3oJCQkJCQkqLworICAgICAweDNGLCAweDU5LCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRTgqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRjAqLworICAgICAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweDNGLAorIC8qRjgqLworICAgICAweDkwLCAweDNGLCAweDNGLCAweDNGLCAweDNGLCAweEVBLCAweDNGLCAweEZGCit9OworCisvKgorICogRUJDRElDIDUwMCAtPiBBU0NJSSAoSUJNIFBDIDQzNykKKyAqLworX191OCBfZWJjYXNjXzUwMFsyNTZdID0KK3sKKyAvKiAweDAwICAgTlVMICAgU09IICAgU1RYICAgRVRYICAqU0VMICAgIEhUICAqUk5MICAgREVMICovCisgICAgICAgICAgMHgwMCwgMHgwMSwgMHgwMiwgMHgwMywgMHgwNywgMHgwOSwgMHgwNywgMHg3RiwKKyAvKiAweDA4ICAgLUdFICAtU1BTICAtUlBUICAgIFZUICAgIEZGICAgIENSICAgIFNPICAgIFNJICovCisgICAgICAgICAgMHgwNywgMHgwNywgMHgwNywgMHgwQiwgMHgwQywgMHgwRCwgMHgwRSwgMHgwRiwKKyAvKiAweDEwICAgRExFICAgREMxICAgREMyICAgREMzICAtUkVTICAgLU5MICAgIEJTICAtUE9DCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLUVOUCAgLT5MRiAgICAgICAgICAgICAqLworICAgICAgICAgIDB4MTAsIDB4MTEsIDB4MTIsIDB4MTMsIDB4MDcsIDB4MEEsIDB4MDgsIDB4MDcsCisgLyogMHgxOCAgIENBTiAgICBFTSAgLVVCUyAgLUNVMSAgLUlGUyAgLUlHUyAgLUlSUyAgLUlUQgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1JVVMgKi8KKyAgICAgICAgICAweDE4LCAweDE5LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4MjAgICAtRFMgIC1TT1MgICAgRlMgIC1XVVMgIC1CWVAgICAgTEYgICBFVEIgICBFU0MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtSU5QICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgMHgwNywgMHgwNywgMHgxQywgMHgwNywgMHgwNywgMHgwQSwgMHgxNywgMHgxQiwKKyAvKiAweDI4ICAgLVNBICAtU0ZFICAgLVNNICAtQ1NQICAtTUZBICAgRU5RICAgQUNLICAgQkVMCisgICAgICAgICAgICAgICAgICAgICAgIC1TVyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLyAKKyAgICAgICAgICAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA1LCAweDA2LCAweDA3LAorIC8qIDB4MzAgIC0tLS0gIC0tLS0gICBTWU4gICAtSVIgICAtUFAgIC1UUk4gIC1OQlMgICBFT1QgKi8KKyAgICAgICAgICAweDA3LCAweDA3LCAweDE2LCAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDA0LAorIC8qIDB4MzggIC1TQlMgICAtSVQgIC1SRkYgIC1DVTMgICBEQzQgICBOQUsgIC0tLS0gICBTVUIgKi8KKyAgICAgICAgICAweDA3LCAweDA3LCAweDA3LCAweDA3LCAweDE0LCAweDE1LCAweDA3LCAweDFBLAorIC8qIDB4NDAgICAgU1AgICBSU1AgICAgICAgICAgIIHkICAgICAgICAgICAgICAtLS0tICAgICAgICovCisgICAgICAgICAgMHgyMCwgMHhGRiwgMHg4MywgMHg4NCwgMHg4NSwgMHhBMCwgMHgwNywgMHg4NiwKKyAvKiAweDQ4ICAgICAgICAgICAgICAgICBbICAgICAuICAgICA8ICAgICAoICAgICArICAgICAhICovCisgICAgICAgICAgMHg4NywgMHhBNCwgMHg1QiwgMHgyRSwgMHgzQywgMHgyOCwgMHgyQiwgMHgyMSwKKyAvKiAweDUwICAgICAmICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLS0tICovCisgICAgICAgICAgMHgyNiwgMHg4MiwgMHg4OCwgMHg4OSwgMHg4QSwgMHhBMSwgMHg4QywgMHgwNywKKyAvKiAweDU4ICAgICAgICAgICCB3yAgICAgXSAgICAgJCAgICAgKiAgICAgKSAgICAgOyAgICAgXiAqLworICAgICAgICAgIDB4OEQsIDB4RTEsIDB4NUQsIDB4MjQsIDB4MkEsIDB4MjksIDB4M0IsIDB4NUUsCisgLyogMHg2MCAgICAgLSAgICAgLyAgLS0tLSAgICAggcQgIC0tLS0gIC0tLS0gIC0tLS0gICAgICAgKi8KKyAgICAgICAgICAweDJELCAweDJGLCAweDA3LCAweDhFLCAweDA3LCAweDA3LCAweDA3LCAweDhGLAorIC8qIDB4NjggICAgICAgICAgICAgIC0tLS0gICAgICwgICAgICUgICAgIF8gICAgID4gICAgID8gKi8gCisgICAgICAgICAgMHg4MCwgMHhBNSwgMHgwNywgMHgyQywgMHgyNSwgMHg1RiwgMHgzRSwgMHgzRiwKKyAvKiAweDcwICAtLS0tICAgICAgICAtLS0tICAtLS0tICAtLS0tICAtLS0tICAtLS0tICAtLS0tICovCisgICAgICAgICAgMHgwNywgMHg5MCwgMHgwNywgMHgwNywgMHgwNywgMHgwNywgMHgwNywgMHgwNywKKyAvKiAweDc4ICAgICAqICAgICBgICAgICA6ICAgICAjICAgICBAICAgICAnICAgICA9ICAgICAiICovCisgICAgICAgICAgMHg3MCwgMHg2MCwgMHgzQSwgMHgyMywgMHg0MCwgMHgyNywgMHgzRCwgMHgyMiwKKyAvKiAweDgwICAgICAqICAgICBhICAgICBiICAgICBjICAgICBkICAgICBlICAgICBmICAgICBnICovCisgICAgICAgICAgMHgwNywgMHg2MSwgMHg2MiwgMHg2MywgMHg2NCwgMHg2NSwgMHg2NiwgMHg2NywKKyAvKiAweDg4ICAgICBoICAgICBpICAgICAgICAgICAgICAtLS0tICAtLS0tICAtLS0tICAgICAgICovCisgICAgICAgICAgMHg2OCwgMHg2OSwgMHhBRSwgMHhBRiwgMHgwNywgMHgwNywgMHgwNywgMHhGMSwKKyAvKiAweDkwICAgICCBsCAgICAgaiAgICAgayAgICAgbCAgICAgbSAgICAgbiAgICAgbyAgICAgcCAqLworICAgICAgICAgIDB4RjgsIDB4NkEsIDB4NkIsIDB4NkMsIDB4NkQsIDB4NkUsIDB4NkYsIDB4NzAsCisgLyogMHg5OCAgICAgcSAgICAgciAgICAgICAgICAgICAgICAgICAgLS0tLSAgICAgICAgLS0tLSAqLworICAgICAgICAgIDB4NzEsIDB4NzIsIDB4QTYsIDB4QTcsIDB4OTEsIDB4MDcsIDB4OTIsIDB4MDcsCisgLyogMHhBMCAgICAgICAgICAgfiAgICAgcyAgICAgdCAgICAgdSAgICAgdiAgICAgdyAgICAgeCAqLworICAgICAgICAgIDB4RTYsIDB4N0UsIDB4NzMsIDB4NzQsIDB4NzUsIDB4NzYsIDB4NzcsIDB4NzgsCisgLyogMHhBOCAgICAgeSAgICAgeiAgICAgICAgICAgICAgLS0tLSAgLS0tLSAgLS0tLSAgLS0tLSAqLworICAgICAgICAgIDB4NzksIDB4N0EsIDB4QUQsIDB4QUIsIDB4MDcsIDB4MDcsIDB4MDcsIDB4MDcsCisgLyogMHhCMCAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLSAgICAggacgIC0tLS0gICAgICAgKi8KKyAgICAgICAgICAweDlCLCAweDlDLCAweDlELCAweEZBLCAweDA3LCAweDA3LCAweDA3LCAweEFDLAorIC8qIDB4QjggICAgICAgIC0tLS0gICAgICAgICAgIHwgIC0tLS0gIC0tLS0gIC0tLS0gIC0tLS0gKi8KKyAgICAgICAgICAweEFCLCAweDA3LCAweEFBLCAweDdDLCAweDA3LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4QzAgICAgIHsgICAgIEEgICAgIEIgICAgIEMgICAgIEQgICAgIEUgICAgIEYgICAgIEcgKi8KKyAgICAgICAgICAweDdCLCAweDQxLCAweDQyLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LAorIC8qIDB4QzggICAgIEggICAgIEkgIC0tLS0gICAgICAgICAgIIH2ICAgICAgICAgICAgICAtLS0tICovCisgICAgICAgICAgMHg0OCwgMHg0OSwgMHgwNywgMHg5MywgMHg5NCwgMHg5NSwgMHhBMiwgMHgwNywKKyAvKiAweEQwICAgICB9ICAgICBKICAgICBLICAgICBMICAgICBNICAgICBOICAgICBPICAgICBQICovCisgICAgICAgICAgMHg3RCwgMHg0QSwgMHg0QiwgMHg0QywgMHg0RCwgMHg0RSwgMHg0RiwgMHg1MCwKKyAvKiAweEQ4ICAgICBRICAgICBSICAtLS0tICAgICAgICAgICCB/CAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgIDB4NTEsIDB4NTIsIDB4MDcsIDB4OTYsIDB4ODEsIDB4OTcsIDB4QTMsIDB4OTgsCisgLyogMHhFMCAgICAgXCAgICAgICAgICAgUyAgICAgVCAgICAgVSAgICAgViAgICAgVyAgICAgWCAqLworICAgICAgICAgIDB4NUMsIDB4RjYsIDB4NTMsIDB4NTQsIDB4NTUsIDB4NTYsIDB4NTcsIDB4NTgsCisgLyogMHhFOCAgICAgWSAgICAgWiAgICAgICAgLS0tLSAgICAggdYgIC0tLS0gIC0tLS0gIC0tLS0gKi8KKyAgICAgICAgICAweDU5LCAweDVBLCAweEZELCAweDA3LCAweDk5LCAweDA3LCAweDA3LCAweDA3LAorIC8qIDB4RjAgICAgIDAgICAgIDEgICAgIDIgICAgIDMgICAgIDQgICAgIDUgICAgIDYgICAgIDcgKi8KKyAgICAg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9wb3J0MF9kZXYpCisJCXJldHVybiBldHJfcG9ydDBfb25saW5lID8gJmV0cl9wb3J0MCA6IE5VTEw7CisJZWxzZQorCQlyZXR1cm4gZXRyX3BvcnQxX29ubGluZSA/ICZldHJfcG9ydDEgOiBOVUxMOworfQorCitzdGF0aWMgc3NpemVfdCBldHJfb25saW5lX3Nob3coc3RydWN0IGRldmljZSAqZGV2LAorCQkJCXN0cnVjdCBkZXZpY2VfYXR0cmlidXRlICphdHRyLAorCQkJCWNoYXIgKmJ1ZikKK3sKKwl1bnNpZ25lZCBpbnQgb25saW5lOworCisJb25saW5lID0gKGRldiA9PSAmZXRyX3BvcnQwX2RldikgPyBldHJfcG9ydDBfb25saW5lIDogZXRyX3BvcnQxX29ubGluZTsKKwlyZXR1cm4gc3ByaW50ZihidWYsICIlaVxuIiwgb25saW5lKTsKK30KKworc3RhdGljIHNzaXplX3QgZXRyX29ubGluZV9zdG9yZShzdHJ1Y3QgZGV2aWNlICpkZXYsCisJCQkJc3RydWN0IGRldmljZV9hdHRyaWJ1dGUgKmF0dHIsCisJCQkJY29uc3QgY2hhciAqYnVmLCBzaXplX3QgY291bnQpCit7CisJdW5zaWduZWQgaW50IHZhbHVlOworCisJdmFsdWUgPSBzaW1wbGVfc3RydG91bChidWYsIE5VTEwsIDApOworCWlmICh2YWx1ZSAhPSAwICYmIHZhbHVlICE9IDEpCisJCXJldHVybiAtRUlOVkFMOworCWlmICghdGVzdF9iaXQoQ0xPQ0tfU1lOQ19IQVNfRVRSLCAmY2xvY2tfc3luY19mbGFncykpCisJCXJldHVybiAtRU9QTk9UU1VQUDsKKwltdXRleF9sb2NrKCZjbG9ja19zeW5jX211dGV4KTsKKwlpZiAoZGV2ID09ICZldHJfcG9ydDBfZGV2KSB7CisJCWlmIChldHJfcG9ydDBfb25saW5lID09IHZhbHVlKQorCQkJZ290byBvdXQ7CS8qIE5vdGhpbmcgdG8gZG8uICovCisJCWV0cl9wb3J0MF9vbmxpbmUgPSB2YWx1ZT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tPnRocmVhZC50cmFwX3RkYiArIDI0KTsKKwllbHNlCisJCWFkZHJlc3MgPSByZWdzLT5wc3cuYWRkcjsKKwlyZXR1cm4gKHZvaWQgX191c2VyICopCisJCSgoYWRkcmVzcyAtIChyZWdzLT5pbnRfY29kZSA+PiAxNikpICYgUFNXX0FERFJfSU5TTik7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCByZXBvcnRfdXNlcl9mYXVsdChzdHJ1Y3QgcHRfcmVncyAqcmVncywgaW50IHNpZ25yKQoreworCWlmICgodGFza19waWRfbnIoY3VycmVudCkgPiAxKSAmJiAhc2hvd191bmhhbmRsZWRfc2lnbmFscykKKwkJcmV0dXJuOworCWlmICghdW5oYW5kbGVkX3NpZ25hbChjdXJyZW50LCBzaWducikpCisJCXJldHVybjsKKwlpZiAoIXByaW50a19yYXRlbGltaXQoKSkKKwkJcmV0dXJuOworCXByaW50aygiVXNlciBwcm9jZXNzIGZhdWx0OiBpbnRlcnJ1cHRpb24gY29kZSAlMDR4IGlsYzolZCAiLAorCSAgICAgICByZWdzLT5pbnRfY29kZSAmIDB4ZmZmZiwgcmVncy0+aW50X2NvZGUgPj4gMTcpOworCXByaW50X3ZtYV9hZGRyKCJpbiAiLCByZWdzLT5wc3cuYWRkciAmIFBTV19BRERSX0lOU04pOworCXByaW50aygiXG4iKTsKKwlzaG93X3JlZ3MocmVncyk7Cit9CisKK2ludCBpc192YWxpZF9idWdhZGRyKHVuc2lnbmVkIGxvbmcgYWRkcikKK3sKKwlyZXR1cm4gMTsKK30KKwordm9pZCBkb19yZXBvcnRfdHJhcChzdHJ1Y3QgcHRfcmVncyAqcmVncywgaW50IHNpX3NpZ25vLCBpbnQgc2lfY29kZSwgY2hhciAqc3RyKQoreworCXNpZ2luZm9fdCBpbmZvOworCisJaWYgKHVzZXJfbW9kZShyZWdzKSkgeworCQlpbmZvLnNpX3NpZ25vID0gc2lfc2lnbm87CisJCWluZm8uc2lfZXJybm8gPSAwOworCQlpbmZvLnNpX2NvZGUgPSBzaV9jb2RlOworCQlpbmZvLnNpX2FkZHIgPSBnZXRfdHJhcF9pcChyZWdzKTsKKwkJZm9yY2Vfc2lnX2luZm8oc2lfc2lnbm8sICZpbmZvLCBjdXJyZW50KTsKKwkJcmVwb3J0X3VzZXJfZmF1bHQocmVncywgc2lfc2lnbm8pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGNvbnN0IHN0cnVjdCBleGNlcHRpb25fdGFibGVfZW50cnkgKmZpeHVwOworICAgICAgICAgICAgICAgIGZpeHVwID0gc2VhcmNoX2V4Y2VwdGlvbl90YWJsZXMocmVncy0+cHN3LmFkZHIgJiBQU1dfQUREUl9JTlNOKTsKKyAgICAgICAgICAgICAgICBpZiAoZml4dXApCisJCQlyZWdzLT5wc3cuYWRkciA9IGV4dGFibGVfZml4dXAoZml4dXApIHwgUFNXX0FERFJfQU1PREU7CisJCWVsc2UgeworCQkJZW51bSBidWdfdHJhcF90eXBlIGJ0dDsKKworCQkJYnR0ID0gcmVwb3J0X2J1ZyhyZWdzLT5wc3cuYWRkciAmIFBTV19BRERSX0lOU04sIHJlZ3MpOworCQkJaWYgKGJ0dCA9PSBCVUdfVFJBUF9UWVBFX1dBUk4pCisJCQkJcmV0dXJuOworCQkJZGllKHJlZ3MsIHN0cik7CisJCX0KKyAgICAgICAgfQorfQorCitzdGF0aWMgdm9pZCBkb190cmFwKHN0cnVjdCBwdF9yZWdzICpyZWdzLCBpbnQgc2lfc2lnbm8sIGludCBzaV9jb2RlLCBjaGFyICpzdHIpCit7CisJaWYgKG5vdGlmeV9kaWUoRElFX1RSQVAsIHN0ciwgcmVncywgMCwKKwkJICAgICAgIHJlZ3MtPmludF9jb2RlLCBzaV9zaWdubykgPT0gTk9USUZZX1NUT1ApCisJCXJldHVybjsKKwlkb19yZXBvcnRfdHJhcChyZWdzLCBzaV9zaWdubywgc2lfY29kZSwgc3RyKTsKK30KK05PS1BST0JFX1NZTUJPTChkb190cmFwKTsKKwordm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OworCQlicmVhazsKKwlkZWZhdWx0OgorCQlyYyA9IC1FSU5WQUw7CisJfQorCWlmIChyYykKKwkJcmV0dXJuIHJjOworCisJX19mbG9hdGluZ19pcnFfa2ljayhrdm0sIHR5cGUpOworCXJldHVybiAwOworfQorCitpbnQga3ZtX3MzOTBfaW5qZWN0X3ZtKHN0cnVjdCBrdm0gKmt2bSwKKwkJICAgICAgIHN0cnVjdCBrdm1fczM5MF9pbnRlcnJ1cHQgKnMzOTBpbnQpCit7CisJc3RydWN0IGt2bV9zMzkwX2ludGVycnVwdF9pbmZvICppbnRpOworCWludCByYzsKKworCWludGkgPSBremFsbG9jKHNpemVvZigqaW50aSksIEdGUF9LRVJORUwpOworCWlmICghaW50aSkKKwkJcmV0dXJuIC1FTk9NRU07CisKKwlpbnRpLT50eXBlID0gczM5MGludC0+dHlwZTsKKwlzd2l0Y2ggKGludGktPnR5cGUpIHsKKwljYXNlIEtWTV9TMzkwX0lOVF9WSVJUSU86CisJCVZNX0VWRU5UKGt2bSwgNSwgImluamVjdDogdmlydGlvIHBhcm06JXgscGFybTY0OiVsbHgiLAorCQkJIHMzOTBpbnQtPnBhcm0sIHMzOTBpbnQtPnBhcm02NCk7CisJCWludGktPmV4dC5leHRfcGFyYW1zID0gczM5MGludC0+cGFybTsKKwkJaW50aS0+ZXh0LmV4dF9wYXJhbXMyID0gczM5MGludC0+cGFybTY0OworCQlicmVhazsKKwljYXNlIEtWTV9TMzkwX0lOVF9TRVJWSUNFOgorCQlWTV9FVkVOVChrdm0sIDQsICJpbmplY3Q6IHNjbHAgcGFybToleCIsIHMzOTBpbnQtPnBhcm0pOworCQlpbnRpLT5leHQuZXh0X3BhcmFtcyA9IHMzOTBpbnQtPnBhcm07CisJCWJyZWFrOworCWNhc2UgS1ZNX1MzOTBfSU5UX1BGQVVMVF9ET05FOgorCQlpbnRpLT5leHQuZXh0X3BhcmFtczIgPSBzMzkwaW50LT5wYXJtNjQ7CisJCWJyZWFrOworCWNhc2UgS1ZN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SS9PIGludGVycnVwdCIpKQorCitUUkFDRV9FVkVOVChrdm1fczM5MF9pbmplY3Rfdm0sCisJICAgIFRQX1BST1RPKF9fdTY0IHR5cGUsIF9fdTMyIHBhcm0sIF9fdTY0IHBhcm02NCwgaW50IHdobyksCisJICAgIFRQX0FSR1ModHlwZSwgcGFybSwgcGFybTY0LCB3aG8pLAorCisJICAgIFRQX1NUUlVDVF9fZW50cnkoCisJCSAgICBfX2ZpZWxkKF9fdTMyLCBpbnR0eXBlKQorCQkgICAgX19maWVsZChfX3UzMiwgcGFybSkKKwkJICAgIF9fZmllbGQoX191NjQsIHBhcm02NCkKKwkJICAgIF9fZmllbGQoaW50LCB3aG8pCisJCSAgICApLAorCisJICAgIFRQX2Zhc3RfYXNzaWduKAorCQkgICAgX19lbnRyeS0+aW50dHlwZSA9IHR5cGUgJiAweDAwMDAwMDAwZmZmZmZmZmY7CisJCSAgICBfX2VudHJ5LT5wYXJtID0gcGFybTsKKwkJICAgIF9fZW50cnktPnBhcm02NCA9IHBhcm02NDsKKwkJICAgIF9fZW50cnktPndobyA9IHdobzsKKwkJICAgICksCisKKwkgICAgVFBfcHJpbnRrKCJpbmplY3QlczogdHlwZToleCAoJXMpIHBhcm06JXggcGFybTY0OiVsbHgiLAorCQkgICAgICAoX19lbnRyeS0+d2hvID09IDEpID8gIiAoZnJvbSBrZXJuZWwpIiA6CisJCSAgICAgIChfX2VudHJ5LT53aG8gPT0gMikgPyAiIChmcm9tIHVzZXIpIiA6ICIiLAorCQkgICAgICBfX2VudHJ5LT5pbnR0eXBlLCBnZXRfaXJxX25hbWUoX19lbnRyeS0+aW50dHlwZSksCisJCSAgICAgIF9fZW50cnktPnBhcm0sIF9fZW50cnktPnBhcm02NCkKKwkpOworCitUUkFDRV9FVkVOVChrdm1fczM5MF9pbmplY3RfdmNwdSwKKwkgICAgVFBfUFJPVE8odW5zaWduZWQgaW50IGlkLCBfX3U2NCB0eXBlLCBfX3UzMiBwYXJtLCBfX3U2NCBwYX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19maWVsZChfX3UzMiwgaW50dHlwZSkKKwkJICAgIF9fZmllbGQoX191NjQsIGRhdGEwKQorCQkgICAgX19maWVsZChfX3U2NCwgZGF0YTEpCisJCSAgICApLAorCisJICAgIFRQX2Zhc3RfYXNzaWduKAorCQkgICAgX19lbnRyeS0+aWQgPSBpZDsKKwkJICAgIF9fZW50cnktPmludHR5cGUgPSB0eXBlICYgMHgwMDAwMDAwMGZmZmZmZmZmOworCQkgICAgX19lbnRyeS0+ZGF0YTAgPSBkYXRhMDsKKwkJICAgIF9fZW50cnktPmRhdGExID0gZGF0YTE7CisJCSAgICApLAorCisJICAgIFRQX3ByaW50aygiZGVsaXZlciBpbnRlcnJ1cHQgKHZjcHUgJWQpOiB0eXBlOiV4ICglcykgIglcCisJCSAgICAgICJkYXRhOiUwOGxseCAlMDE2bGx4IiwKKwkJICAgICAgX19lbnRyeS0+aWQsIF9fZW50cnktPmludHR5cGUsCisJCSAgICAgIGdldF9pcnFfbmFtZShfX2VudHJ5LT5pbnR0eXBlKSwgX19lbnRyeS0+ZGF0YTAsCisJCSAgICAgIF9fZW50cnktPmRhdGExKQorCSk7CisKKy8qCisgKiBUcmFjZSBwb2ludCBmb3IgcmVzZXRzIHRoYXQgbWF5IGJlIHJlcXVlc3RlZCBmcm9tIHVzZXJzcGFjZS4KKyAqLworVFJBQ0VfRVZFTlQoa3ZtX3MzOTBfcmVxdWVzdF9yZXNldHMsCisJICAgIFRQX1BST1RPKF9fdTY0IHJlc2V0cyksCisJICAgIFRQX0FSR1MocmVzZXRzKSwKKworCSAgICBUUF9TVFJVQ1RfX2VudHJ5KAorCQkgICAgX19maWVsZChfX3U2NCwgcmVzZXRzKQorCQkgICAgKSwKKworCSAgICBUUF9mYXN0X2Fzc2lnbigKKwkJICAgIF9fZW50cnktPnJlc2V0cyA9IHJlc2V0czsKKwkJICAgICksCisKKwkgICAgVFBfcHJpbnRrKCJyZXF1ZXN0aW5nIHVzZXJzcGFjZSByZXNldHMgJWxseCIsCisJ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iAvKiBjbHJiICAqLworCQljYXNlIDB4ZmM6IC8qIGNnaWIgICovCisJCWNhc2UgMHhmZDogLyogY2dsaWIgKi8KKwkJY2FzZSAweGZlOiAvKiBjaWIgICAqLworCQljYXNlIDB4ZmY6IC8qIGNsaWIgICovCisJCQlmaXh1cCA9IEZJWFVQX0JSQU5DSF9OT1RfVEFLRU47CisJCQlicmVhazsKKwkJfQorCQlicmVhazsKKwl9CisJcmV0dXJuIGZpeHVwOworfQorCitpbnQgcHJvYmVfaXNfaW5zbl9yZWxhdGl2ZV9sb25nKHUxNiAqaW5zbikKK3sKKwkvKiBDaGVjayBpZiB3ZSBoYXZlIGEgUklMLWIgb3IgUklMLWMgZm9ybWF0IGluc3RydWN0aW9uIHdoaWNoCisJICogd2UgbmVlZCB0byBtb2RpZnkgaW4gb3JkZXIgdG8gYXZvaWQgaW5zdHJ1Y3Rpb24gZW11bGF0aW9uLiAqLworCXN3aXRjaCAoaW5zblswXSA+PiA4KSB7CisJY2FzZSAweGMwOgorCQlpZiAoKGluc25bMF0gJiAweDBmKSA9PSAweDAwKSAvKiBsYXJsICovCisJCQlyZXR1cm4gdHJ1ZTsKKwkJYnJlYWs7CisJY2FzZSAweGM0OgorCQlzd2l0Y2ggKGluc25bMF0gJiAweDBmKSB7CisJCWNhc2UgMHgwMjogLyogbGxocmwgICovCisJCWNhc2UgMHgwNDogLyogbGdocmwgICovCisJCWNhc2UgMHgwNTogLyogbGhybCAgICovCisJCWNhc2UgMHgwNjogLyogbGxnaHJsICovCisJCWNhc2UgMHgwNzogLyogc3RocmwgICovCisJCWNhc2UgMHgwODogLyogbGdybCAgICovCisJCWNhc2UgMHgwYjogLyogc3RncmwgICovCisJCWNhc2UgMHgwYzogLyogbGdmcmwgICovCisJCWNhc2UgMHgwZDogLyogbHJsICAgICovCisJCWNhc2UgMHgwZTogLyogbGxnZnJsICovCisJCWNhc2UgMHgwZjogLyogc3RybCAgICovCisJCQlyZXR1cm4gdHJ1ZTsKKwkJfQorC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QoreworCXVuc2lnbmVkIGludCBvd25lciwgb2xkOworCWludCBjb3VudCA9IHNwaW5fcmV0cnk7CisKKwlvd25lciA9IDA7CisJd2hpbGUgKDEpIHsKKwkJaWYgKGNvdW50LS0gPD0gMCkgeworCQkJaWYgKG93bmVyICYmICFzbXBfdmNwdV9zY2hlZHVsZWQofm93bmVyKSkKKwkJCQlzbXBfeWllbGRfY3B1KH5vd25lcik7CisJCQljb3VudCA9IHNwaW5fcmV0cnk7CisJCX0KKwkJb2xkID0gQUNDRVNTX09OQ0UocnctPmxvY2spOworCQlvd25lciA9IEFDQ0VTU19PTkNFKHJ3LT5vd25lcik7CisJCXNtcF9tYigpOworCQlpZiAoKGludCkgb2xkID49IDApIHsKKwkJCXByZXYgPSBfX1JBV19MT0NLKCZydy0+bG9jaywgMHg4MDAwMDAwMCwgX19SQVdfT1BfT1IpOworCQkJb2xkID0gcHJldjsKKwkJfQorCQlpZiAoKG9sZCAmIDB4N2ZmZmZmZmYpID09IDAgJiYgKGludCkgcHJldiA+PSAwKQorCQkJYnJlYWs7CisJCWlmIChNQUNISU5FX0hBU19DQUQpCisJCQlfcmF3X2NvbXBhcmVfYW5kX2RlbGF5KCZydy0+bG9jaywgb2xkKTsKKwl9Cit9CitFWFBPUlRfU1lNQk9MKF9yYXdfd3JpdGVfbG9ja193YWl0KTsKKworI2Vsc2UgLyogQ09ORklHX0hBVkVfTUFSQ0hfWjE5Nl9GRUFUVVJFUyAqLworCit2b2lkIF9yYXdfd3JpdGVfbG9ja193YWl0KGFyY2hfcndsb2NrX3QgKnJ3KQoreworCXVuc2lnbmVkIGludCBvd25lciwgb2xkLCBwcmV2OworCWludCBjb3VudCA9IHNwaW5fcmV0cnk7CisKKwlwcmV2ID0gMHg4MDAwMDAwMDsKKwlvd25lciA9IDA7CisJd2hpbGUgKDEpIHsKKwkJaWYgKGNvdW50LS0gPD0gMCkgeworCQkJaWYgKG93bmVyICYmICFzbXBfdmNwdV9zY2hlZHVsZWQofm93bmVyK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m90aGVyIHN0cmluZworICoKKyAqIHJldHVybnMgICAwIGlmIEBjcyBhbmQgQGN0IGFyZSBlcXVhbCwKKyAqICAgICAgICAgPCAwIGlmIEBjcyBpcyBsZXNzIHRoYW4gQGN0CisgKiAgICAgICAgID4gMCBpZiBAY3MgaXMgZ3JlYXRlciB0aGFuIEBjdAorICovCitpbnQgc3RyY21wKGNvbnN0IGNoYXIgKmNzLCBjb25zdCBjaGFyICpjdCkKK3sKKwlyZWdpc3RlciBpbnQgcjAgYXNtKCIwIikgPSAwOworCWludCByZXQgPSAwOworCisJYXNtIHZvbGF0aWxlICgiMDogY2xzdCAlMiwlM1xuIgorCQkgICAgICAiICAgam8gICAwYlxuIgorCQkgICAgICAiICAgamUgICAxZlxuIgorCQkgICAgICAiICAgaWMgICAlMCwwKCUyKVxuIgorCQkgICAgICAiICAgaWMgICAlMSwwKCUzKVxuIgorCQkgICAgICAiICAgc3IgICAlMCwlMVxuIgorCQkgICAgICAiMToiCisJCSAgICAgIDogIitkIiAocmV0KSwgIitkIiAocjApLCAiK2EiIChjcyksICIrYSIgKGN0KQorCQkgICAgICA6IDogImNjIiApOworCXJldHVybiByZXQ7Cit9CitFWFBPUlRfU1lNQk9MKHN0cmNtcCk7CisKKy8qKgorICogc3RycmNociAtIEZpbmQgdGhlIGxhc3Qgb2NjdXJyZW5jZSBvZiBhIGNoYXJhY3RlciBpbiBhIHN0cmluZworICogQHM6IFRoZSBzdHJpbmcgdG8gYmUgc2VhcmNoZWQKKyAqIEBjOiBUaGUgY2hhcmFjdGVyIHRvIHNlYXJjaCBmb3IKKyAqLworY2hhciAqIHN0cnJjaHIoY29uc3QgY2hhciAqIHMsIGludCBjKQoreworICAgICAgIHNpemVfdCBsZW4gPSBfX3N0cmVuZChzKSAtIHM7CisKKyAgICAgICBpZiAobGVuKQorCSAgICAgICBkbyB7CisJCSAgICAgICBpZiAoc1tsZW5dID09IChjaGFyKSBjKQorCQkJICAgICAgIHJldHVybiAoY2hhciAqKSBzIC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ICAgICIrYSIgKHI0KSwgIithIiAocjUpIDogOiAiY2MiICk7CisJCWlmICghY2MpCisJCQlyZXR1cm4gKGNoYXIgKikgczE7CisJCXMxKys7CisJfQorCXJldHVybiBOVUxMOworfQorRVhQT1JUX1NZTUJPTChzdHJzdHIpOworCisvKioKKyAqIG1lbWNociAtIEZpbmQgYSBjaGFyYWN0ZXIgaW4gYW4gYXJlYSBvZiBtZW1vcnkuCisgKiBAczogVGhlIG1lbW9yeSBhcmVhCisgKiBAYzogVGhlIGJ5dGUgdG8gc2VhcmNoIGZvcgorICogQG46IFRoZSBzaXplIG9mIHRoZSBhcmVhLgorICoKKyAqIHJldHVybnMgdGhlIGFkZHJlc3Mgb2YgdGhlIGZpcnN0IG9jY3VycmVuY2Ugb2YgQGMsIG9yICVOVUxMCisgKiBpZiBAYyBpcyBub3QgZm91bmQKKyAqLwordm9pZCAqbWVtY2hyKGNvbnN0IHZvaWQgKnMsIGludCBjLCBzaXplX3QgbikKK3sKKwlyZWdpc3RlciBpbnQgcjAgYXNtKCIwIikgPSAoY2hhcikgYzsKKwljb25zdCB2b2lkICpyZXQgPSBzICsgbjsKKworCWFzbSB2b2xhdGlsZSAoIjA6IHNyc3QgICUwLCUxXG4iCisJCSAgICAgICIgICBqbyAgICAwYlxuIgorCQkgICAgICAiICAgamwJMWZcbiIKKwkJICAgICAgIiAgIGxhICAgICUwLDBcbiIKKwkJICAgICAgIjE6IgorCQkgICAgICA6ICIrYSIgKHJldCksICIrJmEiIChzKSA6ICJkIiAocjApIDogImNjIiApOworCXJldHVybiAodm9pZCAqKSByZXQ7Cit9CitFWFBPUlRfU1lNQk9MKG1lbWNocik7CisKKy8qKgorICogbWVtY21wIC0gQ29tcGFyZSB0d28gYXJlYXMgb2YgbWVtb3J5CisgKiBAY3M6IE9uZSBhcmVhIG9mIG1lbW9yeQorICogQGN0OiBBbm90aGVyIGFyZWEgb2YgbWVtb3J5CisgKiBAY291bnQ6IFRoZSBzaXplIG9mIHRoZSBhcm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IHsKKwkJCWlmIChjbW1fYWxsb2NfcGFnZXMoMSwgJmNtbV90aW1lZF9wYWdlcywKKwkJCQkJICAgJmNtbV90aW1lZF9wYWdlX2xpc3QpKQorCQkJCWNtbV90aW1lZF9wYWdlc190YXJnZXQgPSBjbW1fdGltZWRfcGFnZXM7CisJCX0gZWxzZSBpZiAoY21tX3RpbWVkX3BhZ2VzX3RhcmdldCA8IGNtbV90aW1lZF9wYWdlcykgeworCQkJY21tX2ZyZWVfcGFnZXMoMSwgJmNtbV90aW1lZF9wYWdlcywKKwkJCQkgICAgICAgJmNtbV90aW1lZF9wYWdlX2xpc3QpOworCQl9CisJCWlmIChjbW1fdGltZWRfcGFnZXMgPiAwICYmICF0aW1lcl9wZW5kaW5nKCZjbW1fdGltZXIpKQorCQkJY21tX3NldF90aW1lcigpOworCX0KKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgY21tX2tpY2tfdGhyZWFkKHZvaWQpCit7CisJd2FrZV91cCgmY21tX3RocmVhZF93YWl0KTsKK30KKworc3RhdGljIHZvaWQgY21tX3NldF90aW1lcih2b2lkKQoreworCWlmIChjbW1fdGltZWRfcGFnZXNfdGFyZ2V0IDw9IDAgfHwgY21tX3RpbWVvdXRfc2Vjb25kcyA8PSAwKSB7CisJCWlmICh0aW1lcl9wZW5kaW5nKCZjbW1fdGltZXIpKQorCQkJZGVsX3RpbWVyKCZjbW1fdGltZXIpOworCQlyZXR1cm47CisJfQorCWlmICh0aW1lcl9wZW5kaW5nKCZjbW1fdGltZXIpKSB7CisJCWlmIChtb2RfdGltZXIoJmNtbV90aW1lciwgamlmZmllcyArIGNtbV90aW1lb3V0X3NlY29uZHMqSFopKQorCQkJcmV0dXJuOworCX0KKwljbW1fdGltZXIuZnVuY3Rpb24gPSBjbW1fdGltZXJfZm47CisJY21tX3RpbWVyLmRhdGEgPSAwOworCWNtbV90aW1lci5leHBpcmVzID0gamlmZmllcyArIGNtbV90aW1lb3V0X3NlY29uZHMqSFo7CisJ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VjdCBnbWFwICpnbWFwID0gKHN0cnVjdCBnbWFwICopUzM5MF9sb3djb3JlLmdtYXA7CisJCWFzY2UgPSBnbWFwLT5hc2NlOworCQlwcl9jb250KCJnbWFwICIpOworCX0KKyNlbmRpZgorCWVsc2UgeworCQlhc2NlID0gUzM5MF9sb3djb3JlLnVzZXJfYXNjZTsKKwkJcHJfY29udCgidXNlciAiKTsKKwl9CisJcHJfY29udCgiQVNDRS5cbiIpOworCWR1bXBfcGFnZXRhYmxlKGFzY2UsIHJlZ3MtPmludF9wYXJtX2xvbmcgJiBfX0ZBSUxfQUREUl9NQVNLKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIHJlcG9ydF91c2VyX2ZhdWx0KHN0cnVjdCBwdF9yZWdzICpyZWdzLCBsb25nIHNpZ25yKQoreworCWlmICgodGFza19waWRfbnIoY3VycmVudCkgPiAxKSAmJiAhc2hvd191bmhhbmRsZWRfc2lnbmFscykKKwkJcmV0dXJuOworCWlmICghdW5oYW5kbGVkX3NpZ25hbChjdXJyZW50LCBzaWducikpCisJCXJldHVybjsKKwlpZiAoIXByaW50a19yYXRlbGltaXQoKSkKKwkJcmV0dXJuOworCXByaW50ayhLRVJOX0FMRVJUICJVc2VyIHByb2Nlc3MgZmF1bHQ6IGludGVycnVwdGlvbiBjb2RlICUwNHggaWxjOiVkICIsCisJICAgICAgIHJlZ3MtPmludF9jb2RlICYgMHhmZmZmLCByZWdzLT5pbnRfY29kZSA+PiAxNyk7CisJcHJpbnRfdm1hX2FkZHIoS0VSTl9DT05UICJpbiAiLCByZWdzLT5wc3cuYWRkciAmIFBTV19BRERSX0lOU04pOworCXByaW50ayhLRVJOX0NPTlQgIlxuIik7CisJcHJpbnRrKEtFUk5fQUxFUlQgImZhaWxpbmcgYWRkcmVzczogJTAxNmx4IFRFSUQ6ICUwMTZseFxuIiwKKwkgICAgICAgcmVncy0+aW50X3Bhcm1fbG9uZyAmIF9fRkFJTF9BRERSX01BU0ssIHJlZ3MtPmludF9w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MpKQorCQkJCWRvX25vX2NvbnRleHQocmVncyk7CisJCQllbHNlCisJCQkJZG9fc2lnYnVzKHJlZ3MpOworCQl9IGVsc2UKKwkJCUJVRygpOworCQlicmVhazsKKwl9Cit9CisKKy8qCisgKiBUaGlzIHJvdXRpbmUgaGFuZGxlcyBwYWdlIGZhdWx0cy4gIEl0IGRldGVybWluZXMgdGhlIGFkZHJlc3MsCisgKiBhbmQgdGhlIHByb2JsZW0sIGFuZCB0aGVuIHBhc3NlcyBpdCBvZmYgdG8gb25lIG9mIHRoZSBhcHByb3ByaWF0ZQorICogcm91dGluZXMuCisgKgorICogaW50ZXJydXB0aW9uIGNvZGUgKGludF9jb2RlKToKKyAqICAgMDQgICAgICAgUHJvdGVjdGlvbiAgICAgICAgICAgLT4gIFdyaXRlLVByb3RlY3Rpb24gIChzdXBycmVzc2lvbikKKyAqICAgMTAgICAgICAgU2VnbWVudCB0cmFuc2xhdGlvbiAgLT4gIE5vdCBwcmVzZW50ICAgICAgIChudWxsaWZpY2F0aW9uKQorICogICAxMSAgICAgICBQYWdlIHRyYW5zbGF0aW9uICAgICAtPiAgTm90IHByZXNlbnQgICAgICAgKG51bGxpZmljYXRpb24pCisgKiAgIDNiICAgICAgIFJlZ2lvbiB0aGlyZCB0cmFucy4gIC0+ICBOb3QgcHJlc2VudCAgICAgICAobnVsbGlmaWNhdGlvbikKKyAqLworc3RhdGljIGlubGluZSBpbnQgZG9fZXhjZXB0aW9uKHN0cnVjdCBwdF9yZWdzICpyZWdzLCBpbnQgYWNjZXNzKQoreworI2lmZGVmIENPTkZJR19QR1NURQorCXN0cnVjdCBnbWFwICpnbWFwOworI2VuZGlmCisJc3RydWN0IHRhc2tfc3RydWN0ICp0c2s7CisJc3RydWN0IG1tX3N0cnVjdCAqbW07CisJc3RydWN0IHZtX2FyZWFfc3RydWN0ICp2bWE7CisJdW5zaWduZWQgbG9uZyB0cmFuc19leGNfY29kZTsKKwl1bnNpZ25lZCBsb25nIGFkZHJlc3M7C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bWFzaykgeworCQl0b3AgPSAmcGVyX2NwdShjcHVfdG9wb2xvZ3ksIGNwdSk7CisJCWNwdW1hc2tfY29weSgmdG9wLT50aHJlYWRfbWFzaywgJmNvcmUtPm1hc2spOworCQljcHVtYXNrX2NvcHkoJnRvcC0+Y29yZV9tYXNrLCAmY29yZV9tYyhjb3JlKS0+bWFzayk7CisJCWNwdW1hc2tfY29weSgmdG9wLT5ib29rX21hc2ssICZjb3JlX2Jvb2soY29yZSktPm1hc2spOworCQljcHVtYXNrX3NldF9jcHUoY3B1LCAmbm9kZV90b19jcHVtYXNrX21hcFtjb3JlX25vZGUoY29yZSktPmlkXSk7CisJCXRvcC0+bm9kZV9pZCA9IGNvcmVfbm9kZShjb3JlKS0+aWQ7CisJfQorfQorCisvKgorICogQXBwbHkgdG9wdHJlZSB0byB0b3BvbG9neSBhbmQgY3JlYXRlIENQVSBtYXNrcworICovCitzdGF0aWMgdm9pZCB0b3B0cmVlX3RvX3RvcG9sb2d5KHN0cnVjdCB0b3B0cmVlICpudW1hKQoreworCXN0cnVjdCB0b3B0cmVlICpjb3JlOworCWludCBpOworCisJLyogQ2xlYXIgYWxsIG5vZGUgbWFza3MgKi8KKwlmb3IgKGkgPSAwOyBpIDwgTUFYX05VTU5PREVTOyBpKyspCisJCWNwdW1hc2tfY2xlYXIoJm5vZGVfdG9fY3B1bWFza19tYXBbaV0pOworCisJLyogUmVidWlsZCBhbGwgbWFza3MgKi8KKwl0b3B0cmVlX2Zvcl9lYWNoKGNvcmUsIG51bWEsIENPUkUpCisJCXRvcG9sb2d5X2FkZF9jb3JlKGNvcmUpOworfQorCisvKgorICogU2hvdyB0aGUgbm9kZSB0byBjb3JlIG1hcHBpbmcKKyAqLworc3RhdGljIHZvaWQgcHJpbnRfbm9kZV90b19jb3JlX21hcCh2b2lkKQoreworCWludCBuaWQsIGNpZDsKKworCWlmICghbnVtYV9kZWJ1Z19lbmFibGVkKQorCQlyZXR1cm47CisJcHJpbnRrKEtFUk5fREVC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TlVNQSBjb3JlIGNvZGUuCisgKgorICogQ29weXJpZ2h0IElCTSBDb3JwLiAyMDE1CisgKi8KKworI2RlZmluZSBLTVNHX0NPTVBPTkVOVCAibnVtYSIKKyNkZWZpbmUgcHJfZm10KGZtdCkgS01TR19DT01QT05FTlQgIjogIiBmbXQKKworI2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPgorI2luY2x1ZGUgPGxpbnV4L21tem9uZS5oPgorI2luY2x1ZGUgPGxpbnV4L2NwdW1hc2suaD4KKyNpbmNsdWRlIDxsaW51eC9ib290bWVtLmg+CisjaW5jbHVkZSA8bGludXgvbWVtYmxvY2suaD4KKyNpbmNsdWRlIDxsaW51eC9zbGFiLmg+CisjaW5jbHVkZSA8bGludXgvbm9kZS5oPgorCisjaW5jbHVkZSA8YXNtL251bWEuaD4KKyNpbmNsdWRlICJudW1hX21vZGUuaCIKKworcGdfZGF0YV90ICpub2RlX2RhdGFbTUFYX05VTU5PREVTXTsKK0VYUE9SVF9TWU1CT0wobm9kZV9kYXRhKTsKKworY3B1bWFza190IG5vZGVfdG9fY3B1bWFza19tYXBbTUFYX05VTU5PREVTXTsKK0VYUE9SVF9TWU1CT0wobm9kZV90b19jcHVtYXNrX21hcCk7CisKK2NvbnN0IHN0cnVjdCBudW1hX21vZGUgbnVtYV9tb2RlX3BsYWluID0geworCS5uYW1lID0gInBsYWluIiwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgbnVtYV9tb2RlICptb2RlID0gJm51bWFfbW9kZV9wbGFpbjsKKworaW50IG51bWFfcGZuX3RvX25pZCh1bnNpZ25lZCBsb25nIHBmbikKK3sKKwlyZXR1cm4gbW9kZS0+X19wZm5fdG9fbmlkID8gbW9kZS0+X19wZm5fdG9fbmlkKHBmbikgOiAwOworfQorCit2b2lkIG51bWFfdXBkYXRlX2NwdV90b3BvbG9neSh2b2lkKQoreworCWlmIChtb2RlLT51cGRhdGVfY3B1X3RvcG9sb2d5KQorCQltb2RlLT51cGRh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leHRlcm5hbF9pcnEoRVhUX0lSUV9NRUFTVVJFX0FMRVJULCBod3NfZXh0X2hhbmRsZXIpOworCisJaHdzX3N0YXRlID0gSFdTX0RFQUxMT0NBVEVEOworCXJjID0gMDsKKworc2V0dXBfZXhpdDoKKwltdXRleF91bmxvY2soJmh3c19zZW0pOworCXJldHVybiByYzsKK30KKworaW50IGh3c2FtcGxlcl9zaHV0ZG93bih2b2lkKQoreworCWludCByYzsKKworCW11dGV4X2xvY2soJmh3c19zZW0pOworCisJcmMgPSAtRUlOVkFMOworCWlmIChod3Nfc3RhdGUgPT0gSFdTX0RFQUxMT0NBVEVEIHx8IGh3c19zdGF0ZSA9PSBIV1NfU1RPUFBFRCkgeworCQltdXRleF91bmxvY2soJmh3c19zZW0pOworCisJCWlmIChod3Nfd3EpCisJCQlmbHVzaF93b3JrcXVldWUoaHdzX3dxKTsKKworCQltdXRleF9sb2NrKCZod3Nfc2VtKTsKKworCQlpZiAoaHdzX3N0YXRlID09IEhXU19TVE9QUEVEKSB7CisJCQlpcnFfc3ViY2xhc3NfdW5yZWdpc3RlcihJUlFfU1VCQ0xBU1NfTUVBU1VSRU1FTlRfQUxFUlQpOworCQkJaHdzX2FsZXJ0ID0gMDsKKwkJCWRlYWxsb2NhdGVfc2RidCgpOworCQl9CisJCWlmIChod3Nfd3EpIHsKKwkJCWRlc3Ryb3lfd29ya3F1ZXVlKGh3c193cSk7CisJCQlod3Nfd3EgPSBOVUxMOworCQl9CisKKwkJdW5yZWdpc3Rlcl9leHRlcm5hbF9pcnEoRVhUX0lSUV9NRUFTVVJFX0FMRVJULCBod3NfZXh0X2hhbmRsZXIpOworCQlod3Nfc3RhdGUgPSBIV1NfSU5JVDsKKwkJcmMgPSAwOworCX0KKwltdXRleF91bmxvY2soJmh3c19zZW0pOworCisJdW5yZWdpc3Rlcl9jcHVfbm90aWZpZXIoJmh3c19jcHVfbm90aWZpZXIpOworCisJcmV0dXJuIHJjOworfQorCisvKioKKyAqIGh3c2FtcG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tYXhpbXVtIGJ1ZmZlciBpbmRpY2F0b3IgICAgICAgKi8KKwl1bnNpZ25lZCBpbnQgaDoxOyAgICAgICAgICAgLyogMTogcGFydC4gbGV2ZWwgcmVzZXJ2ZWQgZm9yIFZNIHVzZSovCisJdW5zaWduZWQgbG9uZyBiMl81Mzo1MjsgICAgIC8qIDItNTM6IHplcm9zICAgICAgICAgICAgICAgICAgICAgICAqLworCXVuc2lnbmVkIGludCBlczoxOyAgICAgICAgICAvKiA1NDogc2FtcGxpbmcgZW5hYmxlIGNvbnRyb2wgICAgICAgKi8KKwl1bnNpZ25lZCBpbnQgYjU1XzYxOjc7ICAgICAgLyogNTUtNjE6IC0gemVyb3MgICAgICAgICAgICAgICAgICAgICovCisJdW5zaWduZWQgaW50IGNzOjE7ICAgICAgICAgIC8qIDYyOiBzYW1wbGluZyBhY3RpdmF0aW9uIGNvbnRyb2wgICAqLworCXVuc2lnbmVkIGludCBiNjM6MTsgICAgICAgICAvKiA2MzogemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1bnNpZ25lZCBsb25nIGludGVydmFsOyAgICAgLyogOC0xNTogc2FtcGxpbmcgaW50ZXJ2YWwgICAgICAgICAgICovCisJdW5zaWduZWQgbG9uZyB0ZWFyOyAgICAgICAgIC8qIDE2LTIzOiBURUFSIGNvbnRlbnRzICAgICAgICAgICAgICAqLworCXVuc2lnbmVkIGxvbmcgZGVhcjsgICAgICAgICAvKiAyNC0zMTogREVBUiBjb250ZW50cyAgICAgICAgICAgICAgKi8KKwkvKiAzMi02MzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJdW5zaWduZWQgbG9uZyByc3ZyZDE7ICAgICAgIC8qIHJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCXVuc2lnbmVkIGxvbmcgcnN2cmQyOyAgICAgICAvKiByZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1b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