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Y29tcGFyZShrZXksIHJvb3QtPmtleSk7CisKKwlpZiAocmVzdWx0ID4gMCkgeworCSAgICByb290ID0gcm9vdC0+cmlnaHQ7CisJfSBlbHNlIGlmIChyZXN1bHQgPCAwKSB7CisJICAgIHRlbnRhdGl2ZSA9IHJvb3Q7CisJICAgIHJvb3QgPSByb290LT5sZWZ0OworCX0gZWxzZSB7CisJICAgIGlmICghZGljdC0+ZHVwZXMpIHsKKwkgICAgCXJldHVybiByb290OworCSAgICB9IGVsc2UgeworCQl0ZW50YXRpdmUgPSByb290OworCQlyb290ID0gcm9vdC0+bGVmdDsKKwkgICAgfQorCX0gCisgICAgfQorICAgIAorICAgIHJldHVybiB0ZW50YXRpdmU7Cit9CisKKy8qCisgKiBMb29rIGZvciB0aGUgbm9kZSBjb3JyZXNwb25kaW5nIHRvIHRoZSBncmVhdGVzdCBrZXkgdGhhdCBpcyBlcXVhbCB0byBvcgorICogbG93ZXIgdGhhbiB0aGUgZ2l2ZW4ga2V5LiAgSWYgdGhlcmUgaXMgbm8gc3VjaCBub2RlLCByZXR1cm4gbnVsbC4KKyAqLworCitkbm9kZV90ICpkaWN0X3VwcGVyX2JvdW5kKGRpY3RfdCAqZGljdCwgY29uc3Qgdm9pZCAqa2V5KQoreworICAgIGRub2RlX3QgKnJvb3QgPSBkaWN0X3Jvb3QoZGljdCk7CisgICAgZG5vZGVfdCAqbmlsID0gZGljdF9uaWwoZGljdCk7CisgICAgZG5vZGVfdCAqdGVudGF0aXZlID0gMDsKKworICAgIHdoaWxlIChyb290ICE9IG5pbCkgeworCWludCByZXN1bHQgPSBkaWN0LT5jb21wYXJlKGtleSwgcm9vdC0+a2V5KTsKKworCWlmIChyZXN1bHQgPCAwKSB7CisJICAgIHJvb3QgPSByb290LT5sZWZ0OworCX0gZWxzZSBpZiAocmVzdWx0ID4gMCkgeworCSAgICB0ZW50YXRpdmUgPSByb290OworCSAgICByb290ID0gcm9vdC0+cmlnaHQ7CisJfSBlbHNlIHsKKwkgICA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GxlZnRub2RlKTsKKwkgICAgI2lmbmRlZiBOREVCVUcKKwkgICAgbGVmdG5vZGUtPmxlZnQgPSBOVUxMOwkvKiBzdXBwcmVzcyBhc3NlcnRpb24gaW4gZGljdF9sb2FkX25leHQgKi8KKwkgICAgI2VuZGlmCisJICAgIGRpY3RfbG9hZF9uZXh0KCZsb2FkLCBsZWZ0bm9kZSwgbGVmdG5vZGUtPmtleSk7CisJICAgIGxlZnRub2RlID0gbmV4dDsKKwkgICAgY29udGludWU7CisJfQorCQorICAgIGNvcHlyaWdodDoKKwl7CisJICAgIGRub2RlX3QgKm5leHQgPSBkaWN0X25leHQoc291cmNlLCByaWdodG5vZGUpOworCSAgICAjaWZuZGVmIE5ERUJVRworCSAgICByaWdodG5vZGUtPmxlZnQgPSBOVUxMOworCSAgICAjZW5kaWYKKwkgICAgZGljdF9sb2FkX25leHQoJmxvYWQsIHJpZ2h0bm9kZSwgcmlnaHRub2RlLT5rZXkpOworCSAgICByaWdodG5vZGUgPSBuZXh0OworCSAgICBjb250aW51ZTsKKwl9CisgICAgfQorCisgICAgZGljdF9jbGVhcihzb3VyY2UpOworICAgIGRpY3RfbG9hZF9lbmQoJmxvYWQpOworfQorCisjaWZkZWYgS0FaTElCX1RFU1RfTUFJTgorCisjaW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDxzdHJpbmcuaD4KKyNpbmNsdWRlIDxjdHlwZS5oPgorI2luY2x1ZGUgPHN0ZGFyZy5oPgorCit0eXBlZGVmIGNoYXIgaW5wdXRfdFsyNTZdOworCitzdGF0aWMgaW50IHRva2VuaXplKGNoYXIgKnN0cmluZywgLi4uKQoreworICAgIGNoYXIgKip0b2twdHI7IAorICAgIHZhX2xpc3QgYXJnbGlzdDsKKyAgICBpbnQgdG9rY291bnQgPSAwOworCisgICAgdmFfc3RhcnQoYXJnbGlzdCwgc3RyaW5nKTsKKyAgICB0b2twdHIgPSB2YV9hcmcoYXJnbGlzdCwgY2hhciAqKik7CisgICAgd2hpbGUgKHRva3B0cikgeworCXdoaWxlICgqc3RyaW5nICYmIGlzc3BhY2UoKHVuc2lnbmVkIGNoYXIpICpzdHJpbmcpKQorCSAgICBzdHJpbmcrKzsKKwlpZiAoISpzdHJpbmcpCisJICAgIGJyZWFrOworCSp0b2twdHIgPSBzdHJpbmc7CisJd2hpbGUgKCpzdHJpbmcgJiYgIWlzc3BhY2UoKHVuc2lnbmVkIGNoYXIpICpzdHJpbmcpKQorCSAgICBzdHJpbmcrKzsKKwl0b2twdHIgPSB2YV9hcmcoYXJnbGlzdCwgY2hhciAqKik7CisJdG9rY291bnQrKzsKKwlpZiAoISpzdHJpbmcpCisJICAgIGJyZWFrOworCSpzdHJpbmcrKyA9IDA7CisgICAgfQorICAgIHZhX2VuZChhcmdsaXN0KTsKKworICAgIHJldHVybiB0b2tjb3VudDsKK30KKworc3RhdGljIGludCBjb21wYXJlZihjb25zdCB2b2lkICprZXkxLCBjb25zdCB2b2lkICprZXkyKQoreworICAgIHJldHVybiBzdHJjbXAoa2V5MSwga2V5Mik7Cit9CisKK3N0YXRpYyBjaGFyICpkdXBzdHJpbmcoY2hhciAqc3RyKQoreworICAgIGludCBzeiA9IHN0cmxlbihzdHIpICsgMTsKKyAgICBjaGFyICpuZXcgPSBtYWxsb2Moc3opOworICAgIGlmIChuZXcpCisJbWVtY3B5KG5ldywgc3RyLCBzeik7CisgICAgcmV0dXJuIG5ldzsKK30KKworc3RhdGljIGRub2RlX3QgKm5ld19ub2RlKHZvaWQgKmMpCit7CisgICAgc3RhdGljIGRub2RlX3QgZmV3WzVdOworICAgIHN0YXRpYyBpbnQgY291bnQ7CisKKyAgICBpZiAoY291bnQgPCA1KQorCXJldHVybiBmZXcgKyBjb3VudCsrOworCisgICAgcmV0dXJuIE5VTEw7Cit9CisKK3N0YXRpYyB2b2lkIGRlbF9ub2RlKGRub2RlX3QgKm4sIHZvaWQgKmMpCit7Cit9CisKK3N0YXRpYyBpbnQgcHJvbXB0ID0gMDsKKworc3RhdGljIHZvaWQgY29uc3RydWN0KGRpY3RfdCAqZCkKK3sKKyAgICBpbnB1dF90IGluOworICAgIGludCBkb25lID0gMDsKKyAgICBkaWN0X2xvYWRfdCBkbDsKKyAgICBkbm9kZV90ICpkbjsKKyAgICBjaGFyICp0b2sxLCAqdG9rMiwgKnZhbDsKKyAgICBjb25zdCBjaGFyICprZXk7CisgICAgY2hhciAqaGVscCA9IAorCSJwICAgICAgICAgICAgICAgICAgICAgIHR1cm4gcHJvbXB0IG9uXG4iCisJInEgICAgICAgICAgICAgICAgICAgICAgZmluaXNoIGNvbnN0cnVjdGlvblxuIgorCSJhIDxrZXk+IDx2YWw+ICAgICAgICAgIGFkZCBuZXcgZW50cnlcbiI7CisKKyAgICBpZiAoIWRpY3RfaXNlbXB0eShkKSkKKwlwdXRzKCJ3YXJuaW5nOiBkaWN0aW9uYXJ5IG5vdCBlbXB0eSEiKTsKKworICAgIGRpY3RfbG9hZF9iZWdpbigmZGwsIGQpOworCisgICAgd2hpbGUgKCFkb25lKSB7CisJaWYgKHByb21wdCkKKwkgICAgcHV0Y2hhcignPicpOworCWZmbHVzaChzdGRvdXQpOworCisJaWYgKCFmZ2V0cyhpbiwgc2l6ZW9mKGlucHV0X3QpLCBzdGRpbikpCisJICAgIGJyZWFrOworCisJc3dpdGNoIChpblswXSkgeworCSAgICBjYXNlICc/JzoKKwkJcHV0cyhoZWxwKTsKKwkJYnJlYWs7CisJICAgIGNhc2UgJ3AnOgorCQlwcm9tcHQgPSAxOworCQlicmVhazsKKwkgICAgY2FzZSAncSc6CisJCWRvbmUgPSAxOworCQlicmVhazsKKwkgICAgY2FzZSAnYSc6CisJCWlmICh0b2tlbml6ZShpbisxLCAmdG9rMSwgJnRvazIsIChjaGFyICoqKSAwKSAhPSAyKSB7CisJCSAgICBwdXRzKCJ3aGF0PyIpOworCQkgICAgYnJlYWs7CisJCX0KKwkJa2V5ID0gZHVwc3RyaW5nKHRvazEpOworCQl2YWwgPSBkdXBzdHJpbmcodG9rMik7CisJCWRuID0gZG5vZGVfY3JlYXRlKHZhbCk7CisKKwkJaWYgKCFrZXkgfHwgIXZhbCB8fCAhZG4pIHsKKwkJICAgIHB1dHMoIm91dCBvZiBtZW1vcnkiKTsKKwkJICAgIGZyZWUoKHZvaWQgKikga2V5KTsKKwkJICAgIGZyZWUodmFsKTsKKwkJICAgIGlmIChkbikKKwkJCWRub2RlX2Rlc3Ryb3koZG4pOworCQl9CisKKwkJZGljdF9sb2FkX25leHQoJmRsLCBkbiwga2V5KTsKKwkJYnJlYWs7CisJICAgIGRlZmF1bHQ6CisJCXB1dGNoYXIoJz8nKTsKKwkJcHV0Y2hhcignXG4nKTsKKwkJYnJlYWs7CisJfQorICAgIH0KKworICAgIGRpY3RfbG9hZF9lbmQoJmRsKTsKK30KKworaW50IG1haW4odm9pZCkKK3sKKyAgICBpbnB1dF90IGluOworICAgIGRpY3RfdCBkYXJyYXlbMTBdOworICAgIGRpY3RfdCAqZCA9ICZkYXJyYXlbMF07CisgICAgZG5vZGVfdCAqZG47CisgICAgaW50IGk7CisgICAgY2hhciAqdG9rMSwgKnRvazIsICp2YWw7CisgICAgY29uc3QgY2hhciAqa2V5OworCisgICAgY2hhciAqaGVscCA9CisJImEgPGtleT4gPHZhbD4gICAgICAgICAgYWRkIHZhbHVlIHRvIGRpY3Rpb25hcnlcbiIKKwkiZCA8a2V5PiAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWUgZnJvbSBkaWN0aW9uYXJ5XG4iCisJImwgPGtleT4gICAgICAgICAgICAgICAgbG9va3VwIHZhbHVlIGluIGRpY3Rpb25hcnlcbiIKKwkiKCA8a2V5PiAgICAgICAgICAgICAgICBsb29rdXAgbG93ZXIgYm91bmRcbiIKKwkiKSA8a2V5PiAgICAgICAgICAgICAgICBsb29rdXAgdXBwZXIgYm91bmRcbiIKKwkiIyA8bnVtPiAgICAgICAgICAgICAgICBzd2l0Y2ggdG8gYWx0ZXJuYXRlIGRpY3Rpb25hcnkgKDAtOSlcbiIKKwkiaiA8bnVtPiA8bnVtPiAgICAgICAgICBtZXJnZSB0d28gZGljdGlvbmFyaWVzXG4iCisJImYgICAgICAgICAgICAgICAgICAgICAgZnJlZSB0aGUgd2hvbGUgZGljdGlvbmFyeVxuIgorCSJrICAgICAgICAgICAgICAgICAgICAgIGFsbG93IGR1cGxpY2F0ZSBrZXlzXG4iCisJImMgICAgICAgICAgICAgICAgICAgICAgc2hvdyBudW1iZXIgb2YgZW50cmllc1xuIgorCSJ0ICAgICAgICAgICAgICAgICAgICAgIGR1bXAgd2hvbGUgZGljdGlvbmFyeSBpbiBzb3J0IG9yZGVyXG4iCisJIm0gICAgICAgICAgICAgICAgICAgICAgbWFrZSBkaWN0aW9uYXJ5IG91dCBvZiBzb3J0ZWQgaXRlbXNcbiIKKwkicCAgICAgICAgICAgICAgICAgICAgICB0dXJuIHByb21wdCBvblxuIgorCSJzICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCB0byBub24tZnVuY3Rpb25pbmcgYWxsb2NhdG9yXG4iCisJInEgICAgICAgICAgICAgICAgICAgICAgcXVpdCI7CisKKyAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZW9mIGRhcnJheSAvIHNpemVvZiAqZGFycmF5OyBpKyspCisJZGljdF9pbml0KCZkYXJyYXlbaV0sIERJQ1RDT1VOVF9UX01BWCwgY29tcGFyZWYpOworCisgICAgZm9yICg7OykgeworCWlmIChwcm9tcHQpCisJICAgIHB1dGNoYXIoJz4nKTsKKwlmZmx1c2goc3Rkb3V0KTsKKworCWlmICghZmdldHMoaW4sIHNpemVvZihpbnB1dF90KSwgc3RkaW4pKQorCSAgICBicmVhazsKKworCXN3aXRjaChpblswXSkgeworCSAgICBjYXNlICc/JzoKKwkJcHV0cyhoZWxwKTsKKwkJYnJlYWs7CisJICAgIGNhc2UgJ2EnOgorCQlpZiAodG9rZW5pemUoaW4rMSwgJnRvazEsICZ0b2syLCAoY2hhciAqKikgMCkgIT0gMikgeworCQkgICAgcHV0cygid2hhdD8iKTsKKwkJICAgIGJyZWFrOworCQl9CisJCWtleSA9IGR1cHN0cmluZyh0b2sxKTsKKwkJdmFsID0gZHVwc3RyaW5nKHRvazIpOworCisJCWlmICgha2V5IHx8ICF2YWwpIHsKKwkJICAgIHB1dHMoIm91dCBvZiBtZW1vcnkiKTsKKwkJICAgIGZyZWUoKHZvaWQgKikga2V5KTsKKwkJICAgIGZyZWUodmFsKTsKKwkJfQorCisJCWlmICghZGljdF9hbGxvY19pbnNlcnQoZCwga2V5LCB2YWwpKSB7CisJCSAgICBwdXRzKCJkaWN0X2FsbG9jX2luc2VydCBmYWlsZWQiKTsKKwkJICAgIGZyZWUoKHZvaWQgKikga2V5KTsKKwkJICAgIGZyZWUodmFsKTsKKwkJICAgIGJyZWFrOworCQl9CisJCWJyZWFrOworCSAgICBjYXNlICdkJzoKKwkJaWYgKHRva2VuaXplKGluKzEsICZ0b2sxLCAoY2hhciAqKikgMCkgIT0gMSkgeworCQkgICAgcHV0cygid2hhdD8iKTsKKwkJICAgIGJyZWFrOworCQl9CisJCWRuID0gZGljdF9sb29rdXAoZCwgdG9rMSk7CisJCWlmICghZG4pIHsKKwkJICAgIHB1dHMoImRpY3RfbG9va3VwIGZhaWxlZCIpOworCQkgICAgYnJlYWs7CisJCX0KKwkJdmFsID0gZG5vZGVfZ2V0KGRuKTsKKwkJa2V5ID0gZG5vZGVfZ2V0a2V5KGRuKTsKKwkJZGljdF9kZWxldGVfZnJlZShkLCBkbik7CisKKwkJZnJlZSh2YWwpOworCQlmcmVlKCh2b2lkICopIGtleSk7CisJCWJyZWFrOworCSAgICBjYXNlICdmJzoKKwkJZGljdF9mcmVlKGQpOworCQlicmVhazsKKwkgICAgY2FzZSAnbCc6CisJICAgIGNhc2UgJygnOgorCSAgICBjYXNlICcpJzoKKwkJaWYgKHRva2VuaXplKGluKzEsICZ0b2sxLCAoY2hhciAqKikgMCkgIT0gMSkgeworCQkgICAgcHV0cygid2hhdD8iKTsKKwkJICAgIGJyZWFrOworCQl9CisJCWRuID0gMDsKKwkJc3dpdGNoIChpblswXSkgeworCQljYXNlICdsJzoKKwkJICAgIGRuID0gZGljdF9sb29rdXAoZCwgdG9rMSk7CisJCSAgICBicmVhazsKKwkJY2FzZSAnKCc6CisJCSAgICBkbiA9IGRpY3RfbG93ZXJfYm91bmQoZCwgdG9rMSk7CisJCSAgICBicmVhazsKKwkJY2FzZSAnKSc6CisJCSAgICBkbiA9IGRpY3RfdXBwZXJfYm91bmQoZCwgdG9rMSk7CisJCSAgICBicmVhazsKKwkJfQorCQlpZiAoIWRuKSB7CisJCSAgICBwdXRzKCJsb29rdXAgZmFpbGVkIik7CisJCSAgICBicmVhazsKKwkJfQorCQl2YWwgPSBkbm9kZV9nZXQoZG4pOworCQlwdXRzKHZhbCk7CisJCWJyZWFrOworCSAgICBjYXNlICdtJzoKKwkJY29uc3RydWN0KGQpOworCQlicmVhazsKKwkgICAgY2FzZSAnayc6CisJCWRpY3RfYWxsb3dfZHVwZXMoZCk7CisJCWJyZWFrOworCSAgICBjYXNlICdjJzoKKwkJcHJpbnRmKCIlbHVcbiIsICh1bnNpZ25lZCBsb25nKSBkaWN0X2NvdW50KGQpKTsKKwkJYnJlYWs7CisJICAgIGNhc2UgJ3QnOgorCQlmb3IgKGRuID0gZGljdF9maXJzdChkKTsgZG47IGRuID0gZGljdF9uZXh0KGQsIGRuKSkgeworCQkgICAgcHJpbnRmKCIlc1x0JXNcbiIsIChjaGFyICopIGRub2RlX2dldGtleShkbiksCisJCQkgICAgKGNoYXIgKikgZG5vZGVfZ2V0KGRuKSk7CisJCX0KKwkJYnJlYWs7CisJICAgIGNhc2UgJ3EnOgorCQlleGl0KDApOworCQlicmVhazsKKwkgICAgY2FzZSAnXDAnOgorCQlicmVhazsKKwkgICAgY2FzZSAncCc6CisJCXByb21wdCA9IDE7CisJCWJyZWFrOworCSAgICBjYXNlICdzJzoKKwkJZGljdF9zZXRfYWxsb2NhdG9yKGQsIG5ld19ub2RlLCB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ICopKHNhKSkKKyNkZWZpbmUJc2lzb3Rvc2Eoc2lzbykJKChzdHJ1Y3Qgc29ja2FkZHIgKikoc2lzbykpCisKKyNlbHNlCisvKiB1c2VyIHV0aWxpdGllcyBkZWZpbml0aW9ucyBmcm9tIHRoZSBpc28gbGlicmFyeSAqLworCisjaW5jbHVkZSA8c3lzL2NkZWZzLmg+CisKK19fQkVHSU5fREVDTFMKK3N0cnVjdCBpc29fYWRkciAqaXNvX2FkZHIgX19QKChjb25zdCBjaGFyICopKTsKK2NoYXIgICAgICAgICAgICppc29fbnRvYSBfX1AoKGNvbnN0IHN0cnVjdCBpc29fYWRkciAqKSk7CisKKy8qIFRIRVNFIERPTidUIEVYSVNUIFlFVCAqLworc3RydWN0IGhvc3RlbnQgKmlzb19nZXRob3N0YnluYW1lIF9fUCgoY29uc3QgY2hhciAqKSk7CitzdHJ1Y3QgaG9zdGVudCAqaXNvX2dldGhvc3RieWFkZHIgX19QKChjb25zdCBjaGFyICosIGludCwgaW50KSk7CitfX0VORF9ERUNMUworCisjZW5kaWYgLyogX0tFUk5FTCAqLworCisjZW5kaWYgLyogX05FVElTT19JU09fSF8gKi8KZGlmZiAtLWdpdCBhL2lzaXNkL2lzaXNfYWRqYWNlbmN5LmMgYi9pc2lzZC9pc2lzX2FkamFjZW5jeS5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjgwNzliZDEKLS0tIC9kZXYvbnVsbAorKysgYi9pc2lzZC9pc2lzX2FkamFjZW5jeS5jCkBAIC0wLDAgKzEsNTA4IEBACisvKgorICogSVMtSVMgUm91dChlKWluZyBwcm90b2NvbCAtIGlzaXNfYWRqYWNlbmN5LmMgICAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGluZyBvZiBJUy1JUyBhZGphY2VuY2llcworICoKKyAqIENvcHlyaWdodCAoQykgMjAwMSwyMDAyICAgU2FtcG8gU2FhcmlzdG8KKyAqICAgICAgICAgICAgICAg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AKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqcmVhc29uKQorCit7CisgIGludCBvbGRfc3RhdGU7CisgIGludCBsZXZlbCA9IGFkai0+bGV2ZWw7CisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIAorICBvbGRfc3RhdGUgPSBhZGotPmFkal9zdGF0ZTsKKyAgYWRqLT5hZGpfc3RhdGUgPSBzdGF0ZTsKKworICBjaXJjdWl0ID0gYWRqLT5jaXJjdWl0OworICAKKyAgaWYgKGlzaXMtPmRlYnVncyAmIERFQlVHX0FESl9QQUNLRVRTKSB7CisgICAgemxvZ19pbmZvICgiSVNJUy1BZGogKCVzKTogQWRqYWNlbmN5IHN0YXRlIGNoYW5nZSAlZC0+JWQ6ICVzIiwKKyAgICAgICAgICAgICAgIGNpcmN1aXQtPmFyZWEtPmFyZWFfdGFnLAorICAgICAgICAgICAgICAgb2xkX3N0YXRlLAorICAgICAgICAgICAgICAgc3RhdGUsIAorICAgICAgICAgICAgICAgcmVhc29uID8gcmVhc29uIDogInVuc3BlY2lmaWVkIik7CisgIH0KKworICBpZiAoY2lyY3VpdC0+Y2lyY190eXBlID09IENJUkNVSVRfVF9CUk9BRENBU1QpIHsKKyAgICBpZiAoc3RhdGUgPT0gSVNJU19BREpfVVApCisgICAgICBjaXJjdWl0LT51cGFkamNvdW50W2xldmVsLTFdKys7CisgICAgaWYgKHN0YXRlID09IElTSVNfQURKX0RPV04pIHsKKyAgICAgIGlzaXNfZGVsZXRlX2FkaiAoYWRqLCBhZGotPmNpcmN1aXQtPnUuYmMuYWRqZGJbbGV2ZWwgLSAxXSk7CisgICAgICBjaXJjdWl0LT51cGFkamNvdW50W2xldmVsLTFdLS07CisgICAgfQorCisgICAgbGlzdF9kZWxldGVfYWxsX25vZGUgKGNpcmN1aXQtPnUuYmMubGFuX25laWdoc1tsZXZlbCAtIDFdKTsKKyAgICBpc2lzX2Fkal9idWlsZF9uZWlnaF9saXN0IChjaXJjdWl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VmIEhBVkVfSVBWNiAKKyAgc3RydWN0IGluNl9hZGRyICppcHY2X2FkZHI7CisgIHVfY2hhciBpcDYgW0lORVQ2X0FERFJTVFJMRU5dOworI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworICAKKyAgaWYoIWFkaikKKyAgICByZXR1cm47CisgIGR5biA9IGR5bmhuX2ZpbmRfYnlfaWQgKGFkai0+c3lzaWQpOworICBpZiAoZHluKQorICAgIHpsb2dfaW5mbyAoIiVzIiwgZHluLT5uYW1lLm5hbWUpOworICAKKyAgemxvZ19pbmZvICgiU3lzdGVtSWQgJTIwcyBTTlBBICVzLCBsZXZlbCAlZFxuSG9sZGluZyBUaW1lICVkIiwKKyAgICAgICAgICAgICBhZGotPnN5c2lkID8gc3lzaWRfcHJpbnQgKGFkai0+c3lzaWQpIDogInVua25vd24iICwgCisgICAgICAgICAgICAgc25wYV9wcmludCAoYWRqLT5zbnBhKSwKKyAgICAgICAgICAgICBhZGotPmxldmVsLCBhZGotPmhvbGRfdGltZSk7CisgIGlmIChhZGotPmlwdjRfYWRkcnMgJiYgbGlzdGNvdW50IChhZGotPmlwdjRfYWRkcnMpID4gMCkgeworICAgIHpsb2dfaW5mbyAoIklQdjQgQWRkcmVzc2VzOiIpOworICAgIAorICAgIGZvciAobm9kZSA9IGxpc3RoZWFkIChhZGotPmlwdjRfYWRkcnMpOyBub2RlOyBuZXh0bm9kZSAobm9kZSkpIHsKKyAgICAgIGlwdjRfYWRkciA9IGdldGRhdGEgKG5vZGUpOworICAgICAgemxvZ19pbmZvICgiJXMiLCBpbmV0X250b2EoKmlwdjRfYWRkcikpOworICAgIH0KKyAgfQorCisjaWZkZWYgSEFWRV9JUFY2ICAKKyAgaWYgKGFkai0+aXB2Nl9hZGRycyAmJiBsaXN0Y291bnQgKGFkai0+aXB2Nl9hZGRycykgPiAwKSB7CisgICAgemxvZ19pbmZvICgiSVB2NiBBZGRyZXNzZXM6Iik7CisgICAgZm9yIChub2RlID0gbGlzdGhlYWQgKGFkai0+aXB2Nl9hZGRycyk7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgICAgaXB2Nl9hZGRyID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgICBpbmV0X250b3AgKEFGX0lORVQ2LCBpcHY2X2FkZHIsIGlwNiwgSU5FVDZfQUREUlNUUkxFTik7IAorICAgICAgemxvZ19pbmZvICgiJXMiLCBpcDYpOworICAgIH0KKyAgfQorI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworICB6bG9nX2luZm8gKCJTcGVha3M6ICVzIiwgbmxwaWQyc3RyaW5nKCZhZGotPm5scGlkcykpOworICAKKworICByZXR1cm47Cit9CisKK2ludCAKK2lzaXNfYWRqX2V4cGlyZSAoc3RydWN0IHRocmVhZCAqdGhyZWFkKQoreworICBzdHJ1Y3QgaXNpc19hZGphY2VuY3kgKmFkajsKKyAgaW50IGxldmVsOworCisgIC8qCisgICAqIEdldCB0aGUgYWRqYWNlbmN5CisgICAqLworICBhZGogPSBUSFJFQURfQVJHICh0aHJlYWQpOworICBhc3NlcnQgKGFkaik7CisgIGxldmVsID0gYWRqLT5sZXZlbDsKKworICAvKiB0cmlnZ2VyIHRoZSBhZGogZXhwaXJlIGV2ZW50ICovCisgIGlzaXNfYWRqX3N0YXRlX2NoYW5nZSAoYWRqLCBJU0lTX0FESl9ET1dOLCAiaG9sZGluZyB0aW1lIGV4cGlyZWQiKTsKKworICByZXR1cm4gMDsKK30KKworY29uc3QgY2hhciAqCithZGpfc3RhdGUyc3RyaW5nIChpbnQgc3RhdGUpCit7CisgIAorICBzd2l0Y2ggKHN0YXRlKSB7CisgIGNhc2UgSVNJU19BREpfSU5JVElBTElaSU5HOgorICAgIHJldHVybiAiSW5pdGlhbGl6aW5nIjsKKyAgY2FzZSBJU0lTX0FESl9VUDoKKyAgICByZXR1cm4gIlVwIjsKKyAgY2FzZSBJU0lTX0FESl9ET1dOOgorICAgIHJldHVybiAiRG93biI7CisgIGRlZmF1bHQ6CisgICAgcmV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G5vdykpOworICAgIHZ0eV9vdXQgKHZ0eSwgIiVzICAgIEFkamFjZW5jeSBmbGFwczogJXUiLAorCSAgICAgVlRZX05FV0xJTkUsCisJICAgICBhZGotPmZsYXBzKTsKKyAgICB2dHlfb3V0ICh2dHksICIsIExhc3Q6ICVzIGFnbyIsIHRpbWUyc3RyaW5nKG5vdyAtIGFkai0+bGFzdF9mbGFwKSk7CisgICAgdnR5X291dCAodnR5LCAiJXMgICAgQ2lyY3VpdCB0eXBlOiAlcyIsCisJICAgICBWVFlfTkVXTElORSwKKwkgICAgIGNpcmN1aXRfdDJzdHJpbmcoYWRqLT5jaXJjdWl0X3QpKTsKKyAgICB2dHlfb3V0ICh2dHksICIsIFNwZWFrczogJXMiLCBubHBpZDJzdHJpbmcoJmFkai0+bmxwaWRzKSk7CisgICAgdnR5X291dCAodnR5LCAiJXMgICAgU05QQTogJXMiLAorCSAgICAgVlRZX05FV0xJTkUsCisJICAgICBzbnBhX3ByaW50IChhZGotPnNucGEpKTsgICAKKyAgICBkeW4gPSBkeW5obl9maW5kX2J5X2lkIChhZGotPmxhbmlkKTsKKyAgICBpZiAoZHluKQorICAgICAgdnR5X291dCAodnR5LCAiLCBMQU4gaWQ6ICVzLiUwMngiLAorCSAgICAgICBkeW4tPm5hbWUubmFtZSwKKwkgICAgICAgYWRqLT5sYW5pZFtJU0lTX1NZU19JRF9MRU5dKTsKKyAgICBlbHNlIAorICAgICAgdnR5X291dCAodnR5LCAiLCBMQU4gaWQ6ICVzLiUwMngiLAorCSAgICAgICBzeXNpZF9wcmludCAoYWRqLT5sYW5pZCksCisJICAgICAgIGFkai0+bGFuaWRbSVNJU19TWVNfSURfTEVOXSk7CisgICAgCisgICAgdnR5X291dCAodnR5LCAiJXMgICAgUHJpb3JpdHk6ICV1IiwKKwkgICAgIFZUWV9ORVdMSU5FLAorCSAgICAgYWRqLT5wcmlvW2Fkai0+bGV2ZWwtMV0pOworCisgICAgdnR5X291dCAodnR5LCAiLCAlcywgRElTI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VpbGRfbmVpZ2hfbGlzdCgpOiBOVUxMIGxpc3QiKTsKKyAgICByZXR1cm47CisgIH0KKyAgCisgIGZvciAobm9kZSA9IGxpc3RoZWFkIChhZGpkYik7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgIGFkaiA9IGdldGRhdGEgKG5vZGUpOworICAgIGlmICghYWRqKSB7CisgICAgICB6bG9nX3dhcm4gKCJpc2lzX2Fkal9idWlsZF9uZWlnaF9saXN0KCk6IE5VTEwgYWRqIik7CisgICAgICByZXR1cm47CisgICAgfQorICAKKyAgICBpZiAoKGFkai0+YWRqX3N0YXRlID09IElTSVNfQURKX1VQIHx8IAorICAgICAgIGFkai0+YWRqX3N0YXRlID09IElTSVNfQURKX0lOSVRJQUxJWklORykpCisgICAgICBsaXN0bm9kZV9hZGQgKGxpc3QsIGFkai0+c25wYSk7CisgIH0KKyAgcmV0dXJuOworfQorCit2b2lkCitpc2lzX2Fkal9idWlsZF91cF9saXN0IChzdHJ1Y3QgbGlzdCAqYWRqZGIsIHN0cnVjdCBsaXN0ICpsaXN0KQoreworICBzdHJ1Y3QgaXNpc19hZGphY2VuY3kgKmFkajsKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlOworCisgIGlmICghbGlzdCkgeworICAgIHpsb2dfd2FybiAoImlzaXNfYWRqX2J1aWxkX3VwX2xpc3QoKTogTlVMTCBsaXN0Iik7CisgICAgcmV0dXJuOworICB9CisKKyAgZm9yIChub2RlID0gbGlzdGhlYWQgKGFkamRiKTsgbm9kZTsgbmV4dG5vZGUgKG5vZGUpKSB7CisgICAgYWRqID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgCisgICAgaWYgKCFhZGopIHsKKyAgICAgIHpsb2dfd2FybiAoImlzaXNfYWRqX2J1aWxkX3VwX2xpc3QoKTogTlVMTCBhZGoiKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBpZiAoYWRqLT5hZGpfc3RhdGUgPT0gSVNJU19BREpfVVApCisgICAgICBs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b19pbnRlcnZhbFsxXSk7IAorICB9IGVsc2UgeworICAgIC8qIGluaXRpYWxpemluZyB0aGUgaGVsbG8gc2VuZCB0aHJlYWRzCisgICAgICogZm9yIGEgcHRwIElGCisgICAgICovCisgICAgdGhyZWFkX2FkZF9ldmVudCAobWFzdGVyLCBzZW5kX3AycF9oZWxsbywgY2lyY3VpdCwgMCk7CisKKyAgfQorCisgIC8qIGluaXRpYWxpemluZyBQU05QIHRpbWVycyAqLworICBpZiAoY2lyY3VpdC0+Y2lyY3VpdF9pc190eXBlICYgSVNfTEVWRUxfMSkgeworICAgIGNpcmN1aXQtPnRfc2VuZF9wc25wWzBdID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZF9sMV9wc25wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzaXNfaml0dGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2lyY3VpdC0+cHNucF9pbnRlcnZhbFswXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU05QX0pJVFRFUikpOworICB9CisgIAorICBpZiAoY2lyY3VpdC0+Y2lyY3VpdF9pc190eXBlICYgSVNfTEVWRUxfMikgeworICAgIGNpcmN1aXQtPnRfc2VuZF9wc25wWzFdID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZF9sMl9wc25wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzaXNfaml0dGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2lyY3VpdC0+cHNucF9pbnRlcnZhbFsxXSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFNOUF9KSVRURVIpKTsKKworICB9CisgIAorICAvKiBpbml0aWFsaXplIHRoZSBjaXJjdWl0IHN0cmVhbXMgKi8KKyAgaWYgKGNpcmN1aXQtPnJjdl9zdHJlYW0gPT0gTlVMTCkKKyAgICBjaXJjdWl0LT5yY3Zfc3RyZWFtID0gc3RyZWFtX25ldyAoSVNPX01UVShjaXJjdWl0KSk7CisKKyAgaWYgKGNpcmN1aXQtPnNuZF9zdHJlYW0gPT0gTlVMTCkKKyAgICBjaXJjdWl0LT5zbmRfc3RyZWFtID0gc3RyZWFtX25ldyAoSVNPX01UVShjaXJjdWl0KSk7CisKKyAgLyogdW5pZmllZCBpbml0IGZvciBjaXJjdWl0cyAqLworICBpc2lzX3NvY2tfaW5pdCAoY2lyY3VpdCk7CisKKyNpZmRlZiBHTlVfTElOVVgKKyAgY2lyY3VpdC0+dF9yZWFkID0gdGhyZWFkX2FkZF9yZWFkIChtYXN0ZXIsIGlzaXNfcmVjZWl2ZSwgY2lyY3VpdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdC0+ZmQpOworI2Vsc2UKKyAgY2lyY3VpdC0+dF9yZWFkID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLCBpc2lzX3JlY2VpdmUsIGNpcmN1aXQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWl0LT5mZCk7CisjZW5kaWYKKyAgcmV0dXJuOworfQorCit2b2lkCitpc2lzX2NpcmN1aXRfZG93biAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCkKK3sKKyAgLyogQ2FuY2VsIGFsbCBhY3RpdmUgdGhyZ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YWNlKi8KKyNpZmRlZiBIQVZFX0lQVjYKKyAgICAgICAgaWYgKGMtPmlwdjZfbGluaykge0xJU1RfTE9PUCAoYy0+aXB2Nl9saW5rLCBpcHY2LCBub2RlMykKKyAgICAgICAgICB7CisgICAgICAgICAgICB2dHlfb3V0ICh2dHksICIgaXAlcyBhZGRyZXNzICVzLyVkJXMiLAorICAgICAgICAgICAgICAgICAgICAgaXB2Ni0+ZmFtaWx5ID09IEFGX0lORVQgPyAiIiA6ICJ2NiIsCisgICAgICAgICAgICAgICAgICAgICBpbmV0X250b3AgKGlwdjYtPmZhbWlseSwgJmlwdjYtPnByZWZpeCwgYnVmLCBCVUZTSVopLAorICAgICAgICAgICAgICAgICAgICAgaXB2Ni0+cHJlZml4bGVuLFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgIHdyaXRlKys7CisgICAgICAgICAgfX0KKyAgICAgICAgaWYgKGMtPmlwdjZfbm9uX2xpbmspIHtMSVNUX0xPT1AgKGMtPmlwdjZfbm9uX2xpbmssIGlwdjYsIG5vZGUzKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpcCVzIGFkZHJlc3MgJXMvJWQlcyIsCisgICAgICAgICAgICAgICAgICAgICBpcHY2LT5mYW1pbHkgPT0gQUZfSU5FVCA/ICIiIDogInY2IiwKKyAgICAgICAgICAgICAgICAgICAgIGluZXRfbnRvcCAoaXB2Ni0+ZmFtaWx5LCAmaXB2Ni0+cHJlZml4LCBidWYsIEJVRlNJWiksCisgICAgICAgICAgICAgICAgICAgICBpcHY2LT5wcmVmaXhsZW4sIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgIHdyaXRlKys7CisgICAgICAgICAgfX0gICAgICAgIAorI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworCisgICAgICAgIC8qIElTSVMgLSBjaXJjdWl0IHR5cGUgKi8KKyAgICAgICAgaWYgKGMtPmNpcmN1aXRfaXNfdHlwZSAgPT0gSVNfTEVWRUxfMSkgeworICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIGNpcmN1aXQtdHlwZSBsZXZlbC0xJXMiLCBWVFlfTkVXTElORSk7CisgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgIH0gZWxzZSB7aWYgKGMtPmNpcmN1aXRfaXNfdHlwZSAgPT0gSVNfTEVWRUxfMikgeworICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIGNpcmN1aXQtdHlwZSBsZXZlbC0yLW9ubHklcyIsIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICB3cml0ZSArKzsKKyAgICAgICAgfX0KKworICAgICAgICAvKiBJU0lTIC0gQ1NOUCBpbnRlcnZhbCAtIEZJWE1FOiBjb21wYXJlIHRvIGNpc2NvKi8KKyAgICAgICAgaWYgKGMtPmNzbnBfaW50ZXJ2YWxbMF0gPT0gYy0+Y3NucF9pbnRlcnZhbFsxXSkgeworICAgICAgICAgIGlmIChjLT5jc25wX2ludGVydmFsWzBdICE9IENTTlBfSU5URVJWQUwpIHsKKyAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIGNzbnAtaW50ZXJ2YWwgJWQlcyIsICBjLT5jc25wX2ludGVydmFsWzBdLCAKKwkJICAgICBWVFlfTkVXTElORSk7CisgICAgICAgICAgICB3cml0ZSArKzsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgZm9yIChpPTA7aTwyO2krKykgeworICAgICAgICAgICAgaWYgKGMtPmNzbnBfaW50ZXJ2YWxbMV0gIT0gQ1NOUF9JTlRFUlZBTCkgeworICAgICAgICAgICAgICB2dHlfb3V0ICh2dHksICIgaXNpcyBjc25wLWludGVydmFsICVkIGxldmVsLSVkJXMiLCAgCisJCSAgICAgICBjLT5jc25wX2ludGVydmFsWzFdLGkrMSwgVlRZX05FV0xJTkUpOworICAgICAgICAgICAgICB3cml0ZSArKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBJU0lTIC0gSGVsbG8gcGFkZGluZyAtIERlZmF1bHRzIHRvIHRydWUgc28gb25seSBkaXNwbGF5IGlmIGZhbHNlICovCisgICAgICAgIGlmIChjLT5jaXJjX3R5cGUgPT0gQ0lSQ1VJVF9UX0JST0FEQ0FTVCAmJiAhYy0+dS5iYy5wYWRfaGVsbG9zKSB7CisgICAgICAgICAgdnR5X291dCAodnR5LCAiIG5vIGlzaXMgaGVsbG8gcGFkZGluZyVzIiwgIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICB3cml0ZSArKzsKKyAgICAgICAgfQorCisgICAgICAgIC8qIElTSVMgLSBIZWxsbyBpbnRlcnZhbCAtIEZJWE1FOiBjb21wYXJlIHRvIGNpc2NvICovCisgICAgICAgIGlmIChjLT5oZWxsb19pbnRlcnZhbFswXSA9PSBjLT5oZWxsb19pbnRlcnZhbFsxXSkgeworICAgICAgICAgIGlmIChjLT5oZWxsb19pbnRlcnZhbFswXSAhPSBIRUxMT19JTlRFUlZBTCkgeworICAgICAgICAgICAgdnR5X291dCAodnR5LCAiIGlzaXMgaGVsbG8taW50ZXJ2YWwgJWQlcyIsICBjLT5oZWxsb19pbnRlcnZhbFswXSwgCisJCSAgICAgVlRZX05FV0xJTkUpOworICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGZvciAoaT0wO2k8MjtpKyspIHsKKyAgICAgICAgICAgIGlmIChjLT5oZWxsb19pbnRlcnZhbFtpXSAhPSBIRUxMT19JTlRFUlZBTCkgeworICAgICAgICAgICAgICBpZiAoYy0+aGVsbG9faW50ZXJ2YWxbaV0gPT0gSEVMTE9fTUlOSU1BTCkgeworICAgICAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIGhlbGxvLWludGVydmFsIG1pbmltYWwgbGV2ZWwtJWQlcyIsIGkrMSwgCisJCQkgVlRZX05FV0xJTkUpOworICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIGhlbGxvLWludGVydmFsICVkIGxldmVsLSVkJXMiLCAgCisJCQkgYy0+aGVsbG9faW50ZXJ2YWxbaV0saSsxLCBWVFlfTkVXTElORSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogSVNJUyAtIEhlbGxvIE11bHRpcGxpZXIgKi8KKyAgICAgICAgaWYgKGMtPmhlbGxvX211bHRpcGxpZXJbMF0gPT0gYy0+aGVsbG9fbXVsdGlwbGllclsxXSkgeworICAgICAgICAgIGlmIChjLT5oZWxsb19tdWx0aXBsaWVyWzBdICE9IEhFTExPX01VTFRJUExJRVIgKSB7CisgICAgICAgICAgICB2dHlfb3V0ICh2dHksICIgaXNpcyBoZWxsby1tdWx0aXBsaWVyICVkJXMiLCAgCisJCSAgICAgYy0+aGVsbG9fbXVsdGlwbGllclswXSwgVlRZX05FV0xJTkUpOworICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGZvciAoaT0wO2k8MjtpKyspIHsKKyAgICAgICAgICAgIGlmIChjLT5oZWxsb19tdWx0aXBsaWVyW2ldICE9IEhFTExPX01VTFRJUExJRVIpIHsKKyAgICAgICAgICAgICAgdnR5X291dCAodnR5LCAiIGlzaXMgaGVsbG8tbXVsdGlwbGllciAlZCBsZXZlbC0lZCVzIiwgIAorCQkgICAgICAgYy0+aGVsbG9fbXVsdGlwbGllcltpXSxpKzEsIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8qIElTSVMgLSBQcmlvcml0eSAqLworICAgICAgICBpZiAoYy0+Y2lyY190eXBlID09IENJUkNVSVRfVF9CUk9BRENBU1QpIHsKKyAgICAgICAgICBpZiAoYy0+dS5iYy5wcmlvcml0eVswXSA9PSBjLT51LmJjLnByaW9yaXR5WzFdKSB7CisgICAgICAgICAgICBpZiAoYy0+dS5iYy5wcmlvcml0eVswXSAhPSBERUZBVUxUX1BSSU9SSVRZKSB7CisgICAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIHByaW9yaXR5ICVkJXMiLCAgYy0+dS5iYy5wcmlvcml0eVswXSwgCisgICAgICAgICAgICAgICAgICAgICAgIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZvciAoaT0wO2k8MjtpKyspIHsKKyAgICAgICAgICAgICAgaWYgKGMtPnUuYmMucHJpb3JpdHlbaV0gIT0gREVGQVVMVF9QUklPUklUWSkgeworICAgICAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIHByaW9yaXR5ICVkIGxldmVsLSVkJXMiLCAgCisgICAgICAgICAgICAgICAgICAgICAgICAgYy0+dS5iYy5wcmlvcml0eVtpXSxpKzEsIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgICAgICB3cml0ZSArKzsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvKiBJU0lTIC0gTWV0cmljICovCisgICAgICAgIGlmIChjLT5tZXRyaWNzWzBdLm1ldHJpY19kZWZhdWx0ID09IGMtPm1ldHJpY3NbMV0ubWV0cmljX2RlZmF1bHQpIHsKKyAgICAgICAgICBpZiAoYy0+bWV0cmljc1swXS5tZXRyaWNfZGVmYXVsdCAhPSBERUZBVUxUX0NJUkNVSVRfTUVUUklDUykgeworICAgICAgICAgICAgdnR5X291dCAodnR5LCAiIGlzaXMgbWV0cmljICVkJXMiLCAgYy0+bWV0cmljc1swXS5tZXRyaWNfZGVmYXVsdCwgCisJCSAgICAgVlRZX05FV0xJTkUpOworICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGZvciAoaT0wO2k8MjtpKyspIHsKKyAgICAgICAgICAgIGlmIChjLT5tZXRyaWNzW2ldLm1ldHJpY19kZWZhdWx0ICE9IERFRkFVTFRfQ0lSQ1VJVF9NRVRSSUNTKSB7CisgICAgICAgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIiBpc2lzIG1ldHJpYyAlZCBsZXZlbC0lZCVzIiwgIAorCQkgICAgICAgYy0+bWV0cmljc1tpXS5tZXRyaWNfZGVmYXVsdCxpKzEsIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgICAgICAgd3JpdGUgKys7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgIH0KKyAgICB9CisgIH0KKyAgCisgIHJldHVybiB3cml0ZTsKK30KKyAgCisKK0RFRlVOIChpcF9yb3V0ZXJfaXNpcywKKyAgICAgICBpcF9yb3V0ZXJfaXNpc19jbWQsCisgICAgICAgImlwIHJvdXRlciBpc2lzIFdPUkQiLAorICAgICAgICJJbnRlcmZhY2UgSW50ZXJuZXQgUHJvdG9jb2wgY29uZmlnIGNvbW1hbmRzXG4iCisgICAgICAgIklQIHJvdXRlciBpbnRlcmZhY2UgY29tbWFuZHNcbiIKKyAgICAgICAiSVMtSVMgUm91dGluZyBmb3IgSVBcbiIKKyAgICAgICAiUm91dGluZyBwcm9jZXNzIHRhZ1xuIgorICAgICAgICkKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqYzsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICAKKyAgaWZwID0gKHN0cnVjdCBpbnRlcmZhY2UgKil2dHktPmluZGV4OworICBhc3NlcnQgKGlmcCk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GhlIEZTTSAqLworICB9CisKKyAgaWYoIWMpIAorICAgIHJldHVybiBDTURfV0FSTklORzsKKworICBjLT5pcF9yb3V0ZXIgPSAxOworICBhcmVhLT5pcF9jaXJjdWl0cysrOworICBjaXJjdWl0X3VwZGF0ZV9ubHBpZHMgKGMpOworCisgIHZ0eS0+bm9kZSA9IElOVEVSRkFDRV9OT0RFOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9faXBfcm91dGVyX2lzaXMsCisgICAgICAgbm9faXBfcm91dGVyX2lzaXNfY21kLAorICAgICAgICJubyBpcCByb3V0ZXIgaXNpcyBXT1JEIiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSW50ZXJmYWNlIEludGVybmV0IFByb3RvY29sIGNvbmZpZyBjb21tYW5kc1xuIgorICAgICAgICJJUCByb3V0ZXIgaW50ZXJmYWNlIGNvbW1hbmRzXG4iCisgICAgICAgIklTLUlTIFJvdXRpbmcgZm9yIElQXG4iCisgICAgICAgIlJvdXRpbmcgcHJvY2VzcyB0YWdcbiIKKyAgICAgICApIAoreworICBzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0ID0gTlVMTDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisKKyAgaWZwID0gKHN0cnVjdCBpbnRlcmZhY2UgKil2dHktPmluZGV4OworICBhc3NlcnQgKGlmcCk7CisgIAorICBhcmVhID0gaXNpc19hcmVhX2xvb2t1cCAoYXJndlswXSk7CisgIGlmICghYXJlYSkgeworICAgIHZ0eV9vdXQgKHZ0eSwgIkNhbid0IGZpbmQgSVNJUyBpbnN0YW5jZSAlcyIsIFZUWV9ORVdMSU5FKTsKKyAgICByZXR1cm4gQ01EX1dBUk5JTkc7CisgIH0KKyAgTElTVF9MT09QIChhcmVhLT5jaXJjdWl0X2xpc3QsIGNpcmN1a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4gKGlzaXNfcHJpb3JpdHksCisgICAgICAgaXNpc19wcmlvcml0eV9jbWQsCisgICAgICAgImlzaXMgcHJpb3JpdHkgPDAtMTI3PiIsCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIlNldCBwcmlvcml0eSBmb3IgRGVzaWduYXRlZCBSb3V0ZXIgZWxlY3Rpb25cbiIKKyAgICAgICAiUHJpb3JpdHkgdmFsdWVcbiIKKyAgICAgICApCit7CisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIHN0cnVjdCBpbnRlcmZhY2UgKmlmcDsKKyAgaW50IHByaW87CisgIAorICBpZnAgID0gdnR5LT5pbmRleDsKKyAgY2lyY3VpdCA9IGlmcC0+aW5mbzsKKyAgaWYgKGNpcmN1aXQgPT0gTlVMTCkgeworICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgfQorICBhc3NlcnQgKGNpcmN1aXQpOworCisgIHByaW8gPSBhdG9pIChhcmd2WzBdKTsKKworICBjaXJjdWl0LT51LmJjLnByaW9yaXR5WzBdID0gcHJpbzsKKyAgY2lyY3VpdC0+dS5iYy5wcmlvcml0eVsxXSA9IHByaW87CisgIAorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChub19pc2lzX3ByaW9yaXR5LAorICAgICAgIG5vX2lzaXNfcHJpb3JpdHlfY21kLAorICAgICAgICJubyBpc2lzIHByaW9yaXR5IiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IHByaW9yaXR5IGZvciBEZXNpZ25hdGVkIFJvdXRlciBlbGVjdGlvblxuIgorICAgICAgICkKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2ly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UxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisKKyAgcHJpbyA9IGF0b2kgKGFyZ3ZbMF0pOworCisgIGNpcmN1aXQtPnUuYmMucHJpb3JpdHlbMF0gPSBwcmlvOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9faXNpc19wcmlvcml0eV9sMSwKKyAgICAgICBub19pc2lzX3ByaW9yaXR5X2wxX2NtZCwKKyAgICAgICAibm8gaXNpcyBwcmlvcml0eSBsZXZlbC0xIiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IHByaW9yaXR5IGZvciBEZXNpZ25hdGVkIFJvdXRlciBlbGVjdGlvblxuIgorICAgICAgICJTcGVjaWZ5IHByaW9yaXR5IGZvciBsZXZlbC0xIHJvdXRpbmdcbiIKKyAgICAgICApCit7CisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIHN0cnVjdCBpbnRlcmZhY2UgKmlmcDsKKyAgCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgIAorICBjaXJjdWl0LT51LmJjLnByaW9yaXR5WzBdID0gREVGQVVMVF9QUklPUklUWTsKKyAgCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworQUxJQVMgKG5vX2lzaXNfcHJpb3JpdHlfbDEsCisgICAgICAgbm9faXNpc19wcmlvcml0eV9sMV9hcmdfY21kLAorICAgICAgICJubyBpc2lzIHByaW9yaXR5IDwwLTEyNz4gbGV2ZWwtMSIsCisgICAgICAgTk9fU1RSCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIlNldC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CisgICAgICAgbm9faXNpc19oZWxsb19pbnRlcnZhbF9hcmdfY21kLAorICAgICAgICJubyBpc2lzIGhlbGxvLWludGVydmFsICg8MS02NTUzNT58bWluaW1hbCkiLAorICAgICAgIE5PX1NUUgorICAgICAgICJJUy1JUyBjb21tYW5kc1xuIgorICAgICAgICJTZXQgSGVsbG8gaW50ZXJ2YWxcbiIKKyAgICAgICAiSGVsbG8gaW50ZXJ2YWwgdmFsdWVcbiIKKyAgICAgICAiSG9sZHRpbWUgMSBzZWNvbmQsIGludGVydmFsIGRlcGVuZHMgb24gbXVsdGlwbGllclxuIgorICAgICAgICkKKworREVGVU4gKGlzaXNfaGVsbG9faW50ZXJ2YWxfbDEsCisgICAgICAgaXNpc19oZWxsb19pbnRlcnZhbF9sMV9jbWQsCisgICAgICAgImlzaXMgaGVsbG8taW50ZXJ2YWwgKDwxLTY1NTM1PnxtaW5pbWFsKSBsZXZlbC0xIiwKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IEhlbGxvIGludGVydmFsXG4iCisgICAgICAgIkhlbGxvIGludGVydmFsIHZhbHVlXG4iCisgICAgICAgIkhvbGR0aW1lIDEgc2Vjb25kLCBpbnRlcnZhbCBkZXBlbmRzIG9uIG11bHRpcGxpZXJcbiIKKyAgICAgICAiU3BlY2lmeSBoZWxsby1pbnRlcnZhbCBmb3IgbGV2ZWwtMSBJSUhzXG4iCisgICAgICAgKQoreworICBzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0OworICBzdHJ1Y3QgaW50ZXJmYWNlICppZnA7CisgIGxvbmcgaW50ZXJ2YWw7CisgIGNoYXIgYzsKKworICBpZnAgID0gdnR5LT5pbmRleDsKKyAgY2lyY3VpdCA9IGlmcC0+aW5mbzsKKyAgaWYgKGNpcmN1aXQgPT0gTlVMTCkgeworICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgfQorICBhc3NlcnQgKGNpcmN1aXQpOworIAorICBjID0gKmFyZ3ZbMF07CisgIGlmIChpc2RpZ2l0KChpbnQpYykpIHsKKyAgICBpbnRlcnZhbCA9IGF0b2kgKGFyZ3ZbMF0pOworICB9IGVsc2UKKyAgICBpbnRlcnZhbCA9IEhFTExPX01JTklNQUw7CisKKyAgY2lyY3VpdC0+aGVsbG9faW50ZXJ2YWxbMF0gPSAodV9pbnQxNl90KWludGVydmFsOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9faXNpc19oZWxsb19pbnRlcnZhbF9sMSwKKyAgICAgICBub19pc2lzX2hlbGxvX2ludGVydmFsX2wxX2NtZCwKKyAgICAgICAibm8gaXNpcyBoZWxsby1pbnRlcnZhbCBsZXZlbC0xIiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IEhlbGxvIGludGVydmFsXG4iCisgICAgICAgIlNwZWNpZnkgaGVsbG8taW50ZXJ2YWwgZm9yIGxldmVsLTEgSUlIc1xuIgorICAgICAgICkKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgIAorCisgIGNpcmN1aXQtPmhlbGxvX2ludGVydmFsWzBdID0gSEVMTE9fSU5URVJWQUw7IC8qIERlZmF1bHQgaXMgMSBzZWMuICovCisgIAorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0FMSUFTIChub19pc2lzX2hlbGxvX2ludGVydmFsX2wxLAorICAgICAgIG5vX2lzaXNfaGVsbG9faW50ZXJ2YWxfbDFfYXJnX2NtZCwKKyAgICAgICAibm8gaXNpcyBoZWxsby1pbnRlcn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AKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9faXNpc19oZWxsb19tdWx0aXBsaWVyLAorICAgICAgIG5vX2lzaXNfaGVsbG9fbXVsdGlwbGllcl9jbWQsCisgICAgICAgIm5vIGlzaXMgaGVsbG8tbXVsdGlwbGllciIsCisgICAgICAgTk9fU1RSCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIlNldCBtdWx0aXBsaWVyIGZvciBIZWxsbyBob2xkaW5nIHRpbWVcbiIKKyAgICAgICApCit7CisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIHN0cnVjdCBpbnRlcmZhY2UgKmlmcDsKKyAgCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisKKyAgY2lyY3VpdC0+aGVsbG9fbXVsdGlwbGllclswXSA9IEhFTExPX01VTFRJUExJRVI7CisgIGNpcmN1aXQtPmhlbGxvX211bHRpcGxpZXJbMV0gPSBIRUxMT19NVUxUSVBMSUVSOworCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworQUxJQVMgKG5vX2lzaXNfaGVsbG9fbXVsdGlwbGllciwKKyAgICAgICBub19pc2lzX2hlbGxvX211bHRpcGxpZXJfYXJnX2NtZCwKKyAgICAgICAibm8gaXNpcyBoZWxsby1tdWx0aXBsaWVyIDwzLTEwMDA+IiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IG11bHRpcGxpZXIgZm9yIEhlbGxvIGhvbGRpbmcgdGltZVxuIgorICAgICAgICJIZWxsbyBtdWx0aXBsaWVyIHZhbHVlXG4iCisgICAgICAgKQorCitERUZVTiAoaXNpc19oZWxsb19tdWx0a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3QgcHJlZml4ICopJmlwdjQpKQorICAgICAgYnJlYWs7CisgIH0KKyAgCisgIGlmIChpcCkgeworICAgIGxpc3Rub2RlX2RlbGV0ZSAoY2lyY3VpdC0+aXBfYWRkcnMsIGlwKTsKKyAgfSBlbHNlIHsKKyAgICB2dHlfb3V0ICh2dHksICJJbnZhbGlkIGFkZHJlc3MgJXMiLCBWVFlfTkVXTElORSk7CisgIH0KKyAgCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKG5vX2lzaXNfaGVsbG8sCisgICAgICAgbm9faXNpc19oZWxsb19jbWQsCisgICAgICAgIm5vIGlzaXMgaGVsbG8gcGFkZGluZyIsCisgICAgICAgTk9fU1RSCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIkFkZCBwYWRkaW5nIHRvIElTLUlTIGhlbGxvIHBhY2tldHNcbiIKKyAgICAgICAiUGFkIGhlbGxvIHBhY2tldHNcbiIKKyAgICAgICAiPGNyPlxuIikKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgIAorICBjaXJjdWl0LT51LmJjLnBhZF9oZWxsb3MgPSAwOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoY3NucF9pbnRlcnZhbCwKKyAgICAgICBjc25wX2ludGVydmFsX2NtZCwKKyAgICAgICAiaXNpcyBjc25wLWludGVydmFsIDwwLTY1NTM1PiIsCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIlNldCBDU05QIGludGVydmFsIGluIHNlY29uZHNcbiIKKyAgICAgICAiQ1NOUCBpbnRlcnZhbCB2YWx1ZVxuIikKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworICB1bnNpZ25lZCBsb25nIGludGVydmFsOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgIAorICBpbnRlcnZhbCA9IGF0b2wgKGFyZ3ZbMF0pOworCisgIGNpcmN1aXQtPmNzbnBfaW50ZXJ2YWxbMF0gPSAodV9pbnQxNl90KWludGVydmFsOworICBjaXJjdWl0LT5jc25wX2ludGVydmFsWzFdID0gKHVfaW50MTZfdClpbnRlcnZhbDsKKyAgICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fY3NucF9pbnRlcnZhbCwKKyAgICAgICBub19jc25wX2ludGVydmFsX2NtZCwKKyAgICAgICAibm8gaXNpcyBjc25wLWludGVydmFsIiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiSVMtSVMgY29tbWFuZHNcbiIKKyAgICAgICAiU2V0IENTTlAgaW50ZXJ2YWwgaW4gc2Vjb25kc1xuIgorICAgICAgICkKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgc3RydWN0IGludGVyZmFjZSAqaWZwOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgICAgCisgIGNpcmN1aXQtPmNzbnBfaW50ZXJ2YWxbMF0gPSBDU05QX0lOVEVSVkFMOworICBjaXJjdWl0LT5jc25wX2ludGVydmFsW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c3RydWN0IGludGVyZmFjZSAqaWZwOworCisgIGlmcCAgPSB2dHktPmluZGV4OworICBjaXJjdWl0ID0gaWZwLT5pbmZvOworICBpZiAoY2lyY3VpdCA9PSBOVUxMKSB7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIGFzc2VydCAoY2lyY3VpdCk7CisgIAorICBjaXJjdWl0LT5jc25wX2ludGVydmFsWzFdID0gQ1NOUF9JTlRFUlZBTDsKKyAgICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitBTElBUyAobm9fY3NucF9pbnRlcnZhbF9sMiwKKyAgICAgICBub19jc25wX2ludGVydmFsX2wyX2FyZ19jbWQsCisgICAgICAgIm5vIGlzaXMgY3NucC1pbnRlcnZhbCA8MC02NTUzNT4gbGV2ZWwtMiIsCisgICAgICAgTk9fU1RSCisgICAgICAgIklTLUlTIGNvbW1hbmRzXG4iCisgICAgICAgIlNldCBDU05QIGludGVydmFsIGluIHNlY29uZHNcbiIKKyAgICAgICAiQ1NOUCBpbnRlcnZhbCB2YWx1ZVxuIgorICAgICAgICJTcGVjaWZ5IGludGVydmFsIGZvciBsZXZlbC0yIENTTlBzXG4iKQorCisKKyNpZmRlZiBIQVZFX0lQVjYKK0RFRlVOIChpcHY2X3JvdXRlcl9pc2lzLAorICAgICAgIGlwdjZfcm91dGVyX2lzaXNfY21kLAorICAgICAgICJpcHY2IHJvdXRlciBpc2lzIFdPUkQiLAorICAgICAgICJJUHY2IGludGVyZmFjZSBzdWJjb21tYW5kc1xuIgorICAgICAgICJJUHY2IFJvdXRlciBpbnRlcmZhY2UgY29tbWFuZHNcbiIKKyAgICAgICAiSVMtSVMgUm91dGluZyBmb3IgSVB2NlxuIgorICAgICAgICJSb3V0aW5nIHByb2Nlc3MgdGFnXG4iKQoreworICBzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjOworICBzdHJ1Y3QgaW50ZXJmYWNlICppZnA7CisgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZW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0gKnNuZF9zdHJlYW07ICAgICAvKiBTdHJlYW0gZm9yIHNlbmRpbmcgKi8KKyAgaW50IGlkeDsgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbiBTW1JNfFNOXSBmbGFncyAqLworI2RlZmluZSBDSVJDVUlUX1RfQlJPQURDQVNUICAwIAorI2RlZmluZSBDSVJDVUlUX1RfUDJQICAgICAgICAxCisjZGVmaW5lIENJUkNVSVRfVF9TVEFUSUNfSU4gIDIKKyNkZWZpbmUgQ0lSQ1VJVF9UX1NUQVRJQ19PVVQgMworI2RlZmluZSBDSVJDVUlUX1RfREEgICAgICAgICA0CisgIGludCAgICAgICAgY2lyY190eXBlOyAgICAgICAgICAvKiB0eXBlIG9mIHRoZSBwaHlzaWNhbCBpbnRlcmZhY2UgKi8KKyAgdW5pb24geworICAgIHN0cnVjdCBpc2lzX2JjYXN0X2luZm8gYmM7CisgICAgc3RydWN0IGlzaXNfcDJwX2luZm8gcDJwOworICB9IHU7CisgIGNoYXIgZXh0X2RvbWFpbjsgICAgICAgICAgICAgICAvKiBleHRlcm5hbERvbWFpbiAgIChib29sZWFuKSAqLworICAvKiAKKyAgICogQ29uZmlndXJhYmxlcyAKKyAgICovCisgIHN0cnVjdCBpc2lzX3Bhc3N3ZCBwYXNzd2Q7ICAgICAgLyogQ2lyY3VpdCByeC90eCBwYXNzd29yZCAqLworICBsb25nIGxzcF9pbnRlcnZhbDsgICAgICAgICAgICAKKyAgaW50IG1hbnVhbF9sMl9vbmx5OyAgICAgICAgICAgICAvKiBtYW51YWxMMk9ubHlNb2RlIChib29sZWFuKSAqLworICBpbnQgY2lyY3VpdF9pc190eXBlOyAgICAgICAgICAgIC8qIGNpcmN1aXQgaXMgdHlwZSA9PSBsZXZlbCBvZiBjaXJjdWl0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZGlmZnJlbmNpYXRlZCBmcm9tIGNpcmN1aXQgdHlwZSAobWVkaWEpICovCisgIHVfaW50MzJfdC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ChzdHJ1Y3QgaW50ZXJmYWNlICppZnAsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbGlzdCAqbGlzdCk7CitzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0X3NjYW5fYnlfaWZwICAgICAgKHN0cnVjdCBpbnRlcmZhY2UgKmlmcCk7Cit2b2lkICAgICAgICAgICAgICAgICBpc2lzX2NpcmN1aXRfZGVsICAgICAgICAgKHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQpOwordm9pZCAgICAgICAgICAgICAgICAgaXNpc19jaXJjdWl0X2NvbmZpZ3VyZSAgIChzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGlzaXNfYXJlYSAqYXJlYSk7Cit2b2lkICAgICAgICAgICAgICAgICBpc2lzX2NpcmN1aXRfdXAgICAgICAgICAgKHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQpOwordm9pZCAgICAgICAgICAgICAgICAgaXNpc19jaXJjdWl0X2RlY29uZmlndXJlIChzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGlzaXNfYXJlYSAqYXJlYSk7CisKK2ludCAgICAgICAgICAgICAgICAgIGlzaXNfY2lyY3VpdF9kZXN0cm95ICAgICAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCk7Cit2b2lkICAgICAgICAgICAgICAgICBpc2lzX2NpcmN1aXRfaWZfYWRkICAgICAgKHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpbnRlcmZhY2UgKmlmcCk7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GVtZW50YXRpb24gc3BlY2lmaWMgaml0dGVyIHZhbHVlcworICovCisKKyNkZWZpbmUgSUlIX0pJVFRFUiAgICAgICAgICAgICAgICAgICAgMjUgIC8qICUgKi8KKyNkZWZpbmUgTUFYX0FHRV9KSVRURVIgICAgICAgICAgICAgICAgIDUgIC8qICUgKi8KKyNkZWZpbmUgTUFYX0xTUF9HRU5fSklUVEVSICAgICAgICAgICAgIDUgIC8qICUgKi8KKyNkZWZpbmUgQ1NOUF9KSVRURVIgICAgICAgICAgICAgICAgICAgMTAgIC8qICUgKi8KKyNkZWZpbmUgUFNOUF9KSVRURVIgICAgICAgICAgICAgICAgICAgMTAgIC8qICUgKi8KKworI2RlZmluZSBSQU5ET01fU1BSRUFEICAgICAgICAgICAxMDAwMDAuMAorCisvKgorICogRGVmYXVsdCB2YWx1ZXMKKyAqIElTTyAtIDEwNTg5CisgKiBTZWN0aW9uIDcuMy4yMSAtIFBhcmFtZXRlcnMKKyAqLworI2RlZmluZSBNQVhfQUdFICAgICAgICAgICAgICAgICAgICAgICAxMjAwCisjZGVmaW5lIFpFUk9fQUdFX0xJRkVUSU1FICAgICAgICAgICAgIDYwCisjZGVmaW5lIE1BWF9MU1BfR0VOX0lOVEVSVkFMICAgICAgICAgIDkwMAorI2RlZmluZSBNSU5fTFNQX0dFTl9JTlRFUlZBTCAgICAgICAgICAzMAorI2RlZmluZSBNSU5fTFNQX1RSQU5TX0lOVEVSVkFMICAgICAgICA1CisjZGVmaW5lIElTSVNfTUlOX0xTUF9MSUZFVElNRSAgICAgICAgIDM4MAorI2RlZmluZSBDU05QX0lOVEVSVkFMICAgICAgICAgICAgICAgICAxMAorI2RlZmluZSBQU05QX0lOVEVSVkFMICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIElTSVNfTUFYX1BBVEhfU1BMSVRTICAgICAgICAgIDMKKworI2RlZmluZSBJU0lTX0xFVkVMUyAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIElTSVNfTEVWRUwxICAg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bnBhLCBhZGotPnNucGEsIEVUSF9BTEVOKTsKKyAgICAgICAgaWYgKGNtcF9yZXMgPCAwKSB7CisgICAgICAgICAgYWRqX2RyID0gYWRqOworCX0KKyAgICAgICAgaWYgKGNtcF9yZXMgPT0gMCkKKyAgICAgICAgICB6bG9nX3dhcm4gKCJpc2lzX2RyX2VsZWN0KCk6IG11bHRpcGxlIGFkamFjZW5jaWVzIHdpdGggc2FtZSBTTlBBIik7IAorICAgICAgfSBlbHNlIHsKKyAgICAgICAgYWRqX2RyID0gYWRqOworICAgICAgfQorICAgIH0KKyAgfQorICAKKyAgaWYgKCFhZGpfZHIpIHsKKyAgICAvKgorICAgICAqIENvdWxkIG5vdCBmaW5kIHRoZSBEUiAtIG1lYW5zIHdlIGFyZSBhbG9uZSBhbmQgdGh1cyB0aGUgRFIKKyAgICAgKi8KKyAgICBpZiAoICFjaXJjdWl0LT51LmJjLmlzX2RyW2xldmVsIC0gMV0pIHsKKyAgICAgIGxpc3RfZGVsZXRlIChsaXN0KTsKKyAgICAgIGxpc3QgPSBOVUxMOworICAgICAgcmV0dXJuIGlzaXNfZHJfY29tbWVuY2UgKGNpcmN1aXQsIGxldmVsKTsKKyAgICB9CisgICAgZ290byBvdXQ7CisgIH0KKworICAvKgorICAgKiBOb3cgd2UgaGF2ZSB0aGUgRFIgYWRqYWNlbmN5LCBjb21wYXJlIGl0IHRvIHNlbGYKKyAgICovCisgIGlmIChhZGpfZHItPnByaW9bbGV2ZWwtMV0gPCBvd25fcHJpbyB8fCAoYWRqX2RyLT5wcmlvW2xldmVsLTFdID09IG93bl9wcmlvICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtY21wIChhZGpfZHItPnNucGEsIGNpcmN1aXQtPnUuYmMuc25wYSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFVEhfQUxFTikgPCAwKSkgeworICAgIGlmICghY2lyY3VpdC0+dS5iYy5pc19kcltsZXZlbCAtID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wgPT0gMSkgeworICAgIG1lbXNldCAoY2lyY3VpdC0+dS5iYy5sMV9kZXNpZ19pcywgMCwgSVNJU19TWVNfSURfTEVOICsgMSk7CisgICAgCisgICAgaWYgKGNpcmN1aXQtPnRfc2VuZF9jc25wWzBdKQorICAgICAgdGhyZWFkX2NhbmNlbCAoY2lyY3VpdC0+dF9zZW5kX2NzbnBbMF0pOyAgICAKKyAgICAKKyAgICBjaXJjdWl0LT51LmJjLnRfcnVuX2RyWzBdID0KKyAgICAgIHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgaXNpc19ydW5fZHJfbDEsIGNpcmN1aXQsCisgICAgICAgICAgICAgICAgICAgICAgICAyICogY2lyY3VpdC0+aGVsbG9faW50ZXJ2YWxbMV0pOyAgICAKKworICAgIGNpcmN1aXQtPnRfc2VuZF9wc25wWzBdID0gCisgICAgICB0aHJlYWRfYWRkX3RpbWVyIChtYXN0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICBzZW5kX2wxX3BzbnAsCisgICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgaXNpc19qaXR0ZXIgKGNpcmN1aXQtPnBzbnBfaW50ZXJ2YWxbbGV2ZWwgLSAxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU05QX0pJVFRFUikpOworICB9IGVsc2UgeworICAgIG1lbXNldCAoY2lyY3VpdC0+dS5iYy5sMl9kZXNpZ19pcywgMCwgSVNJU19TWVNfSURfTEVOICsgMSk7CisKKyAgICBpZiAoY2lyY3VpdC0+dF9zZW5kX2NzbnBbMF0pCisgICAgICB0aHJlYWRfY2FuY2VsIChjaXJjdWl0LT50X3NlbmRfY3NucFswXSk7CisKKyAgICBjaXJjdWl0LT51LmJjLnRfcnVuX2RyWzFdID0KKyAgICAgIHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgaXNpc19ydW5fZHJfbDIsIGNpcmN1aXQsCisgICAgICAgICAgICAgICAgICAgICAgICAyICogY2lyY3VpdC0+aGVsbG9faW50ZXJ2YWxbMV0pOyAgICAKKyAgICBjaXJjdWl0LT50X3NlbmRfcHNucFsxXSA9IAorICAgICAgdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgc2VuZF9sMl9wc25wLAorICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzaXNfaml0dGVyIChjaXJjdWl0LT5wc25wX2ludGVydmFsW2xldmVsIC0gMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFNOUF9KSVRURVIpKTsKKyAgfQorICAKKyAgdGhyZWFkX2FkZF9ldmVudCAobWFzdGVyLCBpc2lzX2V2ZW50X2Rpc19zdGF0dXNfY2hhbmdlLCBjaXJjdWl0LCAwKTsKKworICByZXR1cm4gSVNJU19PSzsKK30KKworaW50IAoraXNpc19kcl9jb21tZW5jZSAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCwgaW50IGxldmVsKQoreworICB1X2NoYXIgb2xkX2RyW0lTSVNfU1lTX0lEX0xFTiArIDJdOworICAKKyAgemxvZ19pbmZvICgiaXNpc19kcl9jb21tZW5jZSBsJWQiLCBsZXZlbCk7CisKKyAgLyogTGV0cyBrZWVwIGEgcGF1c2UgaW4gRFIgZWxlY3Rpb24gKi8KKyAgY2lyY3VpdC0+dS5iYy5ydW5fZHJfZWxlY3RbbGV2ZWwgLSAxXSA9IDA7CisgIGlmIChsZXZlbCA9PSAxKSAKKyAgICBjaXJjdWl0LT51LmJjLnRfcnVuX2RyWzBdID0gCisgICAgICB0aHJlYWRfYWRkX3RpbWVyIChtYXN0ZXIsIGlzaXNfcnVuX2RyX2wxLCBjaXJjdWl0LAorCQkJMiAqIGNpcmN1aXQtPmhlbGxvX211bHRpcGxpZXJbMF0gKiAKKwkJCWNpcmN1aXQtPmhlbGxvX2ludGVydmFs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ZG9fZ2VuZXJhdGUgKGNpcmN1aXQpOworCisgICAgY2lyY3VpdC0+dS5iYy50X3J1bl9kclswXSA9CisgICAgICB0aHJlYWRfYWRkX3RpbWVyIChtYXN0ZXIsIGlzaXNfcnVuX2RyX2wxLCBjaXJjdWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgMiAqIGNpcmN1aXQtPmhlbGxvX2ludGVydmFsWzBdKTsKKworICAgIGNpcmN1aXQtPnRfc2VuZF9jc25wWzBdID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VuZF9sMV9jc25wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc2lzX2ppdHRlciAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2lyY3VpdC0+Y3NucF9pbnRlcnZhbFtsZXZlbC0xXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NOUF9KSVRURVIpKTsKKyAgfSBlbHNlIHsKKyAgICBtZW1jcHkgKG9sZF9kciwgY2lyY3VpdC0+dS5iYy5sMl9kZXNpZ19pcywgSVNJU19TWVNfSURfTEVOICsgMSk7CisgICAgTFNQX0ZSQUdNRU5UIChvbGRfZHIpID0gMDsKKyAgICBpZiAoTFNQX1BTRVVET19JRChvbGRfZHIpKSB7CisgICAgICAvKiB0aGVyZSB3YXMgYSBkciBlbGVjdGVkLCBwdXJnZSBpdHMgTFNQcyBmcm9tIHRoZSBkYiAqLworICAgICAgbHNwX3B1cmdlX2RyIChvbGRfZHIsIGNpcmN1aXQsIGxldmVsKTsKKyAgICB9CisgICAgbWVtY3B5IChjaXJjdWl0LT51LmJjLmwyX2Rlc2lnX2lzLCBpc2lzL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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAqCisgICogRVZFTlRTIGZvciBMU1AgZ2VuZXJhdGlvbgorICAqCisgICogMSkgYW4gQWRhamFjZW5jeSBvciBDaXJjdWl0IFVwL0Rvd24gZXZlbnQKKyAgKiAyKSBhIGNobmFnZSBpbiBDaXJjdWl0IG1ldHJpYworICAqIDMpIGEgY2hhbmdlIGluIFJlYWNoYWJsZSBBZGRyZXNzIG1ldHJpYworICAqIDQpIGEgY2hhbmdlIGluIG1hbnVhbEFyZWFBZGRyZXNzZXMKKyAgKiA1KSBhIGNoYW5nZSBpbiBzeXN0ZW1JRAorICAqIDYpIGEgY2hhbmdlIGluIERJUyBzdGF0dXMKKyAgKiA3KSBhIGNobmFnZSBpbiB0aGUgd2FpdGluZyBzdGF0dXMKKyAgKgorICAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICoKKyAgKiBjdXJyZW50IHN1cHBvcnQgZXZlbnQKKyAgKgorICAqIDEpIEFkamFjZW5jeSBVcC9Eb3duIGV2ZW50CisgICogNikgYSBjaGFuZ2UgaW4gRElTIHN0YXR1cworICAqCisgICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgCitpc2lzX2V2ZW50X2FkamFjZW5jeV9zdGF0ZV9jaGFuZ2UgKHN0cnVjdCBpc2lzX2FkamFjZW5jeSAqYWRqLCBpbnQgbmV3c3RhdGUpCit7CisgIC8qIGFkamFjZW5jeSBzdGF0ZSBjaGFuZ2UgZXZlbnQuIAorICAgKiAtIHRoZSBvbmx5IHByb3RvLXR5cGUgd2FzIHN1cHBvcnRlZCAqLworICAKKyAgLyogaW52YWxpZCBhcmd1bWVudHMgKi8gCisgIGlmICggIWFkaiB8fCAhY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pbnQgCitsc3BfY29tcGFyZSAoY2hhciAqYXJlYXRhZywgc3RydWN0IGlzaXNfbHNwICpsc3AsIHVfaW50MzJfdCBzZXFfbnVtLCAKKwkgICAgIHVfaW50MTZfdCBjaGVja3N1bSwgdV9pbnQxNl90IHJlbV9saWZldGltZSkKK3sKKyAgICAgIC8qIG5vIHBvaW50IGluIGRvdWJsZSBudG9obCBvbiBzZXFudW0gKi8KKyAgaWYgKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSA9PSBzZXFfbnVtICYmIAorICAgICAgbHNwLT5sc3BfaGVhZGVyLT5jaGVja3N1bSA9PSBjaGVja3N1bSAmJgorICAgICAgLypjb21wYXJpbmcgd2l0aCAwLCBubyBuZWVkIHRvIGRvIG50b2hsICovCisgICAgICAoKGxzcC0+bHNwX2hlYWRlci0+cmVtX2xpZmV0aW1lID09IDAgJiYgcmVtX2xpZmV0aW1lID09IDApIHx8CisgICAgICAgKGxzcC0+bHNwX2hlYWRlci0+cmVtX2xpZmV0aW1lICE9IDAgJiYgcmVtX2xpZmV0aW1lICE9IDApKSkgeyAKKyAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfU05QX1BBQ0tFVFMpIHsKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtU25wICglcyk6IExTUCAlcyBzZXEgMHglMDh4LCBja3N1bSAweCUwNHgsIgorICAgICAgICAgICAgICAgICAiIGxpZmV0aW1lICV1cyIsCisgICAgICAgICAgICAgICAgIGFyZWF0YWcsCisgICAgICAgICAgICAgICAgIHJhd2xzcGlkX3ByaW50IChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCksCisgICAgICAgICAgICAgICAgIG50b2hsKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSksCisgICAgICAgICAgICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+Y2hlY2tzdW0pLAorICAgICAgICAgICAgICAgICBudG9ocyhsc3AtPmxzcF9oZWFkZXItPnJlbV9saWZldGltZSkgKTsKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtU25wICglcyk6ICAgICAgICAgaXMgZXF1YWwgdG8gb3VycyBzZXEgMHglMDh4LCIKKyAgICAgICAgICAgICAgICAgIiBja3N1bSAweCUwNHgsIGxpZmV0aW1lICV1cyIsCisgICAgICAgICAgICAgICAgIGFyZWF0YWcsCisgICAgICAgICAgICAgICAgIG50b2hsKHNlcV9udW0pLAorICAgICAgICAgICAgICAgICBudG9ocyhjaGVja3N1bSksCisgICAgICAgICAgICAgICAgIG50b2hzKHJlbV9saWZldGltZSkpOworICAgIH0KKyAgICByZXR1cm4gTFNQX0VRVUFMOworICB9CisKKyAgaWYgKG50b2hsKHNlcV9udW0pID49IG50b2hsKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSkpIHsKKyAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfU05QX1BBQ0tFVFMpIHsKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtU25wICglcyk6IExTUCAlcyBzZXEgMHglMDh4LCBja3N1bSAweCUwNHgsIgorICAgICAgICAgICAgICAgICAiIGxpZmV0aW1lICV1cyIsCisgICAgICAgICAgICAgICAgIGFyZWF0YWcsCisgICAgICAgICAgICAgICAgIHJhd2xzcGlkX3ByaW50IChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCksCisgICAgICAgICAgICAgICAgIG50b2hsKHNlcV9udW0pLAorICAgICAgICAgICAgICAgICBudG9ocyhjaGVja3N1bSksCisgICAgICAgICAgICAgICAgIG50b2hzKHJlbV9saWZldGltZSApKTsKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtU25wICglcyk6ICAgICAgIGlzIG5ld2VyIHRoYW4gb3VycyBzZXEgMHglMDh4LCAiCisgICAgICAgICAgICAgICAgICJja3N1bSAweCUwNHgsIGxpZmV0aW1lICV1cyIsCisgICAgICAgICAgICAgICAgIGFyZWF0YWcsCisgICAgICAgICAgICAgICAgIG50b2hsKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSksCisgICAgICAgICAgICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+Y2hlY2tzdW0pLAorICAgICAgICAgICAgICAgICBudG9ocyhsc3AtPmxzcF9oZWFkZXItPnJlbV9saWZldGltZSkgKTsKKyAgICB9CisgICAgcmV0dXJuIExTUF9ORVdFUjsKKyAgfQorICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfU05QX1BBQ0tFVFMpIHsKKyAgICB6bG9nX2luZm8gKCJJU0lTLVNucCAoJXMpOiBMU1AgJXMgc2VxIDB4JTA4eCwgY2tzdW0gMHglMDR4LCBsaWZldGltZSAldXMiLAorCSAgICAgICBhcmVhdGFnLAorCSAgICAgICByYXdsc3BpZF9wcmludCAobHNwLT5sc3BfaGVhZGVyLT5sc3BfaWQpLAorCSAgICAgICBudG9obChzZXFfbnVtKSwKKwkgICAgICAgbnRvaHMoY2hlY2tzdW0pLAorCSAgICAgICBudG9ocyhyZW1fbGlmZXRpbWUgKSk7CisgICAgemxvZ19pbmZvICgiSVNJUy1TbnAgKCVzKTogICAgICAgaXMgb2xkZXIgdGhhbiBvdXJzIHNlcSAweCUwOHgsIgorICAgICAgICAgICAgICAgIiBja3N1bSAweCUwNHgsIGxpZmV0aW1lICV1cyIsCisJICAgICAgIGFyZWF0YWcsCisJICAgICAgIG50b2hsKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSksCisJICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+Y2hlY2tzdW0pLAorCSAgICAgICBudG9ocyhsc3AtPmxzcF9oZWFkZXItPnJlbV9saWZldGltZSkgKTsKKyAgfQorCisgIHJldHVybiBMU1BfT0xERVI7Cit9CisKK3ZvaWQgCitsc3BfaW5jX3NlcW51bSAoc3RydWN0IGlzaXNfbHNwICpsc3AsIHVfaW50MzJfdCBzZXFfbnVtKQoreworICB1X2ludDMyX3QgbmV3c2VxOworICAKKyAgaWYgKHNlcV9udW0gPT0gMCB8fCBudG9obCAobHNwLT5sc3BfaGVhZGVyLT5zZXFfbnVtKSA+IHNlcV9udW0pCisgICAgbmV3c2VxID0gbnRvaGwgKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSkgKyAxOworICBlbHNlCisgICAgbmV3c2VxID0gc2VxX251bSArKzsKKyAgCisgIGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSA9IGh0b25sIChuZXdzZXEpOworICBpc29fY3N1bV9jcmVhdGUgKFNUUkVBTV9EQVRBIChsc3AtPnBkdSkgKyAxMiwgCisgICAgICAgICAgICAgICAgICAgbnRvaHMobHNwLT5sc3BfaGVhZGVyLT5wZHVfbGVuKSAtIDEyLCAxMik7CisKKyAgcmV0dXJuOworfQorCisvKgorICogR2VuZXRhdGVzIGNoZWNrc3VtIGZvciBMU1AgYW5kIGl0cyBmcmFncworICovCit2b2lkCitsc3Bfc2VxbnVtX3VwZGF0ZSAoc3RydWN0IGlzaXNfbHNwICpsc3AwKQoreworICBzdHJ1Y3QgaXNpc19sc3AgKmxzcDsKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlOworICAKKyAgbHNwX2luY19zZXFudW0gKGxzcDAsIDApOworCisgIGlmICghbHNwMC0+bHNwdS5mcmFncykKKyAgICByZXR1cm47CisKKyAgZm9yIChub2RlID0gbGlzdGhlYWQgKGxzcDAtPmxzcHUuZnJhZ3MpOyBub2RlOyBuZXh0bm9kZSAobm9kZSkpIHsKKyAgICBsc3AgPSBnZXRkYXRhIChub2RlKTsKKyAgICBsc3BfaW5jX3NlcW51bShsc3AsIDApOworICB9CisgIAorICByZXR1cm47Cit9CisKK2ludCAKK2lzaXNfbHNwX2F1dGhpbmZvX2NoZWNrIChzdHJ1Y3Qgc3RyZWFtICpzdHJlYW0sIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWEsCisJCQkgaW50ICBwZHVsZW4sIHN0cnVjdCBpc2lzX3Bhc3N3ZCAqcGFzc3dkKQoreworICB1aW50MzJfdCBleHBlY3RlZCA9IDAsIGZvdW5kOworICBzdH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6ICAgICAgICAgMHglWCVzIiwKKyAgICAgICAgICAgICAgIGxzcC0+dGx2X2RhdGEubmxwaWRzLT5ubHBpZHNbaV0sCisgICAgICAgICAgICAgICBWVFlfTkVXTElORSk7CisgICAgICAgIGJyZWFrOworICAgICAgZGVmYXVsdDoKKyAgICAgICAgdnR5X291dCAodnR5LCAiICBOTFBJRDogICAgICAgICAlcyVzIiwKKyAgICAgICAgICAgICAgICJ1bmtub3duIiwKKyAgICAgICAgICAgICAgIFZUWV9ORVdMSU5FKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgfSAKKyAgfQorCisgIC8qIGZvciB0aGUgaG9zdG5hbWUgdGx2ICovCisgIGlmIChsc3AtPnRsdl9kYXRhLmhvc3RuYW1lKSB7CisgICAgYnplcm8gKGhvc3RuYW1lLCBzaXplb2YgKGhvc3RuYW1lKSk7CisgICAgbWVtY3B5IChob3N0bmFtZSwgbHNwLT50bHZfZGF0YS5ob3N0bmFtZS0+bmFtZSwKKyAgICAgICAgICAgIGxzcC0+dGx2X2RhdGEuaG9zdG5hbWUtPm5hbWVsZW4pOworICAgIHZ0eV9vdXQgKHZ0eSwgIiAgSG9zdG5hbWU6ICVzJXMiLCBob3N0bmFtZSwgVlRZX05FV0xJTkUpOworICB9CisKKyAgaWYgKGxzcC0+dGx2X2RhdGEuaXB2NF9hZGRycykgeworICAgIExJU1RfTE9PUChsc3AtPnRsdl9kYXRhLmlwdjRfYWRkcnMsIGlwdjRfYWRkciwgbG5vZGUpIHsKKyAgICAgIG1lbWNweSAoaXB2NF9hZGRyZXNzLCBpbmV0X250b2EgKCppcHY0X2FkZHIpLCBzaXplb2YgKGlwdjRfYWRkcikpOworICAgICAgdnR5X291dCAodnR5LCAiICBJUDogICAgICAgICVzJXMiLAorICAgICAgICAgICAgICAgaXB2NF9hZGRyZXNzLAorICAgICAgICAgICAgICAgVlRZX05FV0xJTkUpOworICAgIH0KKyAgfQorICAKKyAgLyogZm9yIHRoZSBpbnRlcm5hbCByZWFjaGFibGUgdGx2ICovCisgIGlmIChsc3AtPnRsdl9kYXRhLmlwdjRfaW50X3JlYWNocykKKyAgICBMSVNUX0xPT1AobHNwLT50bHZfZGF0YS5pcHY0X2ludF9yZWFjaHMsIGlwdjRfcmVhY2gsIGxub2RlKSB7CisgICAgICBtZW1jcHkgKGlwdjRfcmVhY2hfcHJlZml4LCBpbmV0X250b2EgKGlwdjRfcmVhY2gtPnByZWZpeCksIHNpemVvZiAoaXB2NF9yZWFjaF9wcmVmaXgpKTsKKyAgICAgIG1lbWNweSAoaXB2NF9yZWFjaF9tYXNrLCBpbmV0X250b2EgKGlwdjRfcmVhY2gtPm1hc2spLCBzaXplb2YgKGlwdjRfcmVhY2hfbWFzaykpOworICAgICAgdnR5X291dCAodnR5LCAiICBNYXRyaWM6ICVkIElQICVzICVzJXMiLAorICAgICAgICAgICAgIGlwdjRfcmVhY2gtPm1ldHJpY3MubWV0cmljX2RlZmF1bHQsCisgICAgICAgICAgICAgaXB2NF9yZWFjaF9wcmVmaXgsCisgICAgICAgICAgICAgaXB2NF9yZWFjaF9tYXNrLAorICAgICAgICAgICAgIFZUWV9ORVdMSU5FKTsKKyAgfQorCisgIC8qIGZvciB0aGUgSVMgbmVpZ2hib3IgdGx2ICovCisgIGlmIChsc3AtPnRsdl9kYXRhLmlzX25laWdocykgeworICAgIExJU1RfTE9PUChsc3AtPnRsdl9kYXRhLmlzX25laWdocyxpc19uZWlnaCxsbm9kZSkgeworICAgICAgbHNwaWRfcHJpbnQgKGlzX25laWdoLT5uZWlnaF9pZCwgTFNQaWQsIGR5bmhvc3QsIDApOworICAgICAgdnR5X291dCAodnR5LCAiICBNZXRyaWM6ICVkIElTICVzJXMiLAorICAgICAgICAgICAgICBpc19uZWlnaC0+bWV0cmljcy5tZXRyaWNfZGVmYXVsdCwKKyAgICAgICAgICAgICAgTFNQaWQsCisgICAgICAgICAgICAgIFZUWV9ORVdMSU5FKTsKKyAgICB9CisgIH0KKworLyogRklYTUU6I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gJiAweDNGLAorCSAgICAgbnRvaGwgKHRlX2lwdjRfcmVhY2gtPnRlX21ldHJpYyksCisJICAgICBWVFlfTkVXTElORSk7CisgIH0KKworI2lmZGVmIEhBVkVfSVBWNgorICBpZiAobHNwLT50bHZfZGF0YS5pcHY2X3JlYWNocykKKyAgICBMSVNUX0xPT1AobHNwLT50bHZfZGF0YS5pcHY2X3JlYWNocywgaXB2Nl9yZWFjaCwgbG5vZGUpIHsKKyAgICBtZW1jcHkgKGluNi5zNl9hZGRyLCBpcHY2X3JlYWNoLT5wcmVmaXgsIDE2KTsKKyAgICBpbmV0X250b3AgKEFGX0lORVQ2LCAmaW42LCBidWZmLCBCVUZTSVopOworICAgIGlmICgoaXB2Nl9yZWFjaC0+Y29udHJvbF9pbmZvICYmICAKKyAgICAgICAgQ1RSTF9JTkZPX0RJU1RSSUJVVElPTikgPT0gRElTVFJJQlVUSU9OX0lOVEVSTkFMKQorICAgICAgdnR5X291dCAodnR5LCAiICAgICBpbnQtSVB2NiAlcy8lZCwgTWV0cmljOiAlZCVzIiwKKyAgICAgICAgICAgICAgIGJ1ZmYsCisgICAgICAgICAgICAgICBpcHY2X3JlYWNoLT5wcmVmaXhfbGVuLAorICAgICAgICAgICAgICAgbnRvaGwgKGlwdjZfcmVhY2gtPm1ldHJpYyksCisgICAgICAgICAgICAgICBWVFlfTkVXTElORSk7CisgICAgZWxzZQorICAgICAgdnR5X291dCAodnR5LCAiICAgICBleHQtSVB2NiAlcy8lZCwgTWV0cmljOiAlZCVzIiwKKyAgICAgICAgICAgICAgIGJ1ZmYsCisgICAgICAgICAgICAgICBpcHY2X3JlYWNoLT5wcmVmaXhfbGVuLAorICAgICAgICAgICAgICAgbnRvaGwgKGlwdjZfcmVhY2gtPm1ldHJpYyksCisgICAgICAgICAgICAgICBWVFlfTkVXTElORSk7CisgICAgCisgIH0KKyNlbmRpZgorICBpZiAobHNwLT50bHZfZGF0YS5ob3N0bmFtZSkgeworICAgIG1lbXNldCAoaG9zdG5hbWUsIDAsIHNpemVvZiAoaG9zdG5hbWUpKTsKKyAgICBtZW1jcHkgKGhvc3RuYW1lLCBsc3AtPnRsdl9kYXRhLmhvc3RuYW1lLT5uYW1lLAorICAgICAgICAgICAgbHNwLT50bHZfZGF0YS5ob3N0bmFtZS0+bmFtZWxlbik7CisgICAgdnR5X291dCAodnR5LCAiICAgIEhvc3RuYW1lOiAlcyVzIiwgaG9zdG5hbWUsIFZUWV9ORVdMSU5FKTsKKyAgfQorI2VuZGlmCisgcmV0dXJuOworfQorCisvKiBwcmludCBhbGwgdGhlIGxzcHMgaW5mbyBpbiB0aGUgbG9jYWwgbHNwZGIgKi8KK2ludCAKK2xzcF9wcmludF9hbGwgKHN0cnVjdCB2dHkgKnZ0eSwgZGljdF90ICpsc3BkYiwgY2hhciBkZXRhaWwsIGNoYXIgZHluaG9zdCkKK3sKKworICBkbm9kZV90ICpub2RlID0gZGljdF9maXJzdChsc3BkYiksICpuZXh0OworICBpbnQgbHNwX2NvdW50ID0gMDsKKworICAvKiBwcmludCB0aGUgdGl0bGUsIGZvciBib3RoIG1vZGVzICovCisgIHZ0eV9vdXQgKHZ0eSwgIkxTUCBJRCAgICAgICAgICAgICAgICAgICBMU1AgU2VxIE51bSAgTFNQIENoZWNrc3VtICIKKyAgICAgICAgICAgICAiTFNQIEhvbGR0aW1lIEFUVC9QL09MJXMiLCBWVFlfTkVXTElORSk7CisgICAgICAgICAgICAgCisgIGlmIChkZXRhaWwgPT0gSVNJU19VSV9MRVZFTF9CUklFRikgeworICAgIHdoaWxlIChub2RlICE9IE5VTEwpIHsKKyAgICAgIC8qIGRpY3RfY29udGFpbnMgKGxzcGRiLCBub2RlKTsgKi8gLyogSSB0aGluayBpdCBpcyB1bm5lY2Vzc2FyeSwgc28gSSBjb21tZW50IGl0IG91dCAqLworICAgICAgbmV4dCA9IGRpY3RfbmV4dCAobHNwZGIsIG5vZGUpOworICAgICAgbHNwX3ByaW50IChub2RlLCB2dHksIGR5bmhvc3QpO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BWNiAqLworICAgICAgKQorICAgIHsKKyAgICAgIGxzcC0+dGx2X2RhdGEubmxwaWRzID0gWE1BTExPQyAoTVRZUEVfSVNJU19UTFYsIHNpemVvZiAoc3RydWN0IG5scGlkcykpOworICAgICAgbHNwLT50bHZfZGF0YS5ubHBpZHMtPmNvdW50ID0gMDsKKyAgICAgIGlmIChhcmVhLT5pcF9jaXJjdWl0cyA+IDApIHsgCisgICAgICAgIGxzcC0+dGx2X2RhdGEubmxwaWRzLT5jb3VudCsrOworICAgICAgICBsc3AtPnRsdl9kYXRhLm5scGlkcy0+bmxwaWRzWzBdID0gTkxQSURfSVA7CisgICAgICB9ICAKKyNpZmRlZiBIQVZFX0lQVjYKKyAgICAgIGlmIChhcmVhLT5pcHY2X2NpcmN1aXRzID4gMCkgeyAgCisgICAgICAgIGxzcC0+dGx2X2RhdGEubmxwaWRzLT5jb3VudCsrOworICAgICAgICBsc3AtPnRsdl9kYXRhLm5scGlkcy0+bmxwaWRzW2xzcC0+dGx2X2RhdGEubmxwaWRzLT5jb3VudCAtIDFdID0gCisgICAgICAgIE5MUElEX0lQVjY7CisgICAgICB9IAorI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworICAgIH0KKyAgLyogRHluYW1pYyBIb3N0bmFtZSAqLworICBpZiAoYXJlYS0+ZHluaG9zdG5hbWUpIHsKKyAgICBsc3AtPnRsdl9kYXRhLmhvc3RuYW1lID0gWE1BTExPQyAoTVRZUEVfSVNJU19UTFYsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKHN0cnVjdCBob3N0bmFtZSkpOworICAgIG1lbWNweSAobHNwLT50bHZfZGF0YS5ob3N0bmFtZS0+bmFtZSwgaG9zdC5uYW1lLCBzdHJsZW4gKGhvc3QubmFtZSkpOworICAgIGxzcC0+dGx2X2RhdGEuaG9zdG5hbWUtPm5hbWVsZW4gPSBzdHJsZW4gKGhvc3QubmFtZSk7CisgIH0KKworICAvKgorICAgKiBCdWls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WNzW2xldmVsIC0gMV07CisgICAgICAgIGxpc3Rub2RlX2FkZCAodGx2X2RhdGEuaXNfbmVpZ2hzLCBpc19uZWlnaCk7CisgICAgICB9CisgICAgICBicmVhazsKKyAgICBjYXNlIENJUkNVSVRfVF9QMlA6CisgICAgICBuZWkgPSBjaXJjdWl0LT51LnAycC5uZWlnaGJvcjsgCisgICAgICAgIGlmIChuZWkgJiYgKGxldmVsICYgbmVpLT5jaXJjdWl0X3QpKSB7CisgICAgICAgICAgaWYgKHRsdl9kYXRhLmlzX25laWdocyA9PSBOVUxMKSB7CisgICAgICAgICAgICB0bHZfZGF0YS5pc19uZWlnaHMgPSBsaXN0X25ldyAoKTsKKyAgICAgICAgICAgIHRsdl9kYXRhLmlzX25laWdocy0+ZGVsID0gZnJlZV90bHY7CisgICAgICAgICAgfQorICAgICAgICAgIGlzX25laWdoID0gWE1BTExPQyAoTVRZUEVfSVNJU19UTFYsIHNpemVvZiAoc3RydWN0IGlzX25laWdoKSk7CisgICAgICAgICAgbWVtc2V0IChpc19uZWlnaCwgMCwgc2l6ZW9mIChzdHJ1Y3QgaXNfbmVpZ2gpKTsKKyAgICAgICAgICBtZW1jcHkgKGlzX25laWdoLT5uZWlnaF9pZCwgbmVpLT5zeXNpZCwgSVNJU19TWVNfSURfTEVOKTsKKyAgICAgICAgICBpc19uZWlnaC0+bWV0cmljcyA9IGNpcmN1aXQtPm1ldHJpY3NbbGV2ZWwgLSAxXTsKKyAgICAgICAgICBsaXN0bm9kZV9hZGQgKHRsdl9kYXRhLmlzX25laWdocywgaXNfbmVpZ2gpOworICAgICAgfQorICAgICAgYnJlYWs7CisgICAgY2FzZSAgQ0lSQ1VJVF9UX1NUQVRJQ19JTjoKKyAgICAgIHpsb2dfd2FybiAoImxzcF9hcmVhX2NyZWF0ZTogdW5zdXBwb3J0ZWQgY2lyY3VpdCB0eXBlIik7CisgICAgICBicmVhazsKKyAgICBjYXNlICBDSVJDVUlUX1RfU1RBVElDX09VVDoKKyAgIC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isgIAorICBpZiAoIWxzcCkgeworICAgIHpsb2dfZXJyICgiSVNJUy1VcGQgKCVzKTogbHNwX25vbl9wc2V1ZG9fcmVnZW5lcmF0ZSgpOiBubyBMJWQgTFNQIGZvdW5kISIsCisgICAgICAgICAgICAgIGFyZWEtPmFyZWFfdGFnLAkgICAgICAKKwkgICAgICBsZXZlbCk7CisKKyAgICByZXR1cm4gSVNJU19FUlJPUjsKKyAgfQorCisgIGxzcF9jbGVhcl9kYXRhIChsc3ApOyAgCisgIGxzcF9idWlsZF9ub25wc2V1ZG8gKGxzcCwgYXJlYSk7CisgIGxzcC0+bHNwX2hlYWRlci0+cmVtX2xpZmV0aW1lID0gaHRvbnMgKGlzaXNfaml0dGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJlYS0+bWF4X2xzcF9saWZldGltZVtsZXZlbC0xXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9BR0VfSklUVEVSKSk7CisgIGxzcF9zZXFudW1fdXBkYXRlIChsc3ApOworICAgIAorICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfVVBEQVRFX1BBQ0tFVFMpIHsKKyAgICB6bG9nX2luZm8gKCJJU0lTLVVwZCAoJXMpOiByZWZyZXNoaW5nIG91ciBMJWQgTFNQICVzLCAiCisJICAgICAgICJzZXEgMHglMDh4LCBja3N1bSAweCUwNHggbGlmZXRpbWUgJXVzIiwKKwkgICAgICAgYXJlYS0+YXJlYV90YWcsCisJICAgICAgIGxldmVsLAorICAgICAgICAgICAgICAgcmF3bHNwaWRfcHJpbnQgKGxzcC0+bHNwX2hlYWRlci0+bHNwX2lkKSwKKwkgICAgICAgbnRvaGwobHNwLT5sc3BfaGVhZGVyLT5zZXFfbnVtKSwKKwkgICAgICAgbnRvaHMobHNwLT5sc3BfaGVhZGVyLT5jaGVja3N1bSksCisJICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+cmVtX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WN0IGlzaXNfYXJlYSAqYXJlYTsKKyAgdW5zaWduZWQgbG9uZyByZWZfdGltZTsKKworICBhcmVhID0gVEhSRUFEX0FSRyAodGhyZWFkKTsKKyAgYXNzZXJ0IChhcmVhKTsKKyAgCisgIGFyZWEtPnRfbHNwX3JlZnJlc2hbMF0gPSBOVUxMOworICBpZiAoYXJlYS0+aXNfdHlwZSAmIElTX0xFVkVMXzEpIAorICAgIGxzcF9ub25fcHNldWRvX3JlZ2VuZXJhdGUgKGFyZWEsIDEpOworICAKKyAgcmVmX3RpbWUgPSAgYXJlYS0+bHNwX3JlZnJlc2hbMF0gPiBNQVhfTFNQX0dFTl9JTlRFUlZBTCA/IAorICAgIE1BWF9MU1BfR0VOX0lOVEVSVkFMIDogYXJlYS0+bHNwX3JlZnJlc2hbMF07CisKKyAgYXJlYS0+dF9sc3BfcmVmcmVzaFswXSA9IHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgbHNwX3JlZnJlc2hfbDEsIGFyZWEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc2lzX2ppdHRlciAocmVmX3RpbWUsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9BR0VfSklUVEVSKSk7CisgIHJldHVybiBJU0lTX09LOworfQorCitpbnQgCitsc3BfcmVmcmVzaF9sMiAoc3RydWN0IHRocmVhZCAqdGhyZWFkKQoreworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICB1bnNpZ25lZCBsb25nIHJlZl90aW1lOworCisgIGFyZWEgPSBUSFJFQURfQVJHICh0aHJlYWQpOworICBhc3NlcnQgKGFyZWEpOworICAKKyAgYXJlYS0+dF9sc3BfcmVmcmVzaFsxXSA9IE5VTEw7CisgIGlmIChhcmVhLT5pc190eXBlICYgSVNfTEVWRUxfMikgCisgICAgbHNwX25vbl9wc2V1ZG9fcmVnZW5lcmF0ZSAoYXJlYSwgMik7CisKKyA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gICAgICAgICAgICAgIHJhd2xzcGlkX3ByaW50IChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCkpOworICB9CisKKyAgLyogdGltZSB0byBjYWxjdWxhdGUgb3VyIGNoZWNrc3VtICovCisgIGlzb19jc3VtX2NyZWF0ZSAoU1RSRUFNX0RBVEEgKGxzcC0+cGR1KSArIDEyLAorICAgICAgICAgICAgICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+cGR1X2xlbikgLSAxMiwgMTIpOworCisgIGxzcC0+dF9sc3BfdG9wX3JlZiA9IHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgdG9wX2xzcF9yZWZyZXNoLCBsc3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzaXNfaml0dGVyIChNQVhfTFNQX0dFTl9JTlRFUlZBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9MU1BfR0VOX0pJVFRFUikpOworCisgIHJldHVybiBJU0lTX09LOworfQorCit2b2lkCitnZW5lcmF0ZV90b3BvbG9neV9sc3BzIChzdHJ1Y3QgaXNpc19hcmVhICphcmVhKQoreworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisgIGludCBpLCBtYXggPSAwOworICBzdHJ1Y3QgYXJjICphcmM7CisgIHVfY2hhciBsc3BpZFtJU0lTX1NZU19JRF9MRU4gKyAyXTsKKyAgc3RydWN0IGlzaXNfbHNwICpsc3A7CisKKyAgLyogZmlyc3Qgd2UgZmluZCB0aGUgbWF4aW1hbCBub2RlICovCisgIExJU1RfTE9PUCAoYXJlYS0+dG9wb2xvZ3ksIGFyYywgbm9kZSkgeworICAgIGlmIChhcmMtPmZyb21fbm9kZSA+IG1heCkgbWF4ID0gYXJjLT5mcm9tX25vZGU7CisgICAgaWYgKGFyYy0+dG9fbm9kZSA+IG1heCkgbWF4ID0gYXJjLT50b19ub2RlOworICB9CisKKworICBmb3IgK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gKmxzcF9pZCwgdV9pbnQxNl90IHJlbV9saWZldGltZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHVfaW50MzJfdCBzZXFfbnVtLCB1X2ludDhfdCBsc3BfYml0cywgCisgICAgICAgICAgICAgICAgICAgICAgICAgIHVfaW50MTZfdCBjaGVja3N1bSwgaW50IGxldmVsKTsKK3N0cnVjdCBpc2lzX2xzcCAqbHNwX25ld19mcm9tX3N0cmVhbV9wdHIgKHN0cnVjdCBzdHJlYW0gKnN0cmVhbSwgCisJCQkJCSAgdV9pbnQxNl90IHBkdV9sZW4sICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpc2lzX2xzcCAqbHNwMCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhKTsKK3ZvaWQgbHNwX2luc2VydCAoc3RydWN0IGlzaXNfbHNwICpsc3AsIGRpY3RfdCAqbHNwZGIpOworc3RydWN0IGlzaXNfbHNwICpsc3Bfc2VhcmNoICh1X2NoYXIgKmlkLCBkaWN0X3QgKmxzcGRiKTsKKwordm9pZCBsc3BfYnVpbGRfbGlzdCAodV9jaGFyICpzdGFydF9pZCwgdV9jaGFyICpzdG9wX2lkLCAKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBsaXN0ICpsaXN0LCBkaWN0X3QgKmxzcGRiKTsKK3ZvaWQgbHNwX2J1aWxkX2xpc3Rfbm9uemVyb19odCAodV9jaGFyICpzdGFydF9pZCwgdV9jaGFyICpzdG9wX2lkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGxpc3QgKmxpc3QsIGRpY3RfdCAqbHNwZGIpOwordm9pZCBsc3BfYnVpbGRfbGlzdF9zc24gKHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQsIHN0cnVjdCBsaXN0ICpsaXN0LCAKKyAgICAgICAgICAg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gYXJndjsKKyAgX2VudnAgPSBlbnZwOworICBnZXRjd2QgKF9jd2QsIHNpemVvZiAoX2N3ZCkpOworICBpZiAoKmFyZ3ZbMF0gPT0gJy4nKQorICAgIHNucHJpbnRmIChfcHJvZ3BhdGgsIHNpemVvZiAoX3Byb2dwYXRoKSwgIiVzLyVzIiwgX2N3ZCwgX2FyZ3ZbMF0pOworICBlbHNlCisgICAgc25wcmludGYgKF9wcm9ncGF0aCwgc2l6ZW9mIChfcHJvZ3BhdGgpLCAiJXMiLCBhcmd2WzBdKTsKKyAgCisgIC8qIENvbW1hbmQgbGluZSBhcmd1bWVudCB0cmVhdG1lbnQuICovCisgIHdoaWxlICgxKSAKKyAgICB7CisgICAgICBvcHQgPSBnZXRvcHRfbG9uZyAoYXJnYywgYXJndiwgImRmOmhBcDpQOnYiLCBsb25nb3B0cywgMCk7CisgICAgCisgICAgICBpZiAob3B0ID09IEVPRikKKyAgICAgICAgYnJlYWs7CisKKyAgICAgIHN3aXRjaCAob3B0KSAKKyAgICAgICAgeworICAgICAgICBjYXNlIDA6CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ2QnOgorICAgICAgICAgIGRhZW1vbl9tb2RlID0gMTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnZic6CisgICAgICAgICAgY29uZmlnX2ZpbGUgPSBvcHRhcmc7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ0EnOgorICAgICAgICAgIHZ0eV9hZGRyID0gb3B0YXJnOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdQJzoKKyAgICAgICAgICB2dHlfcG9ydCA9IGF0b2kgKG9wdGFyZyk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ3YnOgorCSAgcHJpbnRmKCJJU0lTZCB2ZXJzaW9uICVzXG4iLCBJU0lTRF9WRVJTSU9OKTsKKwkgIHByaW50ZigiQ29weXJpZ2h0IChjKSAyMDAxLTIwMDIgU2FtcG8gU2FhcmlzdG8sIgorCQkgIiBPZmVyIFdhbGQgYW5kIEhhbm5lcyBHcmVkbGVyXG4iKTsKKyAgICAgICAgICBwcmludF92ZXJzaW9uICgiWmVicmEiKTsKKyAgICAgICAgICBleGl0ICgwKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnaCc6CisgICAgICAgICAgdXNhZ2UgKDApOworICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHVzYWdlICgxKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgCisgIC8qIHRocmVhZCBtYXN0ZXIgKi8KKyAgbWFzdGVyID0gdGhyZWFkX21hc3Rlcl9jcmVhdGUgKCk7CisKKyAgLyogcmFuZG9tIHNlZWQgZnJvbSB0aW1lICovCisgIHNyYW5kKHRpbWUoTlVMTCkpOworCisgIC8qCisgICAqICBpbml0aWFsaXphdGlvbnMKKyAgICovCisgIHNpZ25hbF9pbml0ICgpOworICBjbWRfaW5pdCAoMSk7CisgIHZ0eV9pbml0ICgpOworICBtZW1vcnlfaW5pdCAoKTsKKyAgaXNpc19pbml0ICgpOworICBkeW5fY2FjaGVfaW5pdCAoKTsKKyAgc29ydF9ub2RlICgpOworCisgIC8qIHBhcnNlIGNvbmZpZyBmaWxlICovIAorICAvKiB0aGlzIGlzIG5lZWRlZCB0aHJlZSB0aW1lcyEgYmVjYXVzZSB3ZSBoYXZlIGludGVyZmFjZXMgYmVmb3JlIHRoZSBhcmVhcyAqLworICB2dHlfcmVhZF9jb25maWcgKGNvbmZpZ19maWxlLCBjb25maWdfY3VycmVudCwgY29uZmlnX2RlZmF1bHQpOworI2lmIDAKKyAgdnR5X3JlYWRfY29uZmlnIChjb25maWdfZmlsZSwgY29uZmlnX2N1cnJlbnQsIGNvbmZpZ19kZWZhdWx0KTsKKyAgdnR5X3JlYWRfY29uZmlnIChjb25maWdfZmlsZSwgY29uZmlnX2N1cnJlbnQsIG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ludGFibGUgZm9ybWF0CisgKi8KK2NoYXIgKiBpc29uZXRfcHJpbnQgKHVfY2hhciAqZnJvbSwgaW50IGxlbikgeworICBpbnQgaSA9IDA7CisgIGNoYXIgKnBvcyA9IGlzb25ldDsKKworICBpZighZnJvbSkKKyAgICByZXR1cm4gInVua25vd24iOworCisgIHdoaWxlIChpIDwgbGVuKSB7CisgICAgaWYgKGkgJiAxKSB7CisgICAgICBzcHJpbnRmICggcG9zLCAiJTAyeCIsICooZnJvbSArIGkpKTsKKyAgICAgIHBvcyArPSAyOworICAgIH0gZWxzZSB7CisgICAgICBpZiAoaSA9PSAwKSB7IC8qIGlmIHRoZSBhcmVhIGFkZHIgaXMganVzdCBvbmUgYnl0ZSwgZWcuIDQ3LiAqLworICAgICAgICBzcHJpbnRmICggcG9zLCAiJTAyeCIsICooZnJvbSArIGkpKTsKKyAgICAgICAgcG9zICs9IDI7CisgICAgICB9IGVsc2UgeworICAgICAgICBzcHJpbnRmICggcG9zLCAiJTAyeC4iLCAqKGZyb20gKyBpKSk7CisgICAgICAgIHBvcyArPSAzOworICAgICAgfQorICAgIH0KKyAgICBpKys7CisgIH0KKyAgKihwb3MpID0gJ1wwJzsKKyAgcmV0dXJuIGlzb25ldDsKK30KKworLyoKKyAqIFJldHVybnMgMCBvbiBlcnJvciwgbGVuZ3RoIG9mIGJ1ZmYgb24gb2sKKyAqIGV4dHJhY3QgZG90IGZyb20gdGhlIGRvdHRlZCBzdHIsIGFuZCBpbnNlcnQgYWxsIHRoZSBudW1iZXIgaW4gYSBidWZmIAorICovCitpbnQKK2RvdGZvcm1hdDJidWZmICh1X2NoYXIgKmJ1ZmYsIHVfY2hhciAqZG90dGVkKQoreworICBpbnQgZG90bGVuLCBsZW4gPSAwOworICB1X2NoYXIgKnBvcyA9IGRvdHRlZDsKKyAgdV9jaGFyIG51bWJlclszXTsKKyAgaW50IG5leHRkb3Rwb3MgPSAyOworCisgIG51bWJlclsyXSA9ICdcMCc7CisgIGRvdGxlbiA9IHN0cmxlbihkb3R0ZWQpOworICBpZiAoZG90bGVuID4gNTApIHsKKyAgICAvKiB0aGlzIGNhbid0IGJlIGFuIGlzbyBuZXQsIGl0cyB0b28gbG9uZyAqLworICAgIHJldHVybiAwOworICB9CisKKyAgd2hpbGUgKCAocG9zIC0gZG90dGVkKSA8IGRvdGxlbiAmJiBsZW4gPCAyMCApIHsKKyAgICBpZiAoKnBvcyA9PSAnLicpIHsKKyAgICAgIC8qIHdlIGV4cGVjdCB0aGUgLiBhdCAyLCBhbmQgdGhhbiBldmVyeSA1ICovCisgICAgICBpZiAoKHBvcyAtIGRvdHRlZCkgIT0gbmV4dGRvdHBvcykgeworICAgICAgICBsZW4gPSAwOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIG5leHRkb3Rwb3MgKz0gNTsKKyAgICAgIHBvcysrOworICAgICAgY29udGludWU7CisgICAgfQorICAgIC8qIHdlIG11c3QgaGF2ZSBhdCBsZWFzdCB0d28gY2hhcnMgbGVmdCBoZXJlICovCisgICAgaWYgKGRvdGxlbiAtIChwb3MgLSBkb3R0ZWQpIDwgMikgeworICAgICAgbGVuID0gMDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgIGlmICgoaXN4ZGlnaXQoKGludCkqcG9zKSkgJiYgKGlzeGRpZ2l0KChpbnQpKihwb3MrMSkpKSl7CisgICAgICBtZW1jcHkgKG51bWJlciwgcG9zICwyKTsKKyAgICAgIHBvcys9MjsKKyAgICB9IGVsc2UgeworICAgICAgbGVuID0gMDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgICooYnVmZiArIGxlbikgPSAoY2hhcilzdHJ0b2wobnVtYmVyLCBOVUxMLCAxNik7CisgICAgbGVuKys7CisgIH0KKyAgCisgIHJldHVybiBsZW47Cit9CisvKgorICogY29udmVyc2lvbiBvZiBYWFhYLlhYWFguWFhYWCB0byBtZW1vcnkKKyAqLworaW50CitzeXNpZDJidWZmICh1X2NoYXIgKmJ1ZmYsIHVfY2hhciAqZG90dGVkKQorIHsKKyAgaW50IGxlbiA9IDA7CisgIHVfY2hhciAqcG9zID0gZG90dGVkOworICB1X2NoYXIgbnVtYmVyWzNdOworCisgIG51bWJlclsyXSA9ICdcMCc7CisgIC8vIHN1cmVseSBub3QgYSBzeXNpZF9zdHJpbmcgaWYgbm90IDE0IGxlbmd0aAorICBpZiAoc3RybGVuKGRvdHRlZCkgIT0gMTQpIHsKKyAgICByZXR1cm4gMDsKKyAgfQorCisgIHdoaWxlICggbGVuIDwgSVNJU19TWVNfSURfTEVOICkgeworICAgIGlmICgqcG9zID09ICcuJykgeworICAgICAgLyogdGhlIC4gaXMgbm90IHBvc2l0aW9uZWQgY29ycmVjdGx5ICovCisgICAgICBpZiAoKChwb3MgLSBkb3R0ZWQpICE9NCkgJiYgKChwb3MgLSBkb3R0ZWQpICE9IDkpKSB7IAorICAgICAgICBsZW4gPSAwOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHBvcysrOworICAgICAgY29udGludWU7CisgICAgfQorICAgIGlmICgoaXN4ZGlnaXQoKGludCkqcG9zKSkgJiYgKGlzeGRpZ2l0KChpbnQpKihwb3MrMSkpKSl7CisgICAgICBtZW1jcHkgKG51bWJlciwgcG9zICwyKTsKKyAgICAgIHBvcys9MjsKKyAgICB9IGVsc2UgeworICAgICAgbGVuID0gMDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgICooYnVmZiArIGxlbikgPSAoY2hhcilzdHJ0b2wobnVtYmVyLCBOVUxMLCAxNik7CisgICAgbGVuKys7CisgIH0KKworICByZXR1cm4gbGVuOworCit9CisKKy8qCisgKiBjb252ZXJ0cyB0aGUgbmxwaWRzIHN0cnVjdCAoZmlsbGVkIGJ5IFRMViAjMTI5KQorICogaW50byBhIHN0cmluZworICovCisKK2NoYXIgKgorbmxwaWQyc3RyaW5nIChzdHJ1Y3QgbmxwaWRzICpubHBpZHMpIHsKKyAgY2hhciAqcG9zID0gbmxwaWRzdHJpbmc7CisgIGludCBpOworCisgIGZvciAoaT0wO2k8bmxwaWRzLT5jb3VudDtpKyspIHsKKyAgICBzd2l0Y2ggKG5scGlkcy0+bmxwaWRzW2ldKSB7CisgICAgY2FzZSBOTFBJRF9JUDoKKyAgICAgIHBvcyArPSBzcHJpbnRmIChwb3MsICJJUHY0Iik7CisgICAgICBicmVhazsKKyAgICBjYXNlIE5MUElEX0lQVjY6CisgICAgICBwb3MgKz0gc3ByaW50ZiAocG9zLCAiSVB2NiIpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIHBvcyArPSBzcHJpbnRmIChwb3MsICJ1bmtub3duIik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgaWYgKG5scGlkcy0+Y291bnQtaT4xKQorICAgICAgcG9zICs9IHNwcmludGYgKHBvcywgIiwgIik7CisgICAgCisgIH0KKworICAqKHBvcykgPSAnXDAnOworICAKKyAgcmV0dXJuIG5scGlkc3RyaW5nOworfQorCisvKgorICogIHN1cHBvcnRzIHRoZSBnaXZlbiBhZiA/CisgKi8KK2ludCAKK3NwZWFrcyAoc3RydWN0IG5scGlkcyAqbmxwaWRzLCBpbnQgZmFtaWx5KQoreworICBpbnQgaSwgc3BlYWtzID0gMDsKKyAgCisgIGlmIChubHBpZHMgPT0gKHN0cnVjdCBubHBpZHMqKU5VTEwpCisgICAgcmV0dXJuIHNwZWFrczsKKyAgZm9yIChpID0gMDtpIDwgbmxwaWRzLT5jb3VudDsgaSsrKSB7CisgICAgaWYgKGZhbWlseSA9PSBBRl9JTkVUICYmIG5scGlkcy0+bmxwaWRzW2ldID09IE5MUElEX0lQKQorICAgICAgc3BlYWtzID0gMTsKKyAgICBpZiAoZmFtaWx5ID09IEFGX0lORVQ2ICYmIG5scGlkcy0+bmxwaWRzW2ldID09IE5MUElEX0lQVjYpCisgICAgICBzcGVha3MgPSAxOworICB9CisKKyAgcmV0dXJuIHNwZWFrczsKK30KKworCisvKgorICogUmV0dXJucyAwIG9uIGVycm9yLCBJUy1JUyBDaXJjdWl0IFR5cGUgb24gb2sKKyAqLworaW50IAorc3RyaW5nMmNpcmN1aXRfdCAodV9jaGFyICpzdHIpCit7CisgIAorICBpZiAoIXN0cikKKyAgICByZXR1cm4gMDsKKyAgCisgIGlmICghc3RyY21wKHN0ciwibGV2ZWwtMSIpKQorICAgIHJldHVybiBJU19MRVZFTF8xOworCisgIGlmICghc3RyY21wKHN0ciwibGV2ZWwtMi1vbmx5IikgfHwgIXN0cmNtcChzdHIsImxldmVsLTIiKSkKKyAgICByZXR1cm4gSVNfTEVWRUxfMjsKKyAgCisgIGlmICghc3RyY21wKHN0ciwibGV2ZWwtMS0yIikpCisgICAgcmV0dXJuIElTX0xFVkVMXzFfQU5EXzI7CisKKyAgcmV0dXJuIDA7Cit9CisKK2NvbnN0IGNoYXIgKgorY2lyY3VpdF90MnN0cmluZyAoaW50IGNpcmN1aXRfdCkKK3sKKyAgc3dpdGNoIChjaXJjdWl0X3QpIHsKKyAgY2FzZSBJU19MRVZFTF8xOgorICAgIHJldHVybiAiTDEiOworICBjYXNlIElTX0xFVkVMXzI6CisgICAgcmV0dXJuICJMMiI7CisgIGNhc2UgSVNfTEVWRUxfMV9BTkRfMjoKKyAgICByZXR1cm4gIkwxTDIiOworICBkZWZhdWx0OgorICAgIHJldHVybiAiPz8iOworICB9CisKKyAgcmV0dXJuIE5VTEw7IC8qIG5vdCByZWFjaGVkICovCit9CisKK2NvbnN0IGNoYXIgKgorc3lzdDJzdHJpbmcgKGludCB0eXBlKQoreworICBzd2l0Y2ggKHR5cGUpIHsKKyAgY2FzZSBJU0lTX1NZU1RZUEVfRVM6CisgICAgcmV0dXJuICJFUyI7CisgIGNhc2UgSVNJU19TWVNUWVBFX0lTOgorICAgIHJldHVybiAiSVMiOworICBjYXNlIElTSVNfU1lTVFlQRV9MMV9JUzoKKyAgICByZXR1cm4gIjEiOworICBjYXNlIElTSVNfU1lTVFlQRV9MMl9JUzoKKyAgICByZXR1cm4gIjIiOworICBkZWZhdWx0OgorICAgIHJldHVybiAiPz8iOworICB9CisKKyAgcmV0dXJuIE5VTEw7IC8qIG5vdCByZWFjaGVkICovCit9CisKKy8qCisgKiBQcmludCBmdW5jdGlvbnMgLSB3ZSBwcmludCB0byBzdGF0aWMgdmFycworICovCitjaGFyICoKK3NucGFfcHJpbnQgKHVfY2hhciAqZnJvbSkKK3sKKyAgaW50IGkgPSAwOworICB1X2NoYXIgKnBvcyA9IHNucGE7CisKKyAgaWYoIWZyb20pCisgICAgcmV0dXJuICJ1bmtub3duIjsKKyAgCisgIHdoaWxlIChpIDwgRVRIX0FMRU4gLSAxKSB7CisgICAgaWYgKGkgJiAxKSB7CisgICAgICBzcHJpbnRmICggcG9zLCAiJTAyeC4iLCAqKGZyb20gKyBpKSk7CisgICAgICBwb3MgKz0gMzsKKyAgICB9IGVsc2UgeworICAgICAgc3ByaW50ZiAoIHBvcywgIiUwMngiLCAqKGZyb20gKyBpKSk7CisgICAgICBwb3MgKz0gMjsKKworICAgIH0KKyAgICBpKys7CisgIH0KKworICBzcHJpbnRmIChwb3MsICIlMDJ4IiwgKihmcm9tICsgKElTSVNfU1lTX0lEX0xFTiAtIDEpKSk7CisgIHBvcyArPSAyOworICAqKHBvcykgPSAnXDAnOworCisgIHJldHVybiBzbnBhOworfQorCitjaGFyICoKK3N5c2lkX3ByaW50ICh1X2NoYXIgKmZyb20pCit7CisgIGludCBpID0gMDsKKyAgY2hhciAqcG9zID0gc3lzaWQ7CisKKyAgaWYoIWZyb20pCisgICAgcmV0dXJuICJ1bmtub3duIjsKKworICB3aGlsZSAoaSA8IElTSVNfU1lTX0lEX0xFTiAtIDEpIHsKKyAgICBpZiAoaSAmIDEpIHsKKyAgICAgIHNwcmludGYgKCBwb3MsICIlMDJ4LiIsICooZnJvbSArIGkpKTsKKyAgICAgIHBvcyArPSAzOworICAgIH0gZWxzZSB7CisgICAgICBzcHJpbnRmICggcG9zLCAiJTAyeCIsICooZnJvbSArIGkpKTsKKyAgICAgIHBvcyArPSAyOworICAgIAorICAgIH0gCisgICAgaSsrOworICB9CisKKyAgc3ByaW50ZiAocG9zLCAiJTAyeCIsICooZnJvbSArIChJU0lTX1NZU19JRF9MRU4gLSAxKSkpOworICBwb3MgKz0gMjsKKyAgKihwb3MpID0gJ1wwJzsKKyAgCisgIHJldHVybiBzeXNpZDsKK30KKworY2hhciAqCityYXdsc3BpZF9wcmludCAodV9jaGFyICpmcm9tKQoreworICBjaGFyICpwb3MgPSBsc3BpZDsKKyAgaWYoIWZyb20pCisgICAgcmV0dXJuICJ1bmtub3duIjsKKyAgbWVtY3B5KHBvcywgc3lzaWRfcHJpbnQoZnJvbSksIDE1KTsKKyAgcG9zICs9IDE0OworICBzcHJpbnRmIChwb3MsICIuJTAyeCIsIExTUF9QU0VVRE9fSUQoZnJvbSkpOworICBwb3MgKz0gMzsKKyAgc3ByaW50ZiAocG9zLCAiLSUwMngiLCBMU1BfRlJBR01FTlQoZnJvbSkpOworICBwb3MgKz0gMzsKKworICAqKHBvcykgPSAnXDAnOworCisgIHJldHVybiBsc3BpZDsKK30KKworY2hhciAqCit0aW1lMnN0cmluZyAodV9pbnQzMl90IHRpbWUpIHsKKyAgY2hhciAqcG9zID0gZGF0ZXN0cmluZzsgCisgIHVfaW50MzJfdCByZXN0OworCisgIGlmICh0aW1lPT0wKQorICAgIHJldHVybiAiLSI7CisKKyAgaWYodGltZS9TRUNTX1BFUl9ZRUFSKQorICAgIHBvcyArPSBzcHJpbnRmIChwb3MsICIldVkiLHRpbWUvU0VDU19QRVJfWUVBUik7CisgIHJlc3Q9dGltZSVTRUNTX1BFUl9ZRUFSOyAgICAKKyAgaWYocmVzdC9TRUNTX1BFUl9NT05USCkKKyAgICBwb3MgKz0gc3ByaW50ZiAocG9zLCAiJXVNIixyZXN0L1NFQ1NfUEVSX01PTlRIKTsKKyAgcmVzdD1yZXN0JVNFQ1NfUEVSX01PTlRIOyAgCisgIGlmKHJlc3QvU0VDU19QRVJfV0VFSykKKyAgICBwb3MgKz0gc3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bWUyc3RyaW5nICh1X2ludDMyX3QpOworLyogdHlwZWRlZiBzdHJ1Y3QgbmxwaWRzIG5scGlkczsgKi8KK2NoYXIgKm5scGlkMnN0cmluZyAoc3RydWN0IG5scGlkcyAqKTsKKworCisvKgorICogbWlzYyBmdW5jdGlvbnMKKyAqLworaW50ICBzcGVha3MgKHN0cnVjdCBubHBpZHMgKm5scGlkcywgaW50IGZhbWlseSk7Cit1bnNpZ25lZCBsb25nIGlzaXNfaml0dGVyICh1bnNpZ25lZCBsb25nIHRpbWVyLCB1bnNpZ25lZCBsb25nIGppdHRlcik7CisKKy8qCisgKiBtYWNyb3MKKyAqLworI2RlZmluZSBHRVRTWVNJRChBLEwpIChBLT5hcmVhX2FkZHIgKyAoQS0+YWRkcl9sZW4gLSAoTCArIDEpKSkKKworCisvKiBzdGF0aWNseSBhc3NpZ25lZCB2YXJzIGZvciBwcmludGluZyBwdXJwb3NlcyAqLworc3RydWN0IGluX2FkZHIgICAgICAgICAgICAgIG5ld19wcmVmaXg7IAorLyogbGVuIG9mIHh4eHgueHh4eC54eHh4ICsgcGxhY2UgZm9yICMwIHRlcm1pbmF0aW9uICovCitjaGFyICAgICAgICAgICAgICAgICAgICAgICAgIHN5c2lkWzE1XTsgCisvKiBsZW4gb2YgeHh4eC54eHh4Lnh4eHggKyBwbGFjZSBmb3IgIzAgdGVybWluYXRpb24gKi8KK2NoYXIgICAgICAgICAgICAgICAgICAgICAgICAgIHNucGFbMTVdOyAKKy8qIGxlbiBvZiB4eC54eHh4Lnh4eHgueHh4eC54eHh4Lnh4eHgueHh4eC54eHh4Lnh4eHgueHh4eC54eCAqLworY2hhciAgICAgICAgICAgICAgICAgICAgICAgIGlzb25ldFs1MV07IAorLyogKyBwbGFjZSBmb3IgIzAgdGVybWluYXRpb24gKi8KKy8qIGxlbiBvZiB4eHh4Lnh4eHgueHh4eC54eC54eCArIHBsYWNlIGZvciAjMCB0ZXJtaW5hdGlvbiAqLworY2hhciAgICAgICAgICAgICAgIC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N0IGdyb3VwcworICAgICAqIGFjY29yZGluZyB0bworICAgICAqIDguNC4yIC0gQnJvYWRjYXN0IHN1Ym5ldHdvcmsgSUlIIFBEVXMKKyAgICAgKiBGSVhNRTogaXMgdGhlcmUgYSBjYXNlIG9ubHkgb25lIHdpbGwgZmFpbD8/CisgICAgICovCisgICAgaWYgKGNpcmN1aXQtPmNpcmN1aXRfaXNfdHlwZSAmIElTX0xFVkVMXzEpIHsKKyAgICAgIC8qIGpvaW5pbmcgQUxMX0wxX0lTUyAqLworICAgICAgcmV0dmFsID0gaXNpc19tdWx0aWNhc3Rfam9pbiAoY2lyY3VpdC0+ZmQsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWl0LT5pbnRlcmZhY2UtPmlmaW5kZXgpOworICAgICAgLyogam9pbmluZyBBTExfSVNTICovCisgICAgICByZXR2YWwgPSBpc2lzX211bHRpY2FzdF9qb2luIChjaXJjdWl0LT5mZCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPmludGVyZmFjZS0+aWZpbmRleCk7CisgICAgfQorICAgIGlmIChjaXJjdWl0LT5jaXJjdWl0X2lzX3R5cGUgJiBJU19MRVZFTF8yKQorICAgICAgLyogam9pbmluZyBBTExfTDJfSVNTICovCisgICAgICByZXR2YWwgPSBpc2lzX211bHRpY2FzdF9qb2luIChjaXJjdWl0LT5mZCwgMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPmludGVyZmFjZS0+aWZpbmRleCk7CisgIH0gZWxzZSB7CisgICAgcmV0dmFsID0gaXNpc19tdWx0aWNhc3Rfam9pbiAoY2lyY3VpdC0+ZmQsIDAsIGNpcmN1aXQtPmludGVyZmFjZS0+aWZpbmRleCk7CisgIH0KKworICByZXR1cm4gcmV0dmFsOworfQorCisjZWxzZQorCitpbnQKK29wZW5fYnBmX2RldiAoc3RydWN0IGlzaXNfY2lyY3Vp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gMCkgeworICAgIHpsb2dfd2FybiAoIm9wZW5fYnBmX2RldigpOiBmYWlsZWQgdG8gaW5zdGFsbCBmaWx0ZXI6ICVzIiwgCisgICAgICAgICAgICAgICBzdHJlcnJvciAoZXJybm8pKTsKKyAgICByZXR1cm4gSVNJU19XQVJOSU5HOworICB9CisKKworICBhc3NlcnQgKGZkID4gMCk7CisKKyAgY2lyY3VpdC0+ZmQgPSBmZDsKKyAgCisgIHJldHVybiBJU0lTX09LOworfQorCisjZW5kaWYgLyogR05VX0xJTlVYICovCisKKy8qCisgKiBDcmVhdGUgdGhlIHNvY2tldCBhbmQgc2V0IHRoZSB0eC9yeCBmdW5jcworICovCitpbnQKK2lzaXNfc29ja19pbml0IChzdHJ1Y3QgaXNpc19jaXJjdWl0ICpjaXJjdWl0KQoreworICBpbnQgcmV0dmFsID0gSVNJU19PSzsKKworCisjaWZkZWYgR05VX0xJTlVYCisgIHJldHZhbCA9IG9wZW5fcGFja2V0X3NvY2tldCAoY2lyY3VpdCk7CisjZWxzZQorICByZXR2YWwgPSBvcGVuX2JwZl9kZXYgKGNpcmN1aXQpOworI2VuZGlmCisgIAorICBpZiAocmV0dmFsID09IElTSVNfT0spIHsKKyAgICBpZiAoY2lyY3VpdC0+Y2lyY190eXBlID09IENJUkNVSVRfVF9CUk9BRENBU1QpIHsKKyAgICAgIGNpcmN1aXQtPnR4ID0gaXNpc19zZW5kX3BkdV9iY2FzdDsKKyAgICAgIGNpcmN1aXQtPnJ4ID0gaXNpc19yZWN2X3BkdV9iY2FzdDsKKyAgICB9CisgICAgZWxzZSBpZiAoY2lyY3VpdC0+Y2lyY190eXBlID09IENJUkNVSVRfVF9QMlApIHsKKyAgICAgIGNpcmN1aXQtPnR4ID0gaXNpc19zZW5kX3BkdV9wMnA7CisgICAgICBjaXJjdWl0LT5yeCA9IGlzaXNfcmVjdl9wZHVfcDJwOworICAgIH0KKyAgICBlbHNlIHsKKyAgICAgIHpsb2dfd2FybiAoImlzaXNfc29ja19pbml0KCk6IHVua25vd24gY2lyY3VpdCB0eXBlIik7CisgICAgICByZXR2YWwgPSBJU0lTX1dBUk5JTkc7CisgICAgfQorICB9CisgIAorICByZXR1cm4gcmV0dmFsOworfQorCisKK3N0YXRpYyBpbmxpbmUgaW50IAorbGxjX2NoZWNrICh1X2NoYXIgKmxsYykKK3sKKworICBpZigqbGxjICE9IElTT19TQVAgfHwgKihsbGMgKyAxKSAhPSBJU09fU0FQIHx8ICoobGxjICsyKSAhPSAzKQorICAgIHJldHVybiAwOworICAKKyAgcmV0dXJuIDE7Cit9CisKKyNpZmRlZiBHTlVfTElOVVgKK2ludAoraXNpc19yZWN2X3BkdV9iY2FzdCAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCwgdV9jaGFyICpzc25wYSkKK3sKKyAgaW50IGJ5dGVzcmVhZCwgYWRkcl9sZW47CisgIHN0cnVjdCBzb2NrYWRkcl9sbCBzX2FkZHI7CisgIHVfY2hhciBsbGNbTExDX0xFTl07CisKKyAgYWRkcl9sZW4gPSBzaXplb2YgKHNfYWRkcik7CisKKyAgbWVtc2V0ICgmc19hZGRyLCAwLCBzaXplb2YgKHN0cnVjdCBzb2NrYWRkcl9sbCkpOworCisgIGJ5dGVzcmVhZCA9IHJlY3Zmcm9tIChjaXJjdWl0LT5mZCwgKHZvaWQgKikmbGxjLAorICAgICAgICAgICAgICAgICAgICAgICAgTExDX0xFTiwgTVNHX1BFRUssCisgICAgICAgICAgICAgICAgICAgICAgICAoc3RydWN0IHNvY2thZGRyICopJnNfYWRkciwgJmFkZHJfbGVuKTsKKworICBpZiAoYnl0ZXNyZWFkIDwgMCkgeworICAgIHpsb2dfd2FybiAoImlzaXNfcmVjdl9wYWNrZXRfYmNhc3QoKTogZmQgJWQsIHJlY3Zmcm9tICgpOiAlcyIsIAorICAgICAgICAgICAgICAgY2lyY3VpdC0+ZmQsICBzdHJlcnJvciAoZXJybm8pKTsKKyAgICB6bG9nX3dhcm4gKCJjaXJjdWl0I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VAsIHNpemVvZiAoc3RydWN0IGluNl9hZGRyKSk7CisgICAgICBtZW1jcHkgKG1hbGxvY2VkLCBpcHY2X2FkZHIsIHNpemVvZiAoc3RydWN0IGluNl9hZGRyKSk7CisgICAgICBsaXN0bm9kZV9hZGQgKGFkai0+aXB2Nl9hZGRycywgbWFsbG9jZWQpOworICAgIH0KKyAgfQorCit9CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCisKKworCisvKgorICogIFJFQ0VJVkUgU0lERSAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICovCisKKy8qCisgKiBQcm9jZXNzIFAyUCBJSUgKKyAqIElTTyAtIDEwNTg5CisgKiBTZWN0aW9uIDguMi41IC0gUmVjZWl2aW5nIHBvaW50LXRvLXBvaW50IElJSCBQRFVzCisgKgorICovCitzdGF0aWMgaW50Citwcm9jZXNzX3AycF9oZWxsbyAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCkKK3sKKyAgaW50IHJldHZhbCA9IElTSVNfT0s7CisgIHN0cnVjdCBpc2lzX3AycF9oZWxsb19oZHIgKmhkcjsKKyAgc3RydWN0IGlzaXNfYWRqYWNlbmN5ICphZGo7CisgIHVfaW50MzJfdCBleHBlY3RlZCA9IDAsIGZvdW5kOworICBzdHJ1Y3QgdGx2cyB0bHZzOworCisgIGlmICgoc3RyZWFtX2dldF9lbmRwIChjaXJjdWl0LT5yY3Zfc3RyZWFtKSAtIAorICAgICAgIHN0cmVhbV9nZXRfZ2V0cCAoY2lyY3VpdC0+cmN2X3N0cmVhbSkpIDwKKyAgICAgIElTSVNfUDJQSEVMTE9fSERSTEVOKSB7CisgICAgemxvZ193YXJuICgiUGFja2V0IHRvbyBzaG9ydCIpOworICAgIHJldHVybiBJU0lTX1dBUk5JTkc7CisgIH0KKworICAvKiA4LjIuNS4xIFBEVSBhY2NlcHRhbmNlIHRlc3RzICovCisKKyAgLyogOC4yLjUuMSBhKSBleHRlcm5hbCBkb21haW4gdW50cnVlICovCisgIC8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EFHX05MUElEOworICBleHBlY3RlZCB8PSBUTFZGTEFHX0lQVjRfQUREUjsKKyAgZXhwZWN0ZWQgfD0gVExWRkxBR19JUFY2X0FERFI7CisKKyAgcmV0dmFsID0gcGFyc2VfdGx2cyAoY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsCisJCSAgICAgICBTVFJFQU1fUE5UIChjaXJjdWl0LT5yY3Zfc3RyZWFtKSwKKwkJICAgICAgIG50b2hzIChoZHItPnBkdV9sZW4pIC0gSVNJU19QMlBIRUxMT19IRFJMRU4gCisJCSAgICAgICAtIElTSVNfRklYRURfSERSX0xFTiwKKwkJICAgICAgICZleHBlY3RlZCwKKwkJICAgICAgICZmb3VuZCwKKwkJICAgICAgICZ0bHZzKTsKKworICBpZiAocmV0dmFsID4gSVNJU19XQVJOSU5HKSB7CisgICAgZnJlZV90bHZzICgmdGx2cyk7CisgICAgcmV0dXJuIHJldHZhbDsKKyAgfTsKKworICAvKiA4LjIuNS4xIGMpIEF1dGhlbnRpY2F0aW9uICovCisgIGlmIChjaXJjdWl0LT5wYXNzd2QudHlwZSkgeworICAgIGlmICghKGZvdW5kICYgVExWRkxBR19BVVRIX0lORk8pIHx8IAorCWF1dGhlbnRpY2F0aW9uX2NoZWNrICgmY2lyY3VpdC0+cGFzc3dkLCAmdGx2cy5hdXRoX2luZm8pKSB7CisgICAgICBpc2lzX2V2ZW50X2F1dGhfZmFpbHVyZSAoY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsIAorCQkJICAgICAgICJQMlAgaGVsbG8gYXV0aGVudGljYXRpb24gZmFpbHVyZSIsIAorCQkJICAgICAgIGhkci0+c291cmNlX2lkKTsKKyAgICAgIHJldHVybiBJU0lTX09LOworICAgIH0KKyAgfQorCisgIC8qIHdlIGRvIHRoaXMgbm93IGJlY2F1c2UgdGhlIGFkaiBtYXkgbm90IHN1cnZpdmUgdGlsbCB0aGUgZW5kLi4uICovCisKKyAgLyogd2UgbmVlZCB0byBjb3B5IGFkZHJlc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2FnZSBsZXZlbCAxICovCisgICAgICAgICAgYWRqLT5hZGpfdXNhZ2UgPSBJU0lTX0FESl9MRVZFTDE7CisgICAgICAgIH0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwxKSB7CisgICAgICAgICAgOyAvKiBhY2NlcHQgKi8KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgSVNfTEVWRUxfMjoKKyAgICAgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICAgICAgLyogKDcpIHJlamVjdCAtIHdyb25nIHN5c3RlbSB0eXBlIGV2ZW50ICovCisgICAgICAgICAgemxvZ193YXJuICgid3JvbmdTeXN0ZW1UeXBlIik7CisgICAgICAgICAgcmV0dXJuIElTSVNfV0FSTklORzsgLyogUmVqZWN0ICovCisgICAgICAgIH0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwxKSB7CisgICAgICAgICAgLyogKDYpIGRvd24gLSB3cm9uZyBzeXN0ZW0gKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIldyb25nIFN5c3RlbSIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgIH0KKworICAgIC8qIDguMi41LjIgYSkgMykgSWYgdGhlIHN5c3RlbSBpcyBMMUwyIC0gdGFibGUgNiAqLworICAgIGlmIChjaXJjdWl0LT5hcmVhLT5pc190eXBlID09IElTX0xFVkVMXzFfQU5EXzIpIHsKKyAgICAgIHN3aXRjaCAoaGRyLT5jaXJjdWl0X3QpIHsKKyAgICAgIGNhc2UgSVNfTEVWRUxfMToKKyAgICAgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICAgICAgLyogKDYpIGFkaiBzdGF0ZSB1cCAqLworICAgICAgICAgI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KKyAgICAgICAgICAvKiAoOCkgZG93biAtIHdyb25nIHN5c3RlbSAqLworICAgICAgICAgIGlzaXNfYWRqX3N0YXRlX2NoYW5nZSAoYWRqLCBJU0lTX0FESl9ET1dOLCAiV3JvbmcgU3lzdGVtIik7CisgICAgICAgIH0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwyKSB7CisgICAgICAgICAgOyAvKiBBY2NlcHQgKi8KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgSVNfTEVWRUxfMV9BTkRfMjoKKyAgICAgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICAgICAgLyogKDYpIGFkaiBzdGF0ZSB1cCAqLworICAgICAgICAgIGlzaXNfYWRqX3N0YXRlX2NoYW5nZSAoYWRqLCBJU0lTX0FESl9VUCwgTlVMTCk7CisgICAgICAgICAgLyogKDEwKSBhZGogdXNhZ2UgbGV2ZWwgMSAqLworICAgICAgICAgIGFkai0+YWRqX3VzYWdlID0gSVNJU19BREpfTEVWRUwxQU5EMjsKKyAgICAgICAgfSBlbHNlIGlmICgoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwxKSB8fAorICAgICAgICAgICAgICAgICAgIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDIpKSB7CisgICAgICAgICAgLyogKDgpIGRvd24gLSB3cm9uZyBzeXN0ZW0gKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIldyb25nIFN5c3RlbSIpOworICAgICAgICB9IGVsc2UgaWYgKGFkai0+YWRqX3VzYWdlID09IElTSVNfQURKX0xFVkVMMUFORDIpIHsKKyAgICAgICAgICA7IC8qIEFjY2VwdCAqLworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgIH0KKworICAgIC8qIDguMi41LjIgYSkgNCkgSWYgdGhlIHN5c3RlbSBpcyBMMiAtIHRhYmxlIDcgKi8KKyAgICBpZiAoY2lyY3VpdC0+YXJlYS0+aXNfdHlwZSA9PSBJU19MRVZFTF8yKSB7CisgICAgICBzd2l0Y2ggKGhkci0+Y2lyY3VpdF90KSB7CisgICAgICBjYXNlIElTX0xFVkVMXzE6CisgICAgICAgIGlmIChhZGotPmFkal9zdGF0ZSAhPSBJU0lTX0FESl9VUCkgeworICAgICAgICAgIC8qICg1KSByZWplY3QgLSB3cm9uZyBzeXN0ZW0gdHlwZSBldmVudCAqLworICAgICAgICAgIHpsb2dfd2FybiAoIndyb25nU3lzdGVtVHlwZSIpOworICAgICAgICAgIHJldHVybiBJU0lTX1dBUk5JTkc7IC8qIFJlamVjdCAqLworICAgICAgICB9IGVsc2UgaWYgKChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDFBTkQyKSB8fAorICAgICAgICAgICAgICAgICAgIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDIpKSB7CisgICAgICAgICAgLyogKDYpIGRvd24gLSB3cm9uZyBzeXN0ZW0gKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIldyb25nIFN5c3RlbSIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBJU19MRVZFTF8xX0FORF8yOgorICAgICAgY2FzZSBJU19MRVZFTF8yOgorICAgICAgICBpZiAoYWRqLT5hZGpfc3RhdGUgIT0gSVNJU19BREpfVVApIHsKKyAgICAgICAgICAvKiAoNykgYWRqIHN0YXRlIHVwICovCisgICAgICAgICAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX1VQLCBOVUxMKTsKKyAgICAgICAgICAvKiAoOCkgYWRqIHVzYWdlIGxldmVsIDIgKi8KKyAgICAgICAgICBhZGotPmFkal91c2FnZSA9IElTSVNfQURKX0xFVkVMMjsKKyAgICAgICAgfSBlbHNlIGlmIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDFBTkQyKSB7CisgICAgICAgICAgLyogKDYpIGRvd24gLSB3cm9uZyBzeXN0ZW0gKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIldyb25nIFN5c3RlbSIpOworICAgICAgICB9IGVsc2UgaWYgKGFkai0+YWRqX3VzYWdlID09IElTSVNfQURKX0xFVkVMMikgeworICAgICAgICAgIDsgLyogQWNjZXB0ICovCisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgfQorICB9CisgIC8qIDguMi41LjIgYikgaWYgbm8gbWF0Y2ggd2FzIGRldGVjdGVkICovCisgIGVsc2UKKyAgeworICAgIGlmIChjaXJjdWl0LT5hcmVhLT5pc190eXBlID09IElTX0xFVkVMXzEpIHsKKyAgICAgIC8qIDguMi41LjIgYikgMSkgaXNfdHlwZSBMMSBhbmQgYWRqIGlzIG5vdCB1cCAqLworICAgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICAgIGlzaXNfYWRqX3N0YXRlX2NoYW5nZSAoYWRqLCBJU0lTX0FESl9ET1dOLCAiQXJlYSBNaXNtYXRjaCIpOworICAgICAgLyogOC4yLjUuMiBiKSAyKWlzX3R5cGUgTDEgYW5kIGFkaiBpcyB1cCAqLworICAgICAgfSBlbHNlIHsKKyAgICAgICAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX0RPV04sICJEb3duIC0gQXJlYSBNaXNtYXRjaCIpOworICAgICAgfQorICAgIH0KKyAgICAvKiA4LjIuNS4yIGIgMyBJZiB0aGUgc3lzdGVtIGlzIEwyIG9yIEwxTDIgLSB0YWJsZSA4ICovCisgICAgZWxzZQorICAgIHsKKyAgICAgIHN3aXRjaCAoaGRyLT5jaXJjdWl0X3QpIHsKKyAgICAgIGNhc2UgSVNfTEVWRUxfMToKKyAgICAgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICAgICAgLyogKDYpIHJlamVjdCAtIEFyZWEgTWlzbWF0Y2ggZXZlbnQgKi8KKyAgICAgICAgICB6bG9nX3dhcm4gKCJBcmVhTWlzbWF0Y2giKTsKKyAgICAgICAgICByZXR1cm4gSVNJU19XQVJOSU5HOyAvKiBSZWplY3QgKi8KKyAgICAgICAgfSBlbHNlIGlmIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDEpIHsKKyAgICAgICAgICAvKiAoNykgZG93biAtIGFyZWEgbWlzbWF0Y2ggKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIkFyZWEgTWlzbWF0Y2giKTsKKworICAgICAgICB9IGVsc2UgaWYgKChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDFBTkQyKSB8fAorICAgICAgICAgICAgICAgICAgIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDIpKSB7CisgICAgICAgICAgLyogKDcpIGRvd24gLSB3cm9uZyBzeXN0ZW0gKi8KKyAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIldyb25nIFN5c3RlbSIpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBJU19MRVZFTF8xX0FORF8yOgorICAgICAgY2FzZSBJU19MRVZFTF8yOgorICAgICAgICBpZiAoYWRqLT5hZGpfc3RhdGUgIT0gSVNJU19BREpfVVApIHsKKyAgICAgICAgICAvKiAoOCkgYWRqIHN0YXRlIHVwICovCisgICAgICAgICAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX1VQLCBOVUxMKTsKKyAgICAgICAgICAvKiAoOSkgYWRqIHVzYWdlIGxldmVsIDIgKi8KKyAgICAgICAgICBhZGotPmFkal91c2FnZSA9IElTSVNfQURKX0xFVkVMMjsKKyAgICAgICAgfSBlbHNlIGlmIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDEpIHsKKyAgICAgICAgICAvKiAoNykgZG93biAtIHdyb25nIHN5c3RlbSAqLworICAgICAgICAgIGlzaXNfYWRqX3N0YXRlX2NoYW5nZSAoYWRqLCBJU0lTX0FESl9ET1dOLCAiV3JvbmcgU3lzdGVtIik7CisgICAgICAgIH0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwxQU5EMikgeworICAgICAgICAgIGlmIChoZHItPmNpcmN1aXRfdCA9PSBJU19MRVZFTF8yKSB7CisgICAgICAgICAgICAvKiAoNykgZG93biAtIHdyb25nIHN5c3RlbSAqLworICAgICAgICAgICAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX0RPV04sICJXcm9uZyBTeXN0ZW0iKTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLyogKDcpIGRvd24gLSBhcmVhIG1pc21hdGNoICovCisgICAgICAgICAgICBpc2lzX2Fkal9zdGF0ZV9jaGFuZ2UgKGFkaiwgSVNJU19BREpfRE9XTiwgIkFyZWEgTWlzbWF0Y2giKTsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwyKSB7CisgICAgICAgICAgOyAvKiBBY2NlcHQgKi8KKyAgICAgICAgfQorICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICB9CisgIH0KKyAgLyogOC4yLjUuMiBjKSBpZiB0aGUgYWN0aW9uIHdhcyB1cCAtIGNvbXBhcmluZyBjaXJjdWl0IElEcyAqLworICAvKiBGSVhNRSAtIE1pc3NpbmcgcGFydHMgKi8KKworCisgIC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5jaXJjdWl0X3QpOworICAgIHJldHVybiBJU0lTX0VSUk9SOworICB9CisgIC8qCisgICAqIFRoZW4gZ2V0IHRoZSB0bHZzCisgICAqLworICBleHBlY3RlZCB8PSBUTFZGTEFHX0FVVEhfSU5GTzsKKyAgZXhwZWN0ZWQgfD0gVExWRkxBR19BUkVBX0FERFJTOworICBleHBlY3RlZCB8PSBUTFZGTEFHX0xBTl9ORUlHSFM7CisgIGV4cGVjdGVkIHw9IFRMVkZMQUdfTkxQSUQ7CisgIGV4cGVjdGVkIHw9IFRMVkZMQUdfSVBWNF9BRERSOworICBleHBlY3RlZCB8PSBUTFZGTEFHX0lQVjZfQUREUjsKKworICByZXR2YWwgPSBwYXJzZV90bHZzIChjaXJjdWl0LT5hcmVhLT5hcmVhX3RhZywKKyAgICAgICAgICAgICAgICAgICAgICAgU1RSRUFNX1BOVCAoY2lyY3VpdC0+cmN2X3N0cmVhbSksCisgICAgICAgICAgICAgICAgICAgICAgIGhkci5wZHVfbGVuIC0gSVNJU19MQU5IRUxMT19IRFJMRU4gLSBJU0lTX0ZJWEVEX0hEUl9MRU4sCisgICAgICAgICAgICAgICAgICAgICAgICZleHBlY3RlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgJmZvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAmdGx2cyk7CisKKyAgaWYgKHJldHZhbCA+IElTSVNfV0FSTklORykgeworICAgIHpsb2dfd2FybiAoInBhcnNlX3RsdnMoKSBmYWlsZWQiKTsKKyAgICBnb3RvIG91dDsKKyAgfQorCisgIGlmICghKGZvdW5kICYgVExWRkxBR19BUkVBX0FERFJTKSkgeworICAgIHpsb2dfd2FybiAoIk5vIEFyZWEgYWRkcmVzc2VzIFRMViBpbiBMZXZlbCAlZCBMQU4gSVMgdG8gSVMgaGVsbG8iLCBsZXZlbCk7CisgICAgcmV0dmFsID0gSVNJU19XQVJOSU5HOworICAgIGdvdG8gb3V0OworICB9CisKKyAgaWYgKGNpcmN1aXQtPnBhc3N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aik7CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCisKKyAgYWRqLT5jaXJjdWl0X3QgPSBoZHIuY2lyY3VpdF90OworCisgIC8qIGxldHMgdGFrZSBjYXJlIG9mIHRoZSBleHBpcnkgKi8KKyAgaWYgKGFkai0+dF9leHBpcmUpIHsKKyAgICB0aHJlYWRfY2FuY2VsIChhZGotPnRfZXhwaXJlKTsKKyAgfQorICBhZGotPnRfZXhwaXJlID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLCBpc2lzX2Fkal9leHBpcmUsIGFkaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nKWFkai0+aG9sZF90aW1lKTsKKworICAvKgorICAgKiBJZiB0aGUgc25wYSBmb3IgdGhpcyBjaXJjdWl0IGlzIGZvdW5kIGZyb20gTEFOIE5laWdoYm91cnMgVExWCisgICAqIHdlIGhhdmUgdHdvLXdheSBjb21tdW5pY2F0aW9uIC0+IGFkamFjZW5jeSBjYW4gYmUgcHV0IHRvIHN0YXRlICJ1cCIKKyAgICovCisKKyAgaWYgKGZvdW5kICYgVExWRkxBR19MQU5fTkVJR0hTKSB7CisgICAgaWYgKGFkai0+YWRqX3N0YXRlICE9IElTSVNfQURKX1VQKSB7CisgICAgICBMSVNUX0xPT1AgKHRsdnMubGFuX25laWdocywgc25wYSwgbm9kZSkKKyAgICAgICAgaWYgKCFtZW1jbXAgKHNucGEsIGNpcmN1aXQtPnUuYmMuc25wYSwgRVRIX0FMRU4pKSB7CisgICAgICAgICAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX1VQLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvd24gU05QQSBmb3VuZCBpbiBMQU4gTmVpZ2hib3VycyBUTFYiKTsKKyAgICAgICAgfQorICAgIH0KKyAgfQorCisgb3V0OgorICAvKiBERUJVR19BREpfUEFDS0VUUyAqLworICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVU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UG9pbnQgKi8KKworICBpZiAoY2lyY3VpdC0+Y2lyY190eXBlID09IENJUkNVSVRfVF9CUk9BRENBU1QpIHsKKyAgICBhZGogPSBpc2lzX2Fkal9sb29rdXBfc25wYSAoc3NucGEsIGNpcmN1aXQtPnUuYmMuYWRqZGJbbGV2ZWwgLSAxXSk7CisgICAgaWYgKCFhZGopIHsKKyAgICAgIHpsb2dfaW5mbyAoIiglcyk6IERTID09PT09PT0gTFNQICVzLCBzZXEgMHglMDh4LCBja3N1bSAweCUwNHgsICIKKwkJICJsaWZldGltZSAldXMgb24gJXMiLAorCQkgY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsCisJCSByYXdsc3BpZF9wcmludCAoaGRyLT5sc3BfaWQpLAorCQkgbnRvaGwgKGhkci0+c2VxX251bSksCisJCSBudG9ocyAoaGRyLT5jaGVja3N1bSksCisJCSBudG9ocyAoaGRyLT5yZW1fbGlmZXRpbWUpLCAKKwkJIGNpcmN1aXQtPmludGVyZmFjZS0+bmFtZSk7CisgICAgICByZXR1cm4gSVNJU19XQVJOSU5HOyAvKiBTaWxlbnRseSBkaXNjYXJkICovCisgICAgfQorICB9CisKKyAgLyogZm9yIG5vbiBicm9hZGNhc3QsIHdlIGp1c3QgbmVlZCB0byBmaW5kIHNhbWUgbGV2ZWwgYWRqICovCisgIGVsc2UgeworICAgIC8qIElmIG5vIGFkaiwgb3Igbm8gc2hhcmluZyBvZiBsZXZlbCAqLworICAgIGlmICghY2lyY3VpdC0+dS5wMnAubmVpZ2hib3IpIHsKKyAgICAgIHJldHVybiBJU0lTX09LOyAvKiBTaWxlbnRseSBkaXNjYXJkICovCisgICAgfSBlbHNlIHsKKyAgICAgIGlmICgoKGxldmVsID09IDEpICYmIAorICAgICAgICAgICAoY2lyY3VpdC0+dS5wMnAubmVpZ2hib3ItPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDIpKSB8fAorICAgICAgICAgICgobGV2ZWwgPT0gMikgJiYgCisgICAgICAgICAgI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ICAgICAvKiBMU1AgYnkgc29tZSBvdGhlciBzeXN0ZW0gLT4gZG8gNy4zLjE2LjQgYikgKi8KKyAgICAgICAgLyogNy4zLjE2LjQgYikgMSkgICovCisgICAgICAgIGlmIChjb21wID09IExTUF9ORVdFUikgeworICAgICAgICAgIGxzcF91cGRhdGUgKGxzcCwgaGRyLCBjaXJjdWl0LT5yY3Zfc3RyZWFtLCBjaXJjdWl0LT5hcmVhKTsKKyAgICAgICAgICAvKiBpaSAqLworICAgICAgICAgIElTSVNfRkxBR1NfU0VUX0FMTCAobHNwLT5TUk1mbGFncyk7ICAgCisgICAgICAgICAgLyogaWlpICovCisgICAgICAgICAgSVNJU19DTEVBUl9GTEFHIChsc3AtPlNSTWZsYWdzLCBjaXJjdWl0KTsKKyAgICAgICAgICAvKiB2ICovCisgICAgICAgICAgSVNJU19GTEFHU19DTEVBUl9BTEwobHNwLT5TU05mbGFncyk7IC8qIEZJWE1FOiBPVEhFUiB0aGFuIGMgKi8KKyAgICAgICAgICAvKiBpdiAqLworICAgICAgICAgIGlmIChjaXJjdWl0LT5jaXJjX3R5cGUgIT0gQ0lSQ1VJVF9UX0JST0FEQ0FTVCkKKyAgICAgICAgICAgIElTSVNfU0VUX0ZMQUcobHNwLT5TU05mbGFncywgY2lyY3VpdCk7CisKKyAgICAgICAgfSAvKiA3LjMuMTYuNCBiKSAyKSAqLworICAgICAgICBlbHNlIGlmIChjb21wID09IExTUF9FUVVBTCkgeworICAgICAgICAgIC8qIGkgKi8KKyAgICAgICAgICBJU0lTX0NMRUFSX0ZMQUcobHNwLT5TUk1mbGFncywgY2lyY3VpdCk7CisgICAgICAgICAgLyogaWkqLworICAgICAgICAgIGlmIChjaXJjdWl0LT5jaXJjX3R5cGUgIT0gQ0lSQ1VJVF9UX0JST0FEQ0FTVCkKKyAgICAgICAgICAgIElTSVNfU0VUX0ZMQUcobHNwLT5TU05mbGFncywgY2lyY3VpdCk7CisgICAgICAgIH0gIC8qIDcuMy4xNi40IGIpIDMpICovCisgICAgICAgIGVsc2UgeworICAgICAgICAgIElTSVNfU0VUX0ZMQUcobHNwLT5TUk1mbGFncywgY2lyY3VpdCk7CisgICAgICAgICAgSVNJU19DTEVBUl9GTEFHKGxzcC0+U1NOZmxhZ3MsIGNpcmN1aXQpOworICAgICAgICB9CisgICAgICB9IGVsc2UgeworICAgICAgICAvKiBvdXIgb3duIExTUCAtPiA3LjMuMTYuNCBjKSAqLworICAgICAgICBpZiAoTFNQX1BTRVVET19JRChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCkgIT0gY2lyY3VpdC0+Y2lyY3VpdF9pZCB8fAorICAgICAgICAgICAgKExTUF9QU0VVRE9fSUQobHNwLT5sc3BfaGVhZGVyLT5sc3BfaWQpID09IGNpcmN1aXQtPmNpcmN1aXRfaWQgJiYKKyAgICAgICAgICAgICBjaXJjdWl0LT51LmJjLmlzX2RyW2xldmVsIC0gMV0gPT0gMSkgKSB7IAorICAgICAgICAgIGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSA9IGh0b25sIChudG9obCAoaGRyLT5zZXFfbnVtKSArIDEpOworICAgICAgICAgIHpsb2dfaW5mbyAoIkxTUCBMRU46ICVkIiwgbnRvaHMgKGxzcC0+bHNwX2hlYWRlci0+cGR1X2xlbikpOworICAgICAgICAgIGlzb19jc3VtX2NyZWF0ZSAoU1RSRUFNX0RBVEEgKGxzcC0+cGR1KSArIDEyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG50b2hzIChsc3AtPmxzcF9oZWFkZXItPnBkdV9sZW4pIC0gMTIsIDEyKTsKKyAgICAgICAgICBJU0lTX0ZMQUdTX1NFVF9BTEwgKGxzcC0+U1JNZmxhZ3MpOworICAgICAgICAgIHpsb2dfaW5mbyAoIklTSVMtVXBkICglcyk6ICgxKSByZS1vcmlnaW5hdGluZyBMU1AgJXMgbmV3IHNlcSAweCUwOHgiLAorICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsCisgICAgICAgICAgICAgICAgICAgICByYXdsc3BpZF9wcmludCAoaGRyLT5sc3BfaWQpLAorICAgICAgICAgICAgICAgICAgICAgbnRvaGwgKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSkpOworICAgICAgICAgIGxzcC0+bHNwX2hlYWRlci0+cmVtX2xpZmV0aW1lID0gaHRvbnMgKGlzaXNfaml0dGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjaXJjdWl0LT5hcmVhLT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X2xzcF9saWZldGltZVtsZXZlbC0xXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFYX0FHRV9KSVRURVIpKTsKKworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIC8qIEdvdCBwdXJnZSBmb3Igb3duIHBzZXVkby1sc3AsIGFuZCB3ZSBhcmUgbm90IERSICAqLworICAgICAgICAgICAgbHNwX3B1cmdlX2RyIChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCwgY2lyY3VpdCwgbGV2ZWwpOworICAgICAgICB9IAorICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gcmV0dmFsOworICB9CisgIC8qIDcuMy4xNS4xIGMpIC0gSWYgdGhpcyBpcyBvdXIgb3duIGxzcCBhbmQgd2UgZG9uJ3QgaGF2ZSBpdCBpbml0aWF0ZSBhIAorICAgKiBwdXJnZSAqLworICBpZiAobWVtY21wIChoZHItPmxzcF9pZCwgaXNpcy0+c3lzaWQsIElTSVNfU1lTX0lEX0xFTiApID09IDApIHsKKyAgICBpZiAoIWxzcCkgeworICAgIC8qIDcuMy4xNi40OiBpbml0aWF0ZSBhIHB1cmdlICovCisgICAgICBsc3BfcHVyZ2Vfbm9uX2V4aXN0IChoZHIsIGNpcmN1aXQtPmFyZWEpOworICAgICAgcmV0dXJuIElTSVNfT0s7CisgICAgfQorICAgIC8qIDcuMy4xNS4xIGQpIC0gSWYgdGhpcyBpcyBvdXIgb3duIGxzcCBhbmQgd2UgaGF2ZSBpdCAqLworCisgICAgLyogSW4gNy4zLjE2LjEsIElmIGFuIEludGVybWVkaWF0ZSBzeXN0ZW0gUiBzb21ld2hlcmUgaW4gdGhlIGRvbWFpbgorICAgICAqIGhhcyBpbmZvcm1hdGlvbiB0aGF0IHRoZSBjdXJyZW50IHNlcXVlbmNlIG51bWJlciBmb3Igc291cmNlIFMgaXMKKyAgICAgKiAiZ3JlYXRlciIgdGhhbiB0aGF0IGhlbGQgYnkgUywgLi4uICovCisKKyAgICBlbHNlIGlmIChudG9obCAoaGRyLT5zZXFfbnVtKSA+IG50b2hsIChsc3AtPmxzcF9oZWFkZXItPnNlcV9udW0pKSB7CisgICAgICAvKiA3LjMuMTYuMSAgKi8KKyAgICAgIGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSA9IGh0b25sIChudG9obCAoaGRyLT5zZXFfbnVtKSArIDEpOworCisgICAgICBpc29fY3N1bV9jcmVhdGUgKFNUUkVBTV9EQVRBIChsc3AtPnBkdSkgKyAxMiwgCisgICAgICAgICAgICAgICAgICAgICAgIG50b2hzKGxzcC0+bHNwX2hlYWRlci0+cGR1X2xlbikgLSAxMiwgMTIpOworCisgICAgICBJU0lTX0ZMQUdTX1NFVF9BTEwgKGxzcC0+U1JNZmxhZ3MpOworICAgICAgemxvZ19pbmZvICgiSVNJUy1VcGQgKCVzKTogKDIpIHJlLW9yaWdpbmF0aW5nIExTUCAlcyBuZXcgc2VxIDB4JTA4eCIsCisgICAgICAgICAgICAgICAgIGNpcmN1aXQtPmFyZWEtPmFyZWFfdGFnLAorICAgICAgICAgICAgICAgICByYXdsc3BpZF9wcmludCAoaGRyLT5sc3BfaWQpLAorICAgICAgICAgICAgICAgICBudG9obCAobHNwLT5sc3BfaGVhZGVyLT5zZXFfbnVtKSk7CisgICAgICBsc3AtPmxzcF9oZWFkZXItPnJlbV9saWZldGltZSA9IGh0b25zIChpc2lzX2ppdHRlciAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjaXJjdWl0LT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhLT5tYXhfbHNwX2xpZmV0aW1lW2xldmVsLTFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BWF9BR0VfSklUVEVSKSk7CisKKyAgICB9CisgIH0gZWxzZSB7CisgIC8qIDcuMy4xNS4xIGUpIC0gVGhpcyBsc3Agb3JpZ2luYXRlZCBvbiBhbm90aGVyIHN5c3RlbSAqLworCisgICAgLyogNy4zLjE1LjEgZSkgMSkgTFNQIG5ld2VyIHRoYW4gdGhlIG9uZSBpbiBkYiBvciBubyBMU1AgaW4gZGIgKi8KKyAgICBpZiAoKCFsc3AgfHwgY29tcCA9PSBMU1BfTkVXRVIpKXsKKyAgICAgIC8qIGkgKi8KKyAgICAgIGlmIChsc3ApIHsKKyNpZmRlZiBFWFRSRU1FX0RFQlVHCisgICAgICAgIHpsb2dfaW5mbyAoImxldmVsICVkIG51bWJlciBpcyAtICVsZCIsIGxldmVsLCAKKyAgICAgICAgICAgICAgICAgICBjaXJjdWl0LT5hcmVhLT5sc3BkYltsZXZlbC0xXS0+ZGljdF9ub2RlY291bnQpOworI2VuZGlmIC8qIEVYVFJFTUUgREVCVUcgKi8KKyAgICAgICAgbHNwX3NlYXJjaF9hbmRfZGVzdHJveSAoaGRyLT5sc3BfaWQsIGNpcmN1aXQtPmFyZWEtPmxzcGRiW2xldmVsLTFdKTsKKyAgICAgICAgLyogZXhpc3RzLCBzbyB3ZSBvdmVyd3JpdGUgKi8KKyNpZmRlZiBFWFRSRU1FX0RFQlVHCisgICAgICAgIHpsb2dfaW5mbyAoImxldmVsICVkIG51bWJlciBpcyAtICVsZCIsbGV2ZWwsIAorICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPmFyZWEtPmxzcGRiW2xldmVsLTFdLT5kaWN0X25vZGVjb3VudCk7CisjZW5kaWYgLyogRVhUUkVNRSBERUJVRyAqLworICAgICAgfQorICAgICAgLyoKKyAgICAgICAqIElmIHRoaXMgbHNwIGlzIGEgZnJhZywgbmVlZCB0byBzZWUgaWYgd2UgaGF2ZSB6ZXJvIGxzcCBwcmVzZW50CisgICAgICAgKi8KKyAgICAgIGlmIChMU1BfRlJBR01FTlQgKGhkci0+bHNwX2lkKSAhPSAwKSB7CisgICAgICAgIG1lbWNweSAobHNwaWQsIGhkci0+bHNwX2lkLCBJU0lTX1NZU19JRF9MRU4gKyAxKTsKKyAgICAgICAgTFNQX0ZSQUdNRU5UIChsc3BpZCkgPSAwOworICAgICAgICBsc3AwID0gbHNwX3NlYXJjaCAobHNwaWQsIGNpcmN1aXQtPmFyZWEtPmxzcGRiW2xldmVsIC0gMV0pOworICAgICAgICBpZiAoIWxzcDApIHsKKyAgICAgICAgICB6bG9nX2luZm8gKCJHb3QgbHNwIGZyYWcsIHdoaWxlIHplcm8gbHNwIG5vdCBkYXRhYmFzZSIpOworICAgICAgICAgIHJldHVybiBJU0lTX09LOworICAgICAgICB9CisgICAgICB9CisgICAgICBsc3AgPSBsc3BfbmV3X2Zyb21fc3RyZWFtX3B0ciAoY2lyY3VpdC0+cmN2X3N0cmVhbSwgbnRvaHMgKGhkci0+cGR1X2xlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNwMCwgY2lyY3VpdC0+YXJlYSk7CisgICAgICBsc3AtPmxldmVsID0gbGV2ZWw7CisgICAgICBsc3AtPmFkaiA9IGFkajsKKyAgICAgIGxzcF9pbnNlcnQgKGxzcCwgY2lyY3VpdC0+YXJlYS0+bHNwZGJbbGV2ZWwtMV0pOworICAgICAgLyogaWkgKi8KKyAgICAgIElTSVNfRkxBR1NfU0VUX0FMTCAobHNwLT5TUk1mbGFncyk7CisgICAgICAvKiBpaWkgKi8KKyA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yAgICBpZiAobGVuIDwgSVNJU19DU05QX0hEUkxFTikgeworICAgICAgemxvZ193YXJuICgiUmVjZWl2ZWQgYSBDU05QIHdpdGggYm9ndXMgbGVuZ3RoISIpOworICAgICAgcmV0dXJuIElTSVNfT0s7CisgICAgfQorICB9IGVsc2UgeworICAgIHR5cGVjaGFyID0gJ1AnOworICAgIHBoZHIgPSAoc3RydWN0IGlzaXNfcGFydGlhbF9zZXFudW1faGRyKilTVFJFQU1fUE5UKGNpcmN1aXQtPnJjdl9zdHJlYW0pOworICAgIGNpcmN1aXQtPnJjdl9zdHJlYW0tPmdldHAgKz0gSVNJU19QU05QX0hEUkxFTjsKKyAgICBsZW4gPSBudG9ocyhwaGRyLT5wZHVfbGVuKTsKKyAgICBpZiAobGVuIDwgSVNJU19QU05QX0hEUkxFTikgeworICAgICAgemxvZ193YXJuICgiUmVjZWl2ZWQgYSBDU05QIHdpdGggYm9ndXMgbGVuZ3RoISIpOworICAgICAgcmV0dXJuIElTSVNfT0s7CisgICAgfQorICB9CisKKyAgLyogNy4zLjE1LjIgYSkgMSAtIGV4dGVybmFsIGRvbWFpbiBjaXJjdWl0IHdpbGwgZGlzY2FyZCBzbnAgcGR1ICovCisgIGlmIChjaXJjdWl0LT5leHRfZG9tYWluKSB7CisKKyAgICB6bG9nX2luZm8gKCJJU0lTLVNucCAoJXMpOiBSY3ZkIEwlZCAlY1NOUCBvbiAlcywgIgorCSAgICAgICAic2tpcHBpbmc6IGNpcmN1aXQgZXh0ZXJuYWxEb21haW4gPSB0cnVlIiwKKwkgICAgICAgY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsCisJICAgICAgIGxldmVsLAorCSAgICAgICB0eXBlY2hhciwKKwkgICAgICAgY2lyY3VpdC0+aW50ZXJmYWNlLT5uYW1lKTsKKworICAgIHJldHVybiBJU0lTX09LOworICB9CisKKyAgLyogNy4zLjE1LjIgYSkgMiwzIC0gbWFudWFsTDJPbmx5TW9kZSBub3QgaW1wbGVtZW50ZWQ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ZC0+dHlwZSkgeworICAgIGlmICghKGZvdW5kICYgVExWRkxBR19BVVRIX0lORk8pIHx8CisJYXV0aGVudGljYXRpb25fY2hlY2sgKHBhc3N3ZCwgJnRsdnMuYXV0aF9pbmZvKSkgeworICAgICAgaXNpc19ldmVudF9hdXRoX2ZhaWx1cmUgKGNpcmN1aXQtPmFyZWEtPmFyZWFfdGFnLCAiU05QIGF1dGhlbnRpY2F0aW9uIgorCQkJICAgICAgICIgZmFpbHVyZSIsIHBoZHIgPworCQkJICAgICAgIHBoZHItPnNvdXJjZV9pZCA6IGNoZHItPnNvdXJjZV9pZCk7CisgICAgICByZXR1cm4gSVNJU19PSzsKKyAgICB9IAorICB9CisKKyAgLyogZGVidWcgaXNpcyBzbnAtcGFja2V0cyAqLworICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfU05QX1BBQ0tFVFMpIHsKKyAgICB6bG9nX2luZm8gKCJJU0lTLVNucCAoJXMpOiBSY3ZkIEwlZCAlY1NOUCBmcm9tICVzIG9uICVzIiwgCisgICAgICAgICAgICAgICBjaXJjdWl0LT5hcmVhLT5hcmVhX3RhZywKKwkgICAgICAgbGV2ZWwsCisJICAgICAgIHR5cGVjaGFyLAorCSAgICAgICBzbnBhX3ByaW50KHNzbnBhKSwKKyAgICAgICAgICAgICAgIGNpcmN1aXQtPmludGVyZmFjZS0+bmFtZSk7CisgICAgaWYgKHRsdnMubHNwX2VudHJpZXMpIHsKKyAgICAgIExJU1RfTE9PUCAodGx2cy5sc3BfZW50cmllcyxlbnRyeSxub2RlKSB7CisgICAgICAgIHpsb2dfaW5mbygiSVNJUy1TbnAgKCVzKTogICAgICAgICAlY1NOUCBlbnRyeSAlcywgc2VxIDB4JTA4eCwiCisgICAgICAgICAgICAgICAgICAiIGNrc3VtIDB4JTA0eCwgbGlmZXRpbWUgJXVzIiwgCisgICAgICAgICAgICAgICAgICBjaXJjdWl0LT5hcmVhLT5hcmVhX3RhZywKKyAgICAgICAgICAgICAgICAgIHR5cGVjaGFyLCAKKyAgICAgICAgICAgICAgICAgIHJhd2xzcGlkX3ByaW50IChlbnRyeS0+bHNwX2lkKSwKKyAgICAgICAgICAgICAgICAgIG50b2hsIChlbnRyeS0+c2VxX251bSksCisgICAgICAgICAgICAgICAgICBudG9ocyAoZW50cnktPmNoZWNrc3VtKSwKKyAgICAgICAgICAgICAgICAgIG50b2hzIChlbnRyeS0+cmVtX2xpZmV0aW1lKSk7CisgICAgICB9CisgICAgfQorICB9CisKKyAgLyogNy4zLjE1LjIgYikgQWN0aW9ucyBvbiBMU1BfRU5UUklFUyByZXBvcnRlZCAqLworICBpZiAodGx2cy5sc3BfZW50cmllcykgeworICAgIExJU1RfTE9PUCAodGx2cy5sc3BfZW50cmllcywgZW50cnksIG5vZGUpIHsKKyAgICAgIGxzcCA9IGxzcF9zZWFyY2ggKGVudHJ5LT5sc3BfaWQsIGNpcmN1aXQtPmFyZWEtPmxzcGRiW2xldmVsIC0gMV0pOworICAgICAgb3duX2xzcCA9ICFtZW1jbXAgKGVudHJ5LT5sc3BfaWQsIGlzaXMtPnN5c2lkLCBJU0lTX1NZU19JRF9MRU4pOworICAgICAgaWYgKGxzcCkgeworICAgICAgICAvKiA3LjMuMTUuMiBiKSAxKSBpcyB0aGlzIExTUCBuZXdlciAqLworICAgICAgICBjbXAgPSBsc3BfY29tcGFyZSAoY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsIGxzcCwgZW50cnktPnNlcV9udW0sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50cnktPmNoZWNrc3VtLCBlbnRyeS0+cmVtX2xpZmV0aW1lKTsKKyAgICAgICAgLyogNy4zLjE1LjIgYikgMikgaWYgaXQgZXF1YWxzLCBjbGVhciBTUk0gb24gcDJwICovCisgICAgICAgIGlmIChjbXAgPT0gTFNQX0VRVUFMKSB7CisgICAgICAgICAgaWYgKGNpcmN1aXQtPmNpcmNfdHlwZSAhPSBDSVJDVUlUX1RfQlJPQURDQVNUKSAKKyAgICAgICAgICAgIElTSVNfQ0xFQVJfRkxBRyAobHNwLT5TUk1mbGFncywgY2lyY3VpdCk7CisgICAgICAgICAgLyogNy4zLjE1LjIgYikgMykgaWYgaXQgaXMgb2xkZXIsIGNsZWFyIFNTTiBhbmQgc2V0IFNSTSAqLworICAgICAgICB9IGVsc2UgaWYgKGNtcCA9PSBMU1BfT0xERVIpIHsKKyAgICAgICAgICBJU0lTX0NMRUFSX0ZMQUcgKGxzcC0+U1NOZmxhZ3MsIGNpcmN1aXQpOworICAgICAgICBJU0lTX1NFVF9GTEFHIChsc3AtPlNSTWZsYWdzLCBjaXJjdWl0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAvKiA3LjMuMTUuMiBiKSA0KSBpZiBpdCBpcyBuZXdlciwgc2V0IFNTTiBhbmQgY2xlYXIgU1JNIG9uIHAycCovCisgICAgICAgICAgaWYgKG93bl9sc3ApIHsKKyAgICAgICAgICAgIGxzcF9pbmNfc2VxbnVtIChsc3AsIG50b2hsIChlbnRyeS0+c2VxX251bSkpOworICAgICAgICAgICAgSVNJU19TRVRfRkxBRyAobHNwLT5TUk1mbGFncywgY2lyY3VpdCk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIElTSVNfU0VUX0ZMQUcgKGxzcC0+U1NOZmxhZ3MsIGNpcmN1aXQpOworICAgICAgICAgICAgaWYgKGNpcmN1aXQtPmNpcmNfdHlwZSAhPSBDSVJDVUlUX1RfQlJPQURDQVNUKQorICAgICAgICAgICAgSVNJU19DTEVBUl9GTEFHIChsc3AtPlNSTWZsYWdzLCBjaXJjdWl0KTsgCisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9IGVsc2UgeworICAgICAgICAvKiA3LjMuMTUuMiBiKSA1KSBpZiBpdCB3YXMgbm90IGZvdW5kLCBhbmQgYWxsIG9mIHRob3NlIGFyZSBub3QgMCwgCisgICAgICAgICAqIGluc2VydCBpdCBhbmQgc2V0IFNTTiBvbiBpdCAqLworICA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ovCisgICAgaWYgKHRsdnMubHNwX2VudHJpZXMpIHsKKyAgICAgIExJU1RfTE9PUCAodGx2cy5sc3BfZW50cmllcywgZW50cnksIG5vZGUpIHsKKyAgICAgICAgTElTVF9MT09QIChsc3BfbGlzdCwgbHNwLCBub2RlMikgeworICAgICAgICAgIGlmIChsc3BfaWRfY21wIChsc3AtPmxzcF9oZWFkZXItPmxzcF9pZCwgZW50cnktPmxzcF9pZCkgPT0gMCkgeworICAgICAgICAgICAgbGlzdF9kZWxldGVfbm9kZSAobHNwX2xpc3QsIG5vZGUyKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgLyogb24gcmVtYWluaW5nIExTUHMgd2Ugc2V0IFNSTSAobmVpZ2hib3Iga25ldyBub3Qgb2YpICovCisgICAgTElTVF9MT09QIChsc3BfbGlzdCwgbHNwLCBub2RlMikgeworICAgICAgSVNJU19TRVRfRkxBRyAobHNwLT5TUk1mbGFncywgY2lyY3VpdCk7CisgICAgfQorICAgIC8qIGxldHMgZnJlZSBpdCAqLworICAgIGxpc3RfZnJlZSAobHNwX2xpc3QpOworICB9CisKKyAgZnJlZV90bHZzICgmdGx2cyk7CisgIHJldHVybiByZXR2YWw7Cit9CisKK2ludAorcHJvY2Vzc19jc25wIChpbnQgbGV2ZWwsIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQsIHVfY2hhciAqc3NucGEpCit7CisKKyAgLyogU2FuaXR5IGNoZWNrIC0gRklYTUU6IG1vdmUgdG8gY29ycmVjdCBwbGFjZSAqLworICBpZiAoKHN0cmVhbV9nZXRfZW5kcCAoY2lyY3VpdC0+cmN2X3N0cmVhbSkgLSAKKyAgICAgICBzdHJlYW1fZ2V0X2dldHAgKGNpcmN1aXQtPnJjdl9zdHJlYW0pKSA8IElTSVNfQ1NOUF9IRFJMRU4pIHsKKyAgICB6bG9nX3dhcm4gKCJQYWNrZXQgdG9vIHNob3J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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kX2wxX2NzbnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNpc19qaXR0ZXIgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNpcmN1aXQtPmNzbnBfaW50ZXJ2YWxbMF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTTlBfSklUVEVSKSk7CisKKyAgcmV0dXJuIHJldHZhbDsKK30KKworaW50CitzZW5kX2wyX2NzbnAgKHN0cnVjdCB0aHJlYWQgKnRocmVhZCkKK3sKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgaW50IHJldHZhbCA9IElTSVNfT0s7CisKKyAgY2lyY3VpdCA9IFRIUkVBRF9BUkcgKHRocmVhZCk7CisgIGFzc2VydCAoY2lyY3VpdCk7CisKKyAgY2lyY3VpdC0+dF9zZW5kX2NzbnBbMV0gPSBOVUxMOworCisgIGlmIChjaXJjdWl0LT5jaXJjX3R5cGUgPT0gQ0lSQ1VJVF9UX0JST0FEQ0FTVCAmJiBjaXJjdWl0LT51LmJjLmlzX2RyWzFdKSB7CisgICAgc2VuZF9jc25wKGNpcmN1aXQsMik7CisgIH0KKyAgLyogc2V0IG5leHQgdGltZXIgdGhyZWFkICovCisgIGNpcmN1aXQtPnRfc2VuZF9jc25wWzFdID0gdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kX2wyX2NzbnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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bbGV2ZWwtMV0gJiYgCisgICAgICAgIGRpY3RfY291bnQgKGNpcmN1aXQtPmFyZWEtPmxzcGRiW2xldmVsLTFdKSA+IDApIHsKKyAgICAgIGxpc3QgPSBsaXN0X25ldyAoKTsKKyAgICAgIGxzcF9idWlsZF9saXN0X3NzbiAoY2lyY3VpdCwgbGlzdCwgY2lyY3VpdC0+YXJlYS0+bHNwZGJbbGV2ZWwtMV0pOworCisgICAgICBpZiAobGlzdGNvdW50KGxpc3QpID4gMCkgeworICAgICAgICBpZiAoY2lyY3VpdC0+c25kX3N0cmVhbSA9PSBOVUxMKQorICAgICAgICAgIGNpcmN1aXQtPnNuZF9zdHJlYW0gPSBzdHJlYW1fbmV3IChJU09fTVRVKGNpcmN1aXQpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHN0cmVhbV9yZXNldCAoY2lyY3VpdC0+c25kX3N0cmVhbSk7CisKKworICAgICAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfU05QX1BBQ0tFVFMpIAorICAgICAgICAgIHpsb2dfaW5mbyAoIklTSVMtU25wICglcyk6IFNlbnQgTCVkIFBTTlAgb24gJXMsIGxlbmd0aCAlbGQiLAorICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdC0+YXJlYS0+YXJlYV90YWcsIGxldmVsLCBjaXJjdWl0LT5pbnRlcmZhY2UtPm5hbWUsCisgICAgICAgICAgICAgICAgICAgICBTVFJFQU1fU0laRShjaXJjdWl0LT5zbmRfc3RyZWFtKSk7CisKKyAgICAgICAgcmV0dmFsID0gYnVpbGRfcHNucCAobGV2ZWwsIGNpcmN1aXQsIGxpc3QpOworICAgICAgICBpZiAocmV0dmFsID09IElTSVNfT0spCisgICAgICAgICAgcmV0dmFsID0gY2lyY3VpdC0+dHggKGNpcmN1aXQsIGxldmVsKTsKKworICAgICAgICBpZiAocmV0dmFsID09IElTSVNfT0spIHsKKyAgICAgICAgICAvKgorICAgICAgICAgICAqIHNlbmRpbmcgc3VjY2VlZGVkLCB3ZSBjYW4gY2xlYXIgU1NOIGZsYWdzIG9mIHRoaXMgY2lyY3VpdAorICAgICAgICAgICAqIGZvciB0aGUgTFNQcyBpbiBsaXN0CisgICAgICAgICAgICovCisgICAgICAgICAgZm9yIChub2RlID0gbGlzdGhlYWQgKGxpc3QpOyBub2RlOyBuZXh0bm9kZShub2RlKSkgeworICAgICAgICAgICAgbHNwID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgICAgICAgICBJU0lTX0NMRUFSX0ZMQUcgKGxzcC0+U1NOZmxhZ3MsIGNpcmN1aXQpOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorICAgICAgbGlzdF9kZWxldGUgKGxpc3QpOworICAgIH0KKyAgfQorCisgIHJldHVybiByZXR2YWw7Cit9CisKK2ludAorc2VuZF9sMV9wc25wIChzdHJ1Y3QgdGhyZWFkICp0aHJlYWQpCit7CisKKyAgc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdDsKKyAgaW50IHJldHZhbCA9IElTSVNfT0s7CisKKyAgY2lyY3VpdCA9IFRIUkVBRF9BUkcgKHRocmVhZCk7CisgIGFzc2VydCAoY2lyY3VpdCk7CisKKyAgY2lyY3VpdC0+dF9zZW5kX3BzbnBbMF0gPSBOVUxMOworCisgIHNlbmRfcHNucCAoMSwgY2lyY3VpdCk7CisgIC8qIHNldCBuZXh0IHRpbWVyIHRocmVhZCAqLworICBjaXJjdWl0LT50X3NlbmRfcHNucFswXSA9IHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kX2wxX3BzbnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc2lzX2ppdHRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjaXJjdWl0LT5wc25wX2ludGVydmFsWzBdLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFNOUF9KSVRURVIpKTsKKworICByZXR1cm4gcmV0dmFsOworfQorCisvKgorICogIDcuMy4xNS40IGFjdGlvbiBvbiBleHBpcmF0aW9uIG9mIHBhcnRpYWwgU05QIGludGVydmFsCisgKiAgbGV2ZWwgMgorICovCitpbnQKK3NlbmRfbDJfcHNucCAoc3RydWN0IHRocmVhZCAqdGhyZWFkKQoreworCisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIGludCByZXR2YWwgPSBJU0lTX09LOworCisgIGNpcmN1aXQgPSBUSFJFQURfQVJHICh0aHJlYWQpOworICBhc3NlcnQgKGNpcmN1aXQpOworCisgIGNpcmN1aXQtPnRfc2VuZF9wc25wWzFdID0gTlVMTDsKKworICBzZW5kX3BzbnAgKDIsIGNpcmN1aXQpOworCisgIC8qIHNldCBuZXh0IHRpbWVyIHRocmVhZCAqLworICBjaXJjdWl0LT50X3NlbmRfcHNucFsxXSA9IHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kX2wyX3BzbnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc2lzX2ppdHRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjaXJjdWl0LT5wc25wX2ludGVydmFsWzFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU05QX0pJVFRFUikpOworCisgIHJldHVybiByZXR2YWw7Cit9CisKKwordm9pZAorYnVpbGRfbGlua19zdGF0ZSAoc3RydWN0IGlzaXNfbHNwIC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VpdAorICAgICAqLworICAgIGlmIChjaXJjdWl0LT51cGFkamNvdW50W2xzcC0+bGV2ZWwgLSAxXSA9PSAwKQorICAgICAgZ290byBkb250c2VuZDsKKyAgICAvKiBvbmx5IHNlbmQgaWYgaXQgbmVlZHMgc2VuZGluZyAqLworICAgIGlmICgodGltZShOVUxMKSAtIGxzcC0+bGFzdF9zZW50KSA+PSAKKyAgICAgICAgIGNpcmN1aXQtPmFyZWEtPmxzcF9nZW5faW50ZXJ2YWxbbHNwLT5sZXZlbC0xXSkgeworCisgICAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfVVBEQVRFX1BBQ0tFVFMpIHsKKyAgICAgICAgemxvZ19pbmZvICgiSVNJUy1VcGQgKCVzKTogU2VudCBMJWQgTFNQICVzLCBzZXEgMHglMDh4LCBja3N1bSAweCUwNHgsIgorICAgICAgICAgICAgICAgICAgICIgbGlmZXRpbWUgJXVzIG9uICVzIiwKKyAgICAgICAgICAgICAgICAgICBjaXJjdWl0LT5hcmVhLT5hcmVhX3RhZywKKwkJICAgbHNwLT5sZXZlbCwgCisgICAgICAgICAgICAgICAgICAgcmF3bHNwaWRfcHJpbnQgKGxzcC0+bHNwX2hlYWRlci0+bHNwX2lkKSwKKyAgICAgICAgICAgICAgICAgICBudG9obChsc3AtPmxzcF9oZWFkZXItPnNlcV9udW0pLAorCQkgICBudG9ocyhsc3AtPmxzcF9oZWFkZXItPmNoZWNrc3VtKSwKKyAgICAgICAgICAgICAgICAgICBudG9ocyhsc3AtPmxzcF9oZWFkZXItPnJlbV9saWZldGltZSksIAorICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPmludGVyZmFjZS0+bmFtZSk7CisgICAgICB9CisgICAgICAvKiBjb3B5IG91ciBsc3AgdG8gdGhlIHNlbmQgYnVmZmVyICovCisgICAgICBjaXJjdWl0LT5zbmRfc3RyZWFtLT5nZXRwID0gbHNwLT5wZHUtPmdldHA7CisgICAgICBjaXJjdWl0LT5zbmRfc3RyZWFt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VNfQURKX0xFVkVMMjsKKwl9IGVsc2UgaWYgKGFkai0+YWRqX3VzYWdlID09IElTSVNfQURKX0xFVkVMMSkgeworCSAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX0RPV04sICJXcm9uZyBTeXN0ZW0iLAorCQkJCSBjaXJjdWl0LT5hZGpkYik7CisJfSBlbHNlIGlmIChhZGotPmFkal91c2FnZSA9PSBJU0lTX0FESl9MRVZFTDFBTkQyKSB7IAorCSAgaXNpc19hZGpfc3RhdGVfY2hhbmdlIChhZGosIElTSVNfQURKX0RPV04sICJBcmVhIE1pc21hdGNoIiwKKwkJCQkgY2lyY3VpdC0+YWRqZGIpOworCX0gZWxzZSBpZiAoYWRqLT5hZGpfdXNhZ2UgPT0gSVNJU19BREpfTEVWRUwyKSB7CisJICAgIDsgLyogQWNjZXB0ICovCisJfQorCWJyZWFrOworICAgICAgfQorICAgICAgZ290byBtaXNtYXRjaDsKKyAgICB9IGVsc2UgeworICAgICAgaXNpc19kZWxldGVfYWRqIChhZGosIGNpcmN1aXQtPmFkamRiKTsKKyAgICAgIHpsb2dfd2FybigiYXJlYU1pc21hdGNoIik7CisgICAgICByZXR1cm4gSVNJU19XQVJOSU5HOworICAgIH0KKyAgfQorCittaXNtYXRjaDoKKyNlbmRpZgorCisKKworCmRpZmYgLS1naXQgYS9pc2lzZC9pc2lzX3BkdS5oIGIvaXNpc2QvaXNpc19wZHUuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45OTQwMzY4Ci0tLSAvZGV2L251bGwKKysrIGIvaXNpc2QvaXNpc19wZHUuaApAQCAtMCwwICsxLDI1NyBAQAorLyoKKyAqIElTLUlTIFJvdXQoZSlpbmcgcHJvdG9jb2wgLSBpc2lzX3BkdS5oCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUERVIHByb2Nlc3NpbmcKKyAqCisgKiBDb3B5cmlnaHQgKEMpIDIwMDEsMjAwMiAgI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HdhcmUgRm91bmRhdGlvbiwgSW5jLiwgCisgKiA1OSBUZW1wbGUgUGxhY2UgLSBTdWl0ZSAzMzAsIEJvc3RvbiwgTUEgIDAyMTExLTEzMDcsIFVTQS4KKyAqLworCisjaWZuZGVmIF9aRUJSQV9JU0lTX1BEVV9ICisjZGVmaW5lIF9aRUJSQV9JU0lTX1BEVV9ICisKKy8qCisgKiAgICAgICAgICAgICAgICAgICAgSVNPIDk1NDIgLSA3LjUsNy42CisgKgorICogICAgICAgICAgICAgICAgICAgICAgIEVTIHRvIElTIEZpeGVkIEhlYWRlcgorICogICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiAgfCAgICAgICAgIEludHJhZG9tYWluIFJvdXRlaW5nIFByb3RvY29sIERpc2NyaW1pbmF0b3IgICAgICAgICAgIHwKKyAqICArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogIHwgICAgICAgICAgICAgICAgICAgICAgIExlbmd0aCBJbmRpY2F0b3IgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgICAgICAgICAgVmVyc2lvbi9Qcm90b2NvbCBJRCBleHRlbnNpb24gICAgICAgICAgICAgICAgfAorICogICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiAgfCAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZCA9IDAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAqICArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogIHwgICAwICAgfCAgIDAgICB8ICAgMCAgIHwgICAgICAgICAgICAgIFBEVSBUeXBlICAgICAgICAgICAgICAgICB8CisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgICAgICAgICAgICAgICAgIEhvbGRpbmcgVGltZSAgICAgICAgICAgICAgICAgICAgICAgICAgfCAyCisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgICAgICAgICAgICAgICAgICBDaGVja3N1bSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAyCisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqLworCitzdHJ1Y3QgZXNpc19maXhlZF9oZHIKK3sKKyAgdV9jaGFyIGlkcnA7CisgIHVfY2hhciBsZW5ndGg7CisgIHVfY2hhciB2ZXJzaW9uOworICB1X2NoYXIgaWRfbGVuOworICB1X2NoYXIgcGR1X3R5cGU7CisgIHVfaW50MTZfdCBob2xkdGltZTsKKyAgdV9pbnQxNl90IGNoZWNrc3VtOworfSAgX19hdHRyaWJ1dGVfXygocGFja2VkKSk7CisKKyNkZWZpbmUgRVNJU19GSVhFRF9IRFJfTEVOICAgOQorCisjZGVmaW5lIEVTSF9QRFUgICAgICAgICAgICAgIDIKKyNkZWZpbmUgSVNIX1BEVSAgICAgICAgICAgICAgNAorI2RlZmluZSBSRF9QRFUgICAgICAgICAgICAgICA1CisKKy8qCisgKiAgICAgICAgICAgICAgICAgICAgICAgSVMgdG8gSVMgRml4ZWQgSGVhZGVyCisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgSW50cmFkb21haW4gUm91dGVpbmcgUHJvdG9jb2wgRGlzY3JpbWluYXRvciAgICAgICAgICAgfCAKKyAqICArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogIHwgICAgICAgICAgICAgICAgICAgICAgIExlbmd0aCBJbmRpY2F0b3IgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgICAgICAgICAgVmVyc2lvbi9Qcm90b2NvbCBJRCBleHRlbnNpb24gICAgICAgICAgICAgICAgfAorICogICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiAgfCAgIFIgICB8ICAgUiAgIHwgICBSICAgfCAgICAgICAgICAgICAgUERVIFR5cGUgICAgICAgICAgICAgICAgIHwgICAgICAKKyAqICArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmVyc2lvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICstLS0tLS0tKy0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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGlkX2xlbiAgIAorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICBIb2xkaW5nICBUaW1lICAgICAgICAgICAgICAgICAgICAgICAgICB8IDIgICAgIAorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICBQRFUgTGVuZ2h0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDIgICAgCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogfCAgIFIgICB8ICAgICAgICAgICAgICAgIFByaW9yaXR5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMQorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICBMQU4gSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGlkX2xlbiArIDEKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKi8KK3N0cnVjdCBpc2lzX2xhbl9oZWxsb19oZHIgeworICB1X2NoYXIgY2lyY3VpdF90OyAgCisgIHVfY2hhciBzb3VyY2VfaWRbSVNJU19TWVNfSURfTEVOXTsgICAKKyAgdV9pbnQxNl90IGhvbGRfdGltZTsgICAgIAorICB1X2ludDE2X3QgcGR1X2xlbjsgICAgICAKKyAgdV9jaGFyIHByaW87ICAgICAgICAgCisgIHVfY2hhciBsYW5faWRbSVNJU19TWVNfSURfTEVOICsgMV07ICAgICAgCit9ICBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKyNkZWZpbmUgSVNJU19MQU5IRUxMT19IRFJMRU4gIDE5CisKKyNkZWZpbmUgUDJQX0hFTExPICAgICAgICAgICAgMTcKKy8qCisgKiAgICAgICAgICAgUG9pbnQtdG8tcG9pbnQgSVMgdG8gSVMgaGVsbG8gUERVIGhlYWRlcgorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZCAgICAgICAgICAgICAgIHwgQ2lyY3VpdCBUeXBlICB8IDEKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiArICAgICAgICAgICAgICAgICAgICAgICAgU291cmNlIElEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBpZF9sZW4gICAKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiArICAgICAgICAgICAgICAgICAgICAgICAgSG9sZGluZyAgVGltZSAgICAgICAgICAgICAgICAgICAgICAgICAgKyAyICAgICAKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiArICAgICAgICAgICAgICAgICAgICAgICAgUERVIExlbmdodCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAyICAgIAorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICBMb2NhbCBDaXJjdWl0IElEICAgICAgICAgICAgICAgICAgICAgICB8IDEKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKi8KK3N0cnVjdCBpc2lzX3AycF9oZWxsb19oZHIgeworICB1X2NoYXIgY2lyY3VpdF90OyAgCisgIHVfY2hhciBzb3VyY2VfaWRbSVNJU19TWVNfSURfTEVOXTsgICAKKyAgdV9pbnQxNl90IGhvbGRfdGltZTsgICAgIAorICB1X2ludDE2X3QgcGR1X2xlbjsgICAgICAKKyAgdV9jaGFyIGxvY2FsX2lkOworfSBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKyNkZWZpbmUgSVNJU19QMlBIRUxMT19IRFJMRU4gMTIKKworI2RlZmluZSBMMV9MSU5LX1NUQVRFICAgICAgICAxOAorI2RlZmluZSBMMl9MSU5LX1NUQVRFICAgICAgICAyMAorLyoKKyAqICAgICAgICAgICAgICBMMSBhbmQgTDIgSVMgdG8gSVMgbGluayBzdGF0ZSBQRFUgaGVhZGVyCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogKyAgICAgICAgICAgICAgICAgICAgICAgIFBEVSBMZW5ndGggICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgMgorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICsgICAgICAgICAgICAgICAgICAgICAgICBSZW1haW5pbmcgTGlmZXRpbWUgICAgICAgICAgICAgICAgICAgICArIDIgCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogfCAgICAgICAgICAgICAgICAgICAgICAgIExTUCBJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgaWRfbGVuICsgMgorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICsgICAgICAgICAgICAgICAgICAgICAgICBTZXF1ZW5jZSBOdW1iZXIgICAgICAgICAgICAgICAgICAgICAgICArIDQKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiArICAgICAgICAgICAgICAgICAgICAgICAgQ2hlY2tzdW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAyCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogfCAgIFAgICB8ICAgICAgICAgICAgICBBVFQgICAgICAgICAgICAgIHxMU1BEQk9MfCAgICBJU1RZUEUgICAgIHwKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKi8KK3N0cnVjdCBpc2lzX2xpbmtfc3RhdGVfaGRyIHsKKyAgdV9pbnQxNl90IHBkdV9sZW47ICAgICAgCisgIHVfaW50MTZfdCByZW1fbGlmZXRpbWU7CisgIHVfY2hhciAgbHNwX2lkW0lTSVNfU1lTX0lEX0xFTiArIDJdOworICB1X2ludDMyX3Qgc2VxX251bTsKKyAgdV9pbnQxNl90IGNoZWNrc3VtOworICB1X2ludDhfdCAgbHNwX2JpdHM7Cit9IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpOyAKKyNkZWZpbmUgSVNJU19MU1BfSERSX0xFTiAxOQorCisjZGVmaW5lIEwxX0NPTVBMRVRFX1NFUV9OVU0gIDI0CisjZGVmaW5lIEwyX0NPTVBMRVRFX1NFUV9OVU0gIDI1CisvKgorICogICAgICBMMSBhbmQgTDIgSVMgdG8gSVMgY29tcGxldGUgc2VxdWVuY2UgbnVtYmVycyBQRFUgaGVhZGVyCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogKyAgICAgICAgICAgICAgICAgICAgICAgIFBEVSBMZW5naHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgMiAgICAKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKiArICAgICAgICAgICAgICAgICAgICAgICAgU291cmNlIElEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBpZF9sZW4gKyAxCisgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICogKyAgICAgICAgICAgICAgICAgICAgICAgIFN0YXJ0IExTUCBJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICsgaWRfbGVuICsgMgorICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAqICsgICAgICAgICAgICAgICAgICAgICAgICBFbmQgTFNQIElEICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGlkX2xlbiArIDIKKyAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgKi8KK3N0cnVjdCBpc2lzX2NvbXBsZXRlX3NlcW51bV9oZHIgeworICB1X2ludDE2X3QgcGR1X2xlbjsKKyAgdV9jaGFyICA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5cGUpOworaW50ICBzZW5kX2hlbGxvICAgICAgICAoc3RydWN0IGlzaXNfY2lyY3VpdCAqY2lyY3VpdCwgaW50IGxldmVsKTsKKworCitpbnQgYXV0aGVudGljYXRpb25fY2hlY2sgKHN0cnVjdCBpc2lzX3Bhc3N3ZCAqb25lLCAKKwkJCSAgc3RydWN0IGlzaXNfcGFzc3dkICp0aGVvdGhlcik7CisKKyNlbmRpZiAvKiBfWkVCUkFfSVNJU19QRFVfSCAqLworCisKKworCisKZGlmZiAtLWdpdCBhL2lzaXNkL2lzaXNfcm91dGUuYyBiL2lzaXNkL2lzaXNfcm91dGUuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43NDIzMWFkCi0tLSAvZGV2L251bGwKKysrIGIvaXNpc2QvaXNpc19yb3V0ZS5jCkBAIC0wLDAgKzEsNjE1IEBACisvKgorICogSVMtSVMgUm91dChlKWluZyBwcm90b2NvbCAgICAgICAgICAgICAgIC0gaXNpc19yb3V0ZS5jCisgKiBDb3B5cmlnaHQgKEMpIDIwMDEsMjAwMiAgIFNhbXBvIFNhYXJpc3RvCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhbXBlcmUgVW5pdmVyc2l0eSBvZiBUZWNobm9sb2d5ICAgICAgCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEluc3RpdHV0ZSBvZiBDb21tdW5pY2F0aW9ucyBFbmdpbmVlcmluZworICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlZCBvbiAuLi9vc3BmNmQvb3NwZjZfcm91dGUuW2NoXQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5IFlhc3VoaXJvIE9oYXJhCisgKgorICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgCisgKiB1bmRlciB0aG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IAorICBuZXh0aG9wNiA9IGlzaXNfbmV4dGhvcDZfbmV3IChpcDYsIGlmaW5kZXgpOworCisgIHJldHVybiBuZXh0aG9wNjsKK30KKworCit2b2lkCitpc2lzX25leHRob3A2X2RlbGV0ZSAoc3RydWN0IGlzaXNfbmV4dGhvcDYgKm5leHRob3A2KQoreworCisgIG5leHRob3A2LT5sb2NrLS07CisgIGlmIChuZXh0aG9wNi0+bG9jayA9PSAwKSB7CisgICAgbGlzdG5vZGVfZGVsZXRlIChpc2lzLT5uZXh0aG9wczYsIG5leHRob3A2KTsKKyAgICBYRlJFRSAoTVRZUEVfSVNJU19ORVhUSE9QNiwgbmV4dGhvcDYpOworICB9CisgICAgCisgIHJldHVybjsKK30KKworaW50CituZXh0aG9wNmxvb2t1cCAoc3RydWN0IGxpc3QgKm5leHRob3BzNiwgc3RydWN0IGluNl9hZGRyICppcDYsIAorICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBpZmluZGV4KQoreworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisgIHN0cnVjdCBpc2lzX25leHRob3A2ICpuaDY7CisKKyAgZm9yIChub2RlID0gbGlzdGhlYWQgKG5leHRob3BzNik7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgIG5oNiA9IGdldGRhdGEgKG5vZGUpOworICAgIGlmICghKG1lbWNtcCAoaXA2LCAmbmg2LT5pcDYsIHNpemVvZiAoc3RydWN0IGluNl9hZGRyKSkpICYmIAorICAgICAgICBpZmluZGV4ID09IG5oNi0+aWZpbmRleCkKKyAgICAgIHJldHVybiAxOworICB9CisKKyAgcmV0dXJuIDA7Cit9CisKK3ZvaWQKK25leHRob3A2X3ByaW50IChzdHJ1Y3QgaXNpc19uZXh0aG9wNiAqbmg2KQoreworICB1X2NoYXIgYnVmW0JVRlNJWl07CisgIAorICBpbmV0X250b3AgKEFGX0lORVQ2LCAmbmg2LT5pcDYsIGJ1ZiwgQlVGU0laKTsKKyAgCisgIHpsb2dfaW5mbyAoIiAgICAgICVzICV1IiwgYnVmLCBuaDYtPmlmaW5kZXgpOworfQorCit2b2lkCituZXh0aG9wczZfcHJpbnQgKHN0cnVjdCBsaXN0ICpuaHM2KQoreworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisgIAorICBmb3IgKG5vZGUgPSBsaXN0aGVhZChuaHM2KTsgbm9kZTsgbmV4dG5vZGUgKG5vZGUpKQorICAgIG5leHRob3A2X3ByaW50IChnZXRkYXRhIChub2RlKSk7Cit9CisKKworI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworCit2b2lkCithZGppbmZvMm5leHRob3AgKHN0cnVjdCBsaXN0ICpuZXh0aG9wcywgc3RydWN0IGlzaXNfYWRqYWNlbmN5ICphZGopCit7CisgIHN0cnVjdCBpc2lzX25leHRob3AgKm5oOworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisgIHN0cnVjdCBpbl9hZGRyICppcHY0X2FkZHI7CisKKyAgaWYgKGFkai0+aXB2NF9hZGRycyA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgZm9yIChub2RlID0gbGlzdGhlYWQgKGFkai0+aXB2NF9hZGRycyk7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgIGlwdjRfYWRkciA9IGdldGRhdGEgKG5vZGUpOworICAgIGlmICghbmV4dGhvcGxvb2t1cCAobmV4dGhvcHMsIGlwdjRfYWRkciwgCisgICAgICAgICAgICAgICAgICAgICAgICBhZGotPmNpcmN1aXQtPmludGVyZmFjZS0+aWZpbmRleCkpIHsKKyAgICAgIG5oID0gaXNpc19uZXh0aG9wX2NyZWF0ZSAoaXB2NF9hZGRyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRqLT5jaXJjdWl0LT5pbnRlcmZhY2UtPmlmaW5kZXgpOworICAgICAgbGlzdG5vZGVfYWRkIChuZXh0aG9wcywgbmgpOworICAgIH0KKyAgfQorfQorCisjaWZkZWYgSEFWRV9JUFY2Cit2b2lkC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bm9kZSAqbm9kZTsKKyAgCisgIHJpbmZvID0gWE1BTExPQyAoTVRZUEVfSVNJU19ST1VURV9JTkZPLCBzaXplb2YgKHN0cnVjdCBpc2lzX3JvdXRlX2luZm8pKTsKKyAgaWYgKCFyaW5mbykgeworICAgIHpsb2dfZXJyICgiSVNJUy1SdGU6IGlzaXNfcm91dGVfaW5mb19uZXc6IG91dCBvZiBtZW1vcnkhIik7CisgICAgcmV0dXJuIE5VTEw7CisgIH0KKyAgbWVtc2V0IChyaW5mbywgMCwgc2l6ZW9mIChzdHJ1Y3QgaXNpc19yb3V0ZV9pbmZvKSk7CisKKyAgaWYgKGZhbWlseSA9PSBBRl9JTkVUKSB7CisgICAgcmluZm8tPm5leHRob3BzID0gbGlzdF9uZXcgKCk7CisgICAgZm9yIChub2RlID0gbGlzdGhlYWQgKGFkamFjZW5jaWVzKTsgbm9kZTsgbmV4dG5vZGUgKG5vZGUpKSB7CisgICAgICBhZGogPSBnZXRkYXRhIChub2RlKTsKKyAgICAgIGFkamluZm8ybmV4dGhvcCAocmluZm8tPm5leHRob3BzLCBhZGopOworICAgIH0KKyAgfQorI2lmZGVmIEhBVkVfSVBWNgorICBpZiAoZmFtaWx5ID09IEFGX0lORVQ2KSB7CisgICAgcmluZm8tPm5leHRob3BzNiA9IGxpc3RfbmV3ICgpOworICAgIGZvciAobm9kZSA9IGxpc3RoZWFkIChhZGphY2VuY2llcyk7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgICAgYWRqID1nZXRkYXRhIChub2RlKTsKKyAgICAgIGFkamluZm8ybmV4dGhvcDYgKHJpbmZvLT5uZXh0aG9wczYsIGFkaik7CisgICAgfQorICB9CisgICAgCisjZW5kaWYgLyogSEFWRV9JUFY2ICovCisKKyAgcmluZm8tPmNvc3QgPSBjb3N0OworICByaW5mby0+ZGVwdGggPSBkZXB0aDsKKyAgICAgIAorICByZXR1cm4gcmluZm87Cit9CisKKwordm9pZAoraXNpc19yb3V0ZV9pbmZvX2Rlb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obm9kZSk7CisgICAgICBpZiAobmV4dGhvcDZsb29rdXAgKG9sZC0+bmV4dGhvcHM2LCAmbmV4dGhvcDYtPmlwNiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRob3A2LT5pZmluZGV4KSA9PSAwKQorICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgIAorICAgIGZvciAobm9kZSA9IGxpc3RoZWFkIChvbGQtPm5leHRob3BzNik7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgICAgbmV4dGhvcDYgPSAoc3RydWN0IGlzaXNfbmV4dGhvcDYgKikgZ2V0ZGF0YSAobm9kZSk7CisgICAgICBpZiAobmV4dGhvcDZsb29rdXAgKG5ldy0+bmV4dGhvcHM2LCAmbmV4dGhvcDYtPmlwNiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRob3A2LT5pZmluZGV4KSA9PSAwKQorICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgIH0KKyNlbmRpZiAvKiBIQVZFX0lQVjYgKi8KKworICByZXR1cm4gMTsKK30KKworCit2b2lkCitpc2lzX25leHRob3BzX21lcmdlIChzdHJ1Y3QgbGlzdCAqbmV3LCBzdHJ1Y3QgbGlzdCAqb2xkKQoreworICBzdHJ1Y3QgbGlzdG5vZGUgKm5vZGU7CisgIHN0cnVjdCBpc2lzX25leHRob3AgKm5leHRob3A7CisKKyAgZm9yIChub2RlID0gbGlzdGhlYWQgKG5ldyk7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgIG5leHRob3AgPSAoc3RydWN0IGlzaXNfbmV4dGhvcCAqKSBnZXRkYXRhIChub2RlKTsKKyAgICBpZiAobmV4dGhvcGxvb2t1cCAob2xkLCAmbmV4dGhvcC0+aXAsIG5leHRob3AtPmlmaW5kZXgpKQorICAgICAgY29udGludWU7CisgICAgbGlzdG5vZGVfYWRkIChvbGQsIG5leHRob3ApOworICAgIG5leHRob3AtPmxvY2srKzsKKyAgfQorfQorCisKKyNpZmRlZiBIQ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CisgICAgICB6bG9nX2luZm8gKCJJU0lTLVJ0ZSAoJXMpIHJvdXRlIHVuY2hhbmdlZDogJXMiLCBhcmVhLT5hcmVhX3RhZywgYnVmZik7CisgICAgaXNpc19yb3V0ZV9pbmZvX2RlbGV0ZSAocmluZm9fbmV3KTsKKyAgICByb3V0ZV9pbmZvID0gcmluZm9fb2xkOworICB9IGVsc2UgaWYgKGlzaXNfcm91dGVfaW5mb19zYW1lX2F0dHJpYiAocmluZm9fbmV3LCByaW5mb19vbGQpKSB7CisgICAgLyogbWVyZ2UgdGhlIG5leHRob3AgbGlzdHMgKi8KKyAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUdfUlRFX0VWRU5UUykKKyAgICAgICAgemxvZ19pbmZvICgiSVNJUy1SdGUgKCVzKSByb3V0ZSBjaGFuZ2VkIChzYW1lIGF0dHJpYnMpOiAlcyIsIAorICAgICAgICAgICAgICAgICAgIGFyZWEtPmFyZWFfdGFnLCBidWZmKTsKKyNpZmRlZiBFWFRSRU1FX0RFQlVHCisgICAgemxvZ19pbmZvICgiT2xkIG5leHRob3BzIik7CisgICAgbmV4dGhvcHM2X3ByaW50IChyaW5mb19vbGQtPm5leHRob3BzNik7CisgICAgemxvZ19pbmZvICgiTmV3IG5leHRob3BzIik7CisgICAgbmV4dGhvcHM2X3ByaW50IChyaW5mb19uZXctPm5leHRob3BzNik7CisjZW5kaWYgLyogRVhUUkVNRV9ERUJVRyAqLworICAgIGlzaXNfcm91dGVfaW5mb19tZXJnZSAocmluZm9fbmV3LCByaW5mb19vbGQsIGZhbWlseSk7CisgICAgaXNpc19yb3V0ZV9pbmZvX2RlbGV0ZSAocmluZm9fbmV3KTsKKyAgICByb3V0ZV9pbmZvID0gcmluZm9fb2xkOworICB9IGVsc2UgeworICAgIGlmIChpc2lzX3JvdXRlX2luZm9fcHJlZmVyX25ldyAocmluZm9fbmV3LCByaW5mb19vbGQpKSB7CisgICAgICBpZiAoaXNpcy0+ZGVidWdzICYgREVCVUd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FibGUpOyByb2RlOyByb2RlID0gcm91dGVfbmV4dCAocm9kZSkpIHsKKyAgICBpZiAocm9kZS0+aW5mbyA9PSBOVUxMKQorICAgICAgY29udGludWU7CisgICAgcmluZm8gPSByb2RlLT5pbmZvOworICAgIAorICAgIGlmIChpc2lzLT5kZWJ1Z3MgJiBERUJVR19SVEVfRVZFTlRTKSB7CisgICAgICBwcmVmaXgyc3RyICgmcm9kZS0+cCwgYnVmZiwgQlVGU0laKTsKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtUnRlICglcyk6IHJvdXRlIHZhbGlkYXRlOiAlcyAlcyAlcyIsCisgICAgICAgICAgICAgICAgIGFyZWEtPmFyZWFfdGFnLAorICAgICAgICAgICAgICAgICAoQ0hFQ0tfRkxBRyAocmluZm8tPmZsYWcsIElTSVNfUk9VVEVfRkxBR19aRUJSQV9TWU5DKSA/CisgICAgICAgICAgICAgICAgICAic3luYydlZCI6ICJub3N5bmMiKSwKKyAgICAgICAgICAgICAgICAgKENIRUNLX0ZMQUcgKHJpbmZvLT5mbGFnLCBJU0lTX1JPVVRFX0ZMQUdfQUNUSVZFKSA/CisgICAgICAgICAgICAgICAgICAiYWN0aXZlIjogImluYWN0aXZlIiksIGJ1ZmYpOworICAgIH0KKyAgICAKKyAgICBpc2lzX3plYnJhX3JvdXRlX3VwZGF0ZSAoJnJvZGUtPnAsIHJpbmZvKTsKKyAgICBpZiAoIUNIRUNLX0ZMQUcgKHJpbmZvLT5mbGFnLCBJU0lTX1JPVVRFX0ZMQUdfQUNUSVZFKSkKKyAgICAgIGlzaXNfcm91dGVfZGVsZXRlICgmcm9kZS0+cCwgYXJlYS0+cm91dGVfdGFibGUpOworICB9CisjaWZkZWYgSEFWRV9JUFY2CisgIGlmICh2NmRvbmUpCisgICAgcmV0dXJuIElTSVNfT0s7CisgIHRhYmxlID0gYXJlYS0+cm91dGVfdGFibGU2OworICB2NmRvbmUgPSAxOworICBnb3RvIGFnYWluOworI2VuZGlmCisKKyAgcmV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VVRFX0ZMQUdfWkVCUkFfU1lOQyAweDAxCisjZGVmaW5lIElTSVNfUk9VVEVfRkxBR19BQ1RJVkUgICAgIDB4MDIKKyAgdV9jaGFyIGZsYWc7IAorICB1X2ludDMyX3QgY29zdDsKKyAgdV9pbnQzMl90IGRlcHRoOworICBzdHJ1Y3QgbGlzdCAqbmV4dGhvcHM7CisjaWZkZWYgSEFWRV9JUFY2CisgIHN0cnVjdCBsaXN0ICpuZXh0aG9wczY7CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCit9OworCitzdHJ1Y3QgaXNpc19yb3V0ZV9pbmZvICppc2lzX3JvdXRlX2NyZWF0ZSAoc3RydWN0IHByZWZpeCAqcHJlZml4LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1X2ludDMyX3QgY29zdCwgdV9pbnQzMl90IGRlcHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBsaXN0ICphZGphY2VuY2llcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhKTsKKworaW50IGlzaXNfcm91dGVfdmFsaWRhdGUgKHN0cnVjdCB0aHJlYWQgKnRocmVhZCk7CisKKyNlbmRpZiAvKiBfWkVCUkFfSVNJU19ST1VURV9IICovCmRpZmYgLS1naXQgYS9pc2lzZC9pc2lzX3JvdXRlbWFwLmMgYi9pc2lzZC9pc2lzX3JvdXRlbWFwLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNGRmOTgzZAotLS0gL2Rldi9udWxsCisrKyBiL2lzaXNkL2lzaXNfcm91dGVtYXAuYwpAQCAtMCwwICsxLDEwMCBAQAorLyoKKyAqIElTLUlTIFJvdXQoZSlpbmcgcHJvdG9jb2wgICAgICAgICAgICAgICAtIGlzaXNfcm91dGVtYXAuYworICoKKyAqIENvcHlyaWdodCAoQyk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mV4dG5vZGUgKG5vZGUyKSkgeworICAgICAgYWRqMiA9IGdldGRhdGEobm9kZTIpOworICAgICAgaWYgKGFkaiA9PSBhZGoyKSBicmVhazsKKyAgICB9CisgICAgCisgICAgaWYgKCFub2RlMikgbGlzdG5vZGVfYWRkICh0YXJnZXQsIGFkaik7CisgIH0KK30KKworCisvKiA3LjIuNyAqLwordm9pZCAgICAgIAorcmVtb3ZlX2V4Y2Vzc19hZGpzIChzdHJ1Y3QgbGlzdCAqYWRqcykKK3sKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlLCAqZXhjZXNzID0gTlVMTDsKKyAgc3RydWN0IGlzaXNfYWRqYWNlbmN5ICphZGosICpjYW5kaWRhdGUgPSBOVUxMOworICBpbnQgY29tcDsKKworICBmb3IgKG5vZGUgPSBsaXN0aGVhZCAoYWRqcyk7IG5vZGU7IG5leHRub2RlIChub2RlKSkgeworICAgIGlmIChleGNlc3MgPT0gTlVMTCkgCisgICAgICBleGNlc3MgPSBub2RlOworICAgIGNhbmRpZGF0ZSA9IGdldGRhdGEgKGV4Y2Vzcyk7CisgICAgYWRqID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgaWYgKGNhbmRpZGF0ZS0+c3lzX3R5cGUgPCBhZGotPnN5c190eXBlKSB7CisgICAgICBleGNlc3MgPSBub2RlOworICAgICAgY2FuZGlkYXRlID0gYWRqOworICAgICAgY29udGludWU7CisgICAgfSAKKyAgICBpZiAoY2FuZGlkYXRlLT5zeXNfdHlwZSA+IGFkai0+c3lzX3R5cGUpCisgICAgICBjb250aW51ZTsKKyAgICAKKyAgICBjb21wID0gbWVtY21wIChjYW5kaWRhdGUtPnN5c2lkLCBhZGotPnN5c2lkLCBJU0lTX1NZU19JRF9MRU4pOworICAgIGlmIChjb21wID4gMCkgeworICAgICAgZXhjZXNzID0gbm9kZTsKKyAgICAgIGNhbmRpZGF0ZSA9IGFkajsKKyAgICAgIGNvbnRpbnVlOworICAgIH0KKyAgICBpZiAoY29tcCA8IDApCisgICAgICBjb250aW51ZTsKKyAgICAKKyAgICBpZiAoY2FuZGlkYXRlLT5jaXJjdWl0LT5jaXJjdWl0X2lkID4gYWRqLT5jaXJjdWl0LT5jaXJjdWl0X2lkKSB7CisgICAgICBleGNlc3MgPSBub2RlOworICAgICAgY2FuZGlkYXRlID0gYWRqOworICAgICAgY29udGludWU7CisgICAgfQorCisgICAgaWYgKGNhbmRpZGF0ZS0+Y2lyY3VpdC0+Y2lyY3VpdF9pZCA8IGFkai0+Y2lyY3VpdC0+Y2lyY3VpdF9pZCkKKyAgICAgIGNvbnRpbnVlOworICAgIAorICAgIGNvbXAgPSBtZW1jbXAgKGNhbmRpZGF0ZS0+c25wYSwgYWRqLT5zbnBhLCBFVEhfQUxFTik7CisgICAgaWYgKGNvbXAgPiAwKSB7CisgICAgICBleGNlc3MgPSBub2RlOworICAgICAgY2FuZGlkYXRlID0gYWRqOworICAgICAgY29udGludWU7CisgICAgfQorICB9CisgIAorICBsaXN0X2RlbGV0ZV9ub2RlIChhZGpzLCBleGNlc3MpOworCisgIHJldHVybjsKK30KKworY29uc3QgY2hhciAqCit2dHlwZTJzdHJpbmcgKGVudW0gdmVydGV4dHlwZSB2dHlwZSkKK3sKKyAgc3dpdGNoICh2dHlwZSkgeworICBjYXNlICBWVFlQRV9QU0VVRE9fSVM6CisgICAgcmV0dXJuICJwc2V1ZG9fSVMiOworICAgIGJyZWFrOworICBjYXNlIFZUWVBFX05PTlBTRVVET19JUzoKKyAgICByZXR1cm4gIklTIjsKKyAgICBicmVhazsKKyAgY2FzZSBWVFlQRV9FUzoKKyAgICByZXR1cm4gIkVTIjsKKyAgICBicmVhazsKKyAgY2FzZSBWVFlQRV9JUFJFQUNIX0lOVEVSTkFMOgorICAgIHJldHVybiAiSVAgaW50ZXJuYWwiOworICAgIGJyZWFrOworICBjYXNlIFZUWVBFX0lQUkVBQ0hfRVhURVJOQUw6CisgICAgcmV0dXJuICJJUCBleHRlcm5hbCI7CisgICAgYnJlYWs7C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0lTX1dBUk5JTkc7CisgIGlmIChsc3AtPnRsdl9kYXRhLm5scGlkcyA9PSBOVUxMIHx8IAorICAgICAgIXNwZWFrcyAobHNwLT50bHZfZGF0YS5ubHBpZHMsIGZhbWlseSkpCisgICAgcmV0dXJuIElTSVNfT0s7CisKKyBsc3BmcmFnbG9vcDoKKyAgaWYgKGxzcC0+bHNwX2hlYWRlci0+c2VxX251bSA9PSAwKSB7CisgICAgemxvZ193YXJuICgiaXNpc19zcGZfcHJvY2Vzc19sc3AoKTogbHNwIHdpdGggMCBzZXFfbnVtIgorCSAgICAgICAiIC0gZG8gbm90IHByb2Nlc3MiKTsKKyAgICByZXR1cm4gSVNJU19XQVJOSU5HOworICB9CisKKyAgaWYgKCFJU0lTX01BU0tfTFNQX09MX0JJVChsc3AtPmxzcF9oZWFkZXItPmxzcF9iaXRzKSkgeworICAgIGlmIChsc3AtPnRsdl9kYXRhLmlzX25laWdocykgeworICAgICAgZm9yIChub2RlID0gbGlzdGhlYWQgKGxzcC0+dGx2X2RhdGEuaXNfbmVpZ2hzKTsgbm9kZTsgbmV4dG5vZGUgKG5vZGUpKSB7CisgICAgICAgIGlzX25laWdoID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgICAgIC8qIEMuMi42IGEpICovICAgICAgIAorCS8qIFR3byB3YXkgY29ubmVjdGl2aXR5ICovCisJaWYgKCFtZW1jbXAgKGlzX25laWdoLT5uZWlnaF9pZCwgaXNpcy0+c3lzaWQsIElTSVNfU1lTX0lEX0xFTikpCisJICBjb250aW51ZTsKKyAgICAgICAgZGlzdCA9IGNvc3QgKyBpc19uZWlnaC0+bWV0cmljcy5tZXRyaWNfZGVmYXVsdDsKKyAgICAgICAgdnR5cGUgPSBMU1BfUFNFVURPX0lEKGlzX25laWdoLT5uZWlnaF9pZCkgPyBWVFlQRV9QU0VVRE9fSVMgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogVlRZUEVfTk9OUFNFVURPX0lTOworICAgICAgICBwcm9jZXNzX04gKHNwZnRyZWUsIHZ0eXBlLCAodm9pZCAqKWlzX25laWdoLT5uZWlnaF9pZCwgZGlzdCwgZGVwdGgrMSwgCisgICAgICAgICAgICAgICAgICAgbHNwLT5hZGosIGZhbWlseSk7CisgICAgICB9CisgICAgfQorICAgIGlmIChmYW1pbHkgPT0gQUZfSU5FVCAmJiBsc3AtPnRsdl9kYXRhLmlwdjRfaW50X3JlYWNocykgeworICAgICAgcHJlZml4LmZhbWlseSA9IEFGX0lORVQ7CisgICAgICBmb3IgKG5vZGUgPSBsaXN0aGVhZCAobHNwLT50bHZfZGF0YS5pcHY0X2ludF9yZWFjaHMpOyBub2RlOyAKKyAgICAgICAgICAgbmV4dG5vZGUgKG5vZGUpKSB7CisgICAgICAgIGlwcmVhY2ggPSBnZXRkYXRhIChub2RlKTsKKyAgICAgICAgZGlzdCA9IGNvc3QgKyBpcHJlYWNoLT5tZXRyaWNzLm1ldHJpY19kZWZhdWx0OworICAgICAgICB2dHlwZSA9IFZUWVBFX0lQUkVBQ0hfSU5URVJOQUw7CisgICAgICAgIHByZWZpeC51LnByZWZpeDQgPSBpcHJlYWNoLT5wcmVmaXg7CisgICAgICAgIHByZWZpeC5wcmVmaXhsZW4gPSBpcF9tYXNrbGVuIChpcHJlYWNoLT5tYXNrKTsKKyAgICAgICAgcHJvY2Vzc19OIChzcGZ0cmVlLCB2dHlwZSwgKHZvaWQgKikmcHJlZml4LCBkaXN0LCBkZXB0aCArIDEsCisgICAgICAgICAgICAgICAgICAgbHNwLT5hZGosIGZhbWlseSk7CisgICAgICB9CisgICAgfQorICAgIAorICAgIGlmIChmYW1pbHkgPT0gQUZfSU5FVCAmJiBsc3AtPnRsdl9kYXRhLmlwdjRfZXh0X3JlYWNocykgeworICAgICAgcHJlZml4LmZhbWlseSA9IEFGX0lORVQ7CisgICAgICBmb3IgKG5vZGUgPSBsaXN0aGVhZCAobHNwLT50bHZfZGF0YS5pcHY0X2V4dF9yZ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0cmVlLCBWVFlQRV9JUFJFQUNIX0lOVEVSTkFMLCAmcHJlZml4LCBOVUxMLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbWlseSk7CisgICAgICB9CisgICAgfQorI2lmZGVmIEhBVkVfSVBWNgorICAgIGlmIChmYW1pbHkgPT0gQUZfSU5FVDYpIHsKKyAgICAgIHByZWZpeC5mYW1pbHkgPSBBRl9JTkVUNjsKKyAgICAgIGZvciAoaXBub2RlID0gKGNpcmN1aXQtPmlwdjZfbm9uX2xpbmsgPyBsaXN0aGVhZCAKKyAgICAgICAgICAgICAgICAgICAgIChjaXJjdWl0LT5pcHY2X25vbl9saW5rKSA6IE5VTEwpOyBpcG5vZGU7IAorICAgICAgICAgICBuZXh0bm9kZSAoaXBub2RlKSkgeworICAgICAgICBpcHY2ID0gZ2V0ZGF0YSAoaXBub2RlKTsKKyAgICAgICAgcHJlZml4LnByZWZpeGxlbiA9IGlwdjYtPnByZWZpeGxlbjsKKyAgICAgICAgcHJlZml4LnUucHJlZml4NiA9IGlwdjYtPnByZWZpeDsKKyAgICAgICAgaXNpc19zcGZfYWRkX2xvY2FsIChzcGZ0cmVlLCBWVFlQRV9JUDZSRUFDSF9JTlRFUk5BTCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnByZWZpeCwgTlVMTCwgMCwgZmFtaWx5KTsKKyAgICAgIH0KKyAgICB9CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCisgICAgaWYgKGNpcmN1aXQtPmNpcmNfdHlwZSA9PSBDSVJDVUlUX1RfQlJPQURDQVNUICkgeworICAgICAgLyoKKyAgICAgICAqIEFkZCB0aGUgYWRqYWNlbmNpZXMKKyAgICAgICAqLworICAgICAgYWRqX2xpc3QgPSBsaXN0X25ldyAoKTsKKyAgICAgIGFkamRiID0gY2lyY3VpdC0+dS5iYy5hZGpkYltsZXZlbCAtIDFdOworICAgICAgaXNpc19hZGpfYnVpbGRfdXBfbGlzdCAoYWRqZGIsIGFkal9saXN0KTsKKyAgICAgIGlmIChsaXN0Y291bnQgKGFkal9saXN0KSA9PSAwKSB7CisgICAgICAgIGxpc3RfZGVsZXRlIChhZGpfbGlzdCk7CisgICAgICAgIHpsb2dfd2FybiAoIklTSVMtU3BmOiBubyBMJWQgYWRqYWNlbmNpZXMgb24gY2lyY3VpdCAlcyIsCisgICAgICAgICAgICAgICAgICAgbGV2ZWwsIGNpcmN1aXQtPmludGVyZmFjZS0+bmFtZSk7CisJY29udGludWU7CisgICAgICB9CisgICAgICBhbm9kZSA9IGxpc3RoZWFkIChhZGpfbGlzdCk7CisgICAgICB3aGlsZSAoYW5vZGUpIHsKKyAgICAgICAgYWRqID0gZ2V0ZGF0YSAoYW5vZGUpOworICAgICAgICBpZiAoIXNwZWFrcyAoJmFkai0+bmxwaWRzLCBmYW1pbHkpKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICBzd2l0Y2ggKGFkai0+c3lzX3R5cGUpIHsKKyAgICAgICAgY2FzZSBJU0lTX1NZU1RZUEVfRVM6CisgICAgICAgICAgaXNpc19zcGZfYWRkX2xvY2FsIChzcGZ0cmVlLCBWVFlQRV9FUywgYWRqLT5zeXNpZCwgYWRqLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPm1ldHJpY3NbbGV2ZWwgLSAxXS5tZXRyaWNfZGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbWlseSk7CisgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIElTSVNfU1lTVFlQRV9JUzoKKyAgICAgICAgY2FzZSBJU0lTX1NZU1RZUEVfTDFfSVM6CisgICAgICAgIGNhc2UgSVNJU19TWVNUWVBFX0wyX0lTOgorICAgICAgICAgIHZlcnRleCA9IAorICAgICAgICAgICAgaXNpc19zcGZfYWRkX2xvY2FsIChzcGZ0cmVlLCBWVFlQRV9OT05QU0VVRE9fSVMsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGotPnN5c2lkLCBhZGosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPm1ldHJpY3NbbGV2ZWwgLSAxXS5tZXRyaWNfZGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFtaWx5KTsKKyAgICAgICAgICBtZW1jcHkgKGxzcF9pZCwgYWRqLT5zeXNpZCwgSVNJU19TWVNfSURfTEVOKTsKKyAgICAgICAgICBMU1BfUFNFVURPX0lEKGxzcF9pZCkgPSAwOworICAgICAgICAgIExTUF9GUkFHTUVOVChsc3BfaWQpID0gMDsKKyAgICAgICAgICBsc3AgPSBsc3Bfc2VhcmNoIChsc3BfaWQsIGFyZWEtPmxzcGRiW2xldmVsIC0gMV0pOworICAgICAgICAgIGlmICghbHNwKQorICAgICAgICAgICAgemxvZ193YXJuICgiTm8gbHNwIGZvdW5kIGZvciBJUyBhZGphY2VuY3kiKTsKKyAgICAgICAgICAvKiAgICAgICAgICBlbHNlIHsKKwkgICAgaXNpc19zcGZfcHJvY2Vzc19sc3AgKHNwZnRyZWUsIGxzcCwgdmVydGV4LT5kX04sIDEsIGZhbWlseSk7CisgICAgICAgICAgICB9ICovCisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgSVNJU19TWVNUWVBFX1VOS05PV046CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgemxvZ193YXJuICgiaXNpc19zcGZfcHJlbG9hZF90ZW50IHVua25vdyBhZGogdHlwZSIpOworICAgICAgICB9CisgICAgICAgIGFub2RlID0gbmV4dG5vZGUgKGFub2RlKTsgCisgICAgICB9CisgICAgICBsaXN0X2RlbGV0ZSAoYWRqX2xpc3QpOworICAgICAgLyoKKyAgICAgICAqIEFkZCB0aGUgcHNldWRvbm9kZSAKKyAgICAgICAqLworICAgICAgaWYgKGxldmVsID09IDEpCisgICAgICAgIG1lbWNweSAobHNwX2lkLCBjaXJjdWl0LT51LmJjLmwxX2Rlc2lnX2lzLC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NZU1RZUEVfRVM6CisgICAgICAgIGlzaXNfc3BmX2FkZF9sb2NhbCAoc3BmdHJlZSwgVlRZUEVfRVMsIGFkai0+c3lzaWQsIGFkaiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2lyY3VpdC0+bWV0cmljc1tsZXZlbCAtIDFdLm1ldHJpY19kZWZhdWx0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbWlseSk7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBJU0lTX1NZU1RZUEVfSVM6CisgICAgICBjYXNlIElTSVNfU1lTVFlQRV9MMV9JUzoKKyAgICAgIGNhc2UgSVNJU19TWVNUWVBFX0wyX0lTOgorICAgICAgICBpZiAoc3BlYWtzICgmYWRqLT5ubHBpZHMsIGZhbWlseSkpCisgICAgICAgICAgaXNpc19zcGZfYWRkX2xvY2FsIChzcGZ0cmVlLCBWVFlQRV9OT05QU0VVRE9fSVMsIGFkai0+c3lzaWQsIGFkaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1aXQtPm1ldHJpY3NbbGV2ZWwgLSAxXS5tZXRyaWNfZGVmYXVsdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbWlseSk7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBJU0lTX1NZU1RZUEVfVU5LTk9XTjoKKyAgICAgIGRlZmF1bHQ6CisgICAgICAgIHpsb2dfd2FybiAoImlzaXNfc3BmX3ByZWxvYWRfdGVudCB1bmtub3cgYWRqIHR5cGUiKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgIHpsb2dfd2FybiAoImlzaXNfc3BmX3ByZWxvYWRfdGVudCB1bnN1cHBvcnRlZCBtZWRpYSIpOworICAgICAgcmV0dmFsID0gSVNJU19XQVJOSU5HOworICAgIH0KKyAgICAKKyAgfQorCisgIHJldHVybiByZXR2YWw7Cit9CisKKy8qCisgKiBUaGUgcGFyZW50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mIChsZXZlbCA9PSAxKQorICAgICAgdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLCBpc2lzX3J1bl9zcGZfbDEsIGFyZWEsIAorICAgICAgICAgICAgICAgICAgICAgICAgNjApOworICAgIGVsc2UKKyAgICAgIHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgaXNpc19ydW5fc3BmX2wyLCBhcmVhLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIDYwKTsKKworICAgIHNwZnRyZWUtPnBlbmRpbmcgPSAxOworICAgIHJldHVybiByZXR2YWw7CisgIH0KKworCisgIGlmIChkaWZmIDwgTUlOSU1VTV9TUEZfSU5URVJWQUwpIHsKKyAgICBpZiAobGV2ZWwgPT0gMSkKKyAgICAgIHRocmVhZF9hZGRfdGltZXIgKG1hc3RlciwgaXNpc19ydW5fc3BmX2wxLCBhcmVhLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIE1JTklNVU1fU1BGX0lOVEVSVkFMIC0gZGlmZik7CisgICAgZWxzZQorICAgICAgdGhyZWFkX2FkZF90aW1lciAobWFzdGVyLCBpc2lzX3J1bl9zcGZfbDIsIGFyZWEsIAorICAgICAgICAgICAgICAgICAgICAgICAgTUlOSU1VTV9TUEZfSU5URVJWQUwgLSBkaWZmKTsKKworICAgIHNwZnRyZWUtPnBlbmRpbmcgPSAxOworICB9IGVsc2UgeworICAgIHNwZnRyZWUtPnBlbmRpbmcgPSAwOworICAgIHJldHZhbCA9IGlzaXNfcnVuX3NwZiAoYXJlYSwgbGV2ZWwsIEFGX0lORVQ2KTsKKyAgfQorCisgIHJldHVybiByZXR2YWw7Cit9CisKKyNlbmRpZgorCit2b2lkCitpc2lzX3ByaW50X3BhdGhzIChzdHJ1Y3QgdnR5ICp2dHksIHN0cnVjdCBsaXN0ICpwYXRocykKK3sKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlLCAqYW5vZGU7CisgIHN0cnVjdCBpc2lzX3ZlcnRleCAqdmVydGV4OworICBzdHJ1Y3QgaXNpc19keW5obiAqZHluLCAqbmhfZHluID0gTlVMTDsKKyAgc3RydWN0IGlzaXNfYWRqYWNlbmN5ICphZGo7CisjaWZkZWYgRVhUUkVNRV9ERUJVRworICB1X2NoYXIgYnVmZlsyNTVdOworI2VuZGlmIAorCisgIHZ0eV9vdXQgKHZ0eSwgIlN5c3RlbSBJZCAgICAgICAgICAgIE1ldHJpYyAgICAgTmV4dC1Ib3AiCisgICAgICAgICAgICIgICAgICAgICAgICAgSW50ZXJmYWNlICAgU05QQSVzIiwgVlRZX05FV0xJTkUpOworICBmb3IgKG5vZGUgPSBsaXN0aGVhZCAocGF0aHMpOyBub2RlOyBuZXh0bm9kZSAobm9kZSkpIHsKKyAgICB2ZXJ0ZXggPSBnZXRkYXRhIChub2RlKTsKKyAgICBpZiAodmVydGV4LT50eXBlICE9IFZUWVBFX05PTlBTRVVET19JUykKKyAgICAgIGNvbnRpbnVlOworICAgIGlmIChtZW1jbXAgKHZlcnRleC0+Ti5pZCwgaXNpcy0+c3lzaWQsIElTSVNfU1lTX0lEX0xFTikgPT0gMCkgeworICAgICAgdnR5X291dCAodnR5LCAiJXMgICAgICAgICAgICAgLS0lcyIsIGhvc3QubmFtZSwgVlRZX05FV0xJTkUpOworICAgIH0gZWxzZSB7CisgICAgICBkeW4gPSBkeW5obl9maW5kX2J5X2lkICgodV9jaGFyICopdmVydGV4LT5OLmlkKTsKKyAgICAgIGFub2RlID0gbGlzdGhlYWQgKHZlcnRleC0+QWRqX04pOworICAgICAgYWRqID0gZ2V0ZGF0YSAoYW5vZGUpOworICAgICAgaWYgKGFkaikgeworICAgICAgICBuaF9keW4gPSBkeW5obl9maW5kX2J5X2lkIChhZGotPnN5c2lkKTsKKyAgICAgICAgdnR5X291dCAodnR5LCAiJS0yMHMgJS0xMHUgJS0yMHMgJS0xMXMgJS01cyVzIiwgCisgICAgICAgICAgICAgICAgIChkeW4gIT0gTlVMTCkgPyBkeW4tPm5hbWUubmFtZSA6IAorICAgICAgICAgICAgICAgICAodV9jaGFyICopcmF3bHNwaWRfcHJpbnQgKCh1X2NoYXIgKil2ZXJ0ZXgtPk4uaWQpLAorICAgICAgICAgICAgICAgICB2ZXJ0ZXgtPmRfTiwgKG5oX2R5biAhPSBOVUxMKSA/IG5oX2R5bi0+bmFtZS5uYW1lIDogCisgICAgICAgICAgICAgICAgICh1X2NoYXIgKilyYXdsc3BpZF9wcmludCAoYWRqLT5zeXNpZCksIAorICAgICAgICAgICAgICAgICBhZGotPmNpcmN1aXQtPmludGVyZmFjZS0+bmFtZSwKKyAgICAgICAgICAgICAgICAgc25wYV9wcmludCAoYWRqLT5zbnBhKSwgVlRZX05FV0xJTkUpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgdnR5X291dCAodnR5LCAiJXMgICAgICAgICAgICAgICV1ICVzIiwgZHluID8gZHluLT5uYW1lLm5hbWUgOiAKKyAgICAgICAgICAgICAgICAgKHVfY2hhciAqKXJhd2xzcGlkX3ByaW50ICh2ZXJ0ZXgtPk4uaWQpLCAKKyAgICAgICAgICAgICAgICAgdmVydGV4LT5kX04sIFZUWV9ORVdMSU5FKTsKKyAgICAgIH0KKyAgICAgICAgCisgICAgfQorI2lmIDAKKyAgICB2dHlfb3V0ICh2dHksICIlcyAlcyAldSAlcyIsIHZ0eXBlMnN0cmluZyh2ZXJ0ZXgtPnR5cGUpLCAKKyAgICAgICAgICAgICB2aWQyc3RyaW5nKHZlcnRleCwgYnVmZiksIHZlcnRleC0+ZF9OLCBWVFlfTkVXTElORSk7CisjZW5kaWYKKyAgfQorCisgIAorfQorCitERUZVTiAoc2hvd19pc2lzX3RvcG9sb2d5LAorICAgICAgIHNob3dfaXNpc190b3BvbG9neV9jbWQsCisgICAgICAgInNob3cgaXNpcyB0b3BvbG9neSIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiSVMtSVMgaW5mb3JtYXRpb25cbiIKKyAgICAgICAiSVMtSVMgcGF0aHMgdG8gSW50ZXJtZWRpYXRlIFN5c3RlbXNcb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YV90YWcgOiAibnVsbCIsCisgICAgICAgICAgICAgVlRZX05FV0xJTkUpOworICAgIAorICAgIGlmIChhcmVhLT5pcF9jaXJjdWl0cyA+IDAgJiYgYXJlYS0+c3BmdHJlZVswXSAKKyAgICAgICAgJiYgYXJlYS0+c3BmdHJlZVswXS0+cGF0aHMtPmNvdW50ID4gMCkgeworICAgICAgdnR5X291dCAodnR5LCAiSVMtSVMgcGF0aHMgdG8gbGV2ZWwtMSByb3V0ZXJzIHRoYXQgc3BlYWsgSVAlcyIsIAorICAgICAgICAgICAgICAgVlRZX05FV0xJTkUpOworICAgICAgaXNpc19wcmludF9wYXRocyAodnR5LCBhcmVhLT5zcGZ0cmVlWzBdLT5wYXRocyk7CisgICAgfQorI2lmZGVmIEhBVkVfSVBWNgorICAgICAgaWYgKGFyZWEtPmlwdjZfY2lyY3VpdHMgPiAwICYmIGFyZWEtPnNwZnRyZWU2WzBdIAorICAgICAgICAgICYmIGFyZWEtPnNwZnRyZWU2WzBdLT5wYXRocy0+Y291bnQgPiAwKSB7CisgICAgICAgIHZ0eV9vdXQgKHZ0eSwgIklTLUlTIHBhdGhzIHRvIGxldmVsLTEgcm91dGVycyB0aGF0IHNwZWFrIElQdjYlcyIsIAorICAgICAgICAgICAgICAgICBWVFlfTkVXTElORSk7CisgICAgICAgIGlzaXNfcHJpbnRfcGF0aHMgKHZ0eSwgYXJlYS0+c3BmdHJlZTZbMF0tPnBhdGhzKTsKKyAgICAgIH0KKyNlbmRpZiAvKiBIQVZFX0lQVjYgKi8KKyAgICB9CisKKworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9IAorCitERUZVTiAoc2hvd19pc2lzX3RvcG9sb2d5X2wyLAorICAgICAgIHNob3dfaXNpc190b3BvbG9neV9sMl9jbWQsCisgICAgICAgInNob3cgaXNpcyB0b3BvbG9neSBsZXZlbC0yIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJJUy1JUyBpbmZvcm1hdGlvblxuIgorICAgICAgICJJUy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3QgdGVfaXNfbmVpZ2ggICAgICAgICAgICAgICAgKnRlX2lzX25laTsKKyAgc3RydWN0IGVzX25laWdoICAgICAgICAgICAgICAgICAgICAgICplc19uZWk7CisgIHN0cnVjdCBsc3BfZW50cnkgICAgICAgICAgICAgICAgICAqbHNwX2VudHJ5OworICBzdHJ1Y3QgaW5fYWRkciAgICAgICAgICAgICAgICAgICAgKmlwdjRfYWRkcjsKKyAgc3RydWN0IGlwdjRfcmVhY2hhYmlsaXR5ICAgICAgICAgKmlwdjRfcmVhY2g7CisgIHN0cnVjdCB0ZV9pcHY0X3JlYWNoYWJpbGl0eSAgICp0ZV9pcHY0X3JlYWNoOworI2lmZGVmIEhBVkVfSVBWNgorICBzdHJ1Y3QgaW42X2FkZHIgICAgICAgICAgICAgICAgICAgKmlwdjZfYWRkcjsKKyAgc3RydWN0IGlwdjZfcmVhY2hhYmlsaXR5ICAgICAgICAgKmlwdjZfcmVhY2g7CisgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXhfb2N0ZXRzOworI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworICB1X2NoYXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlydHVhbDsKKyAgaW50ICAgICAgICAgICAgICB2YWx1ZV9sZW4sIHJldHZhbCA9IElTSVNfT0s7CisgIHVfY2hhciAgICAgICAgICAgICAgICAgICAqcG50ID0gc3RyZWFtOworCisgICpmb3VuZCA9IDA7CisgIG1lbXNldCAodGx2cywgMCwgc2l6ZW9mIChzdHJ1Y3QgdGx2cykpOworICAKKyAgd2hpbGUgKHBudCA8IHN0cmVhbSArIHNpemUgLSAyKSB7CisgICAgdHlwZSA9ICpwbnQ7CisgICAgbGVuZ3RoID0gKihwbnQrMSk7CisgICAgcG50ICs9IDI7CisgICAgdmFsdWVfbGVuID0gMDsKKyAgICBpZiAoIHBudCArIGxlbmd0aCA+IHN0cmVhbSArIHNpemUgKSB7CisgICAgICB6bG9nX3dhcm4gKCJJU0lTLVRMViAoJXMpOiBUTFYgKHR5cGUgJWQsIGxlbmd0aCAlZCkgZXhjZWVkcyBwYWNrZXQgIgorCQkgImJvdW5kYXJpZXMiLCBhcmVhdGFnLCB0eXBlLCBsZW5ndGgpOworICAgICAgcmV0dmFsID0gSVNJU19XQVJOSU5HOworICAgICAgYnJlYWs7CisgICAgfQorICAgIHN3aXRjaCAodHlwZSkgeworICAgIGNhc2UgQVJFQV9BRERSRVNTRVM6CisgICAgICAvKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgIEFkZHJlc3MgTGVuZ3RoICAgICAgICAgICAgICAgICAgICAgICAgIHwgCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgICBBcmVhIEFkZHJlc3MgICAgICAgICAgICAgICAgICAgICAgICAgIHwgCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoKKyAgICAgICAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfQVJFQV9BRERSUzsKKyNpZmRlZiBFWFRSRU1FX1RMVl9ERUJVRworICAgICAgemxvZ19pbmZvICgiVExWIEFyZWEgQWRyZXNzZXMgbGVuICVkIiwgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgaWYgKCpleHBlY3RlZCAmIFRMVkZMQUdfQVJFQV9BRERSUykgeworICAgICAgICB3aGlsZ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ICAgICAqLworICAgICAgICB2aXJ0dWFsID0gKnBudDsgLyogRklYTUU6IHdoYXQgaXMgdGhlIHVzZSBmb3IgdGhpcz8gKi8KKyAgICAgICAgcG50Kys7CisgICAgICAgIHZhbHVlX2xlbiArKzsKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgMCAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIERlZmF1bHQgTWV0cmljICAgICAgICAgICAgICAgICAgfCAKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgUyAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIERlbGF5IE1ldHJpYyAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICBTICAgfCAgSS9FICB8ICAgICAgICAgICAgICAgRXhwZW5zZSBNZXRyaWMgICAgICAgICAgICAgICAgICB8CisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgIFMgICB8ICBJL0UgIHwgICAgICAgICAgICAgICBFcnJvciBNZXRyaWMgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgTmVpZ2hib3VyIElEICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6CisgICAgICAgKi8KKyAgICAgICAgd2hpbGUgKGxlbmd0aCA+IHZhbHVlX2xlbikgeworICAgICAgICAgIGlzX25laSA9IChzdHJ1Y3QgaXNfbmVpZ2gqKXBudDsKKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gNCArIElTSVNfU1lTX0lEX0xFTiArIDE7CisgICAgICAgICAgcG50ICs9IDQgKyBJU0lTX1NZU19JRF9MRU4gKyAxOworICAgICAgICAgIGlmICghdGx2cy0+aXNfbmVpZ2hzKSB0bHZzLT5pc19uZWlnaHMgPSBsaXN0X25ldyAoKTsKKyAgICAgICAgICBsaXN0bm9kZV9hZGQgKHRsdnMtPmlzX25laWdocywgaXNfbmVpKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIHsKKyAgICAgICAgcG50ICs9IGxlbmd0aDsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBURV9JU19ORUlHSEJPVVJTOgorICAgICAgLyogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgICAgICBOZWlnaGJvdXIgSUQgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDcKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgVEUgTWV0cmljICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAzCisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgIFN1YlRMVnMgTGVuZ3RoICAgICAgICAgICAgICAgICAgICAgICAgIHwgMQorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6CisgICAgICAgKi8KKyAgICAgICpmb3VuZCB8PSBUTFZGTEFHX1RFX0lTX05FSUdIUzsKKyNpZmRlZiBFWFRSRU1FX1RMVl9ERUJVRworICAgICAgemxvZ19pbmZvICgiSVNJUy1UTFYgKCVzKTogRXh0ZW5kZWQgSVMgTmVpZ2hib3VycyBsZW5ndGggJWQiLAorCQkgYXJlYXRhZywKKwkJIGxlbmd0aCk7CisjZW5kaWYgLyogRVhUUkVNRV9UTFZfREVCVUcgKi8KKyAgICAgIGlmIChUTFZGTEFHX1RFX0lTX05FSUdIUyAmICpleHBlY3RlZCkgeworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgICAgdGVfaXNfbmVpID0gKHN0cnVjdCB0ZV9pc19uZWlnaCopcG50OworICAgICAgICAgIHZhbHVlX2xlbiArPSAxMTsKKyAgICAgICAgICBwbnQgKz0gMTE7CisgICAgICAgICAgLyogRklYTUUgLSBzdWJ0bHZzIGFyZSBoYW5kbGVkIGhlcmUsIGZvciBub3cgd2Ugc2tpcCAqLworICAgICAgICAgIHZhbHVlX2xlbiArPSB0ZV9pc19uZWktPnN1Yl90bHZzX2xlbmd0aDsKKyAgICAgICAgICBwbnQgKz0gdGVfaXNfbmVpLT5zdWJfdGx2c19sZW5ndGg7CisKKworICAgICAgICAgIGlmICghdGx2cy0+dGVfaXNfbmVpZ2hzKSB0bHZzLT50ZV9pc19uZWlnaHMgPSBsaXN0X25ldyAoKTsKKyAgICAgICAgICBsaXN0bm9kZV9hZGQgKHRsdnMtPnRlX2lzX25laWdocywgdGVfaXNfbmVpKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIHsKKyAgICAgICAgcG50ICs9IGxlbmd0aDsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBFU19ORUlHSEJPVVJTOiAKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgMCAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIERlZmF1bHQgTWV0cmljICAgICAgICAgICAgICAgICAgfCAKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgUyAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIERlbGF5IE1ldHJpYyAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICBTICAgfCAgSS9FICB8ICAgICAgICAgICAgICAgRXhwZW5zZSBNZXRyaWMgICAgICAgICAgICAgICAgICB8CisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgIFMgICB8ICBJL0UgIHwgICAgICAgICAgICAgICBFcnJvciBNZXRyaWMgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgTmVpZ2hib3VyIElEICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgICAgICBOZWlnaGJvdXIgSUQgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoKKyAgICAgICAqLworI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMViAoJXMpOiBFUyBOZWlnaGJvdXJzIGxlbmd0aCAlZCIsCisJCSBhcmVhdGFnLAorCQkgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfRVNfTkVJR0hTOworICAgICAgaWYgKCpleHBlY3RlZCAmIFRMVkZMQUdfRVNfTkVJR0hTKSB7CisgICAgICAgIGVzX25laSA9IChzdHJ1Y3QgZXNfbmVpZ2gqKXBudDsKKyAgICAgICAgdmFsdWVfbGVuICs9IDQ7CisgICAgICAgIHBudCArPSA0OworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgIC8qIEZJWE1FIEZJWE1FIEZJWE1FIC0gYWRkIHRvIHRoZSBsaXN0ICovCisJLyogICAgICAgICAgc3lzX2lkLT5pZCA9IHBudDsqLworICAgICAgICAgIHZhbHVlX2xlbiArPSBJU0lTX1NZU19JRF9MRU47CisgICAgICAgICAgcG50ICs9IElTSVNfU1lTX0lEX0xFTjsKKyAgICAgICAgLyogIGlmICghZXNfbmVpLT5uZWlnaF9pZHMpIGVzX25laS0+bmVpZ2hfaWRzID0gc3lzaWQ7Ki8KKyAgICAgICAgfQorICAgICAgICBpZiAoIXRsdnMtPmVzX25laWdocykgdGx2cy0+ZXNfbmVpZ2hzID0gbGlzdF9uZXcgKCk7CisgICAgICAgIGxpc3Rub2RlX2FkZCAodGx2cy0+ZXNfbmVpZ2hzLCBlc19uZWkpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgcG50ICs9IGxlbmd0aDsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBMQU5fTkVJR0hCT1VSUzoKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgTEFOIEFkZHJlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOgorICAgICAgICovCisgICAgICAqZm91bmQgfD0gVExWRkxBR19MQU5fTkVJR0hTOworICAgICAgI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMViAoJXMpOiBMQU4gTmVpZ2JvdXJzIGxlbmd0aCAlZCIsCisJCSBhcmVhdGFnLAorCQkgbGVuZ3RoKTsKKyAgICAgICNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgaWYgKFRMVkZMQUdfTEFOX05FSUdIUyAmICpleHBlY3RlZCkgeworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgICAgbGFuX25laSA9IChzdHJ1Y3QgbGFuX25laWdoKilwbnQ7CisgICAgICAgICAgaWYgKCF0bHZzLT5sYW5fbmVpZ2hzKSB0bHZzLT5sYW5fbmVpZ2hzID0gbGlzdF9uZXcgKCk7CisgICAgICAgICAgbGlzdG5vZGVfYWRkICh0bHZzLT5sYW5fbmVpZ2hzLCBsYW5fbmVpKTsKKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gRVRIX0FMRU47CisgICAgICAgICAgcG50ICs9IEVUSF9BTEVOOworICAgICAgICB9CisgICAgICB9IGVsc2UgeworICAgICAgICBwbnQgKz0gbGVuZ3RoOworICAgICAgfQorICAgICAgYnJlYWs7CisKKyAgICBjYXNlIFBBRERJTkc6CisjaWZkZWYgRVhUUkVNRV9UTFZfREVCVUcKKyAgICAgIHpsb2dfaW5mbyAoIlRMViBwYWRkaW5nICVkIiwgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgcG50ICs9IGxlbmd0aDsKKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBMU1BfRU5UUklFUzoKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgUmVtYWluaW5nIExpZmV0aW1lICAgICAgICAgICAgICAgICAgICAgICAgfCAyCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgICBMU1AgSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgaWQrMgorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgTFNQIFNlcXVlbmNlIE51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICB8oDQKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgQ2hlY2tzdW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAyCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICovCisjaWZkZWYgRVhUUkVNRV9UTFZfREVCVUcKKyAgICAgIHpsb2dfaW5mbyAoIkxTUCBFbnRyaWVzIGxlbmd0aCAlZCIsCisJCSBhcmVhdGFnLAorCQkgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfTFNQX0VOVFJJRVM7CisgICAgICBpZiAoVExWRkxBR19MU1BfRU5UUklFUyAmICpleHBlY3RlZCkgeworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgICAgbHNwX2VudHJ5ID0gKHN0cnVjdCBsc3BfZW50cnkqKXBudDsKKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gMTAgKyBJU0lTX1NZU19JRF9MRU47CisgICAgICAgICAgcG50ICs9ICAxMCArIElTSVNfU1lTX0lEX0xFTjsKKyAgICAgICAgICBpZiAoIXRsdnMtPmxzcF9lbnRyaWVzKSB0bHZzLT5sc3BfZW50cmllcyA9IGxpc3RfbmV3ICgpOworICAgICAgICAgIGxpc3Rub2RlX2FkZCAodGx2cy0+bHNwX2VudHJpZXMsIGxzcF9lbnRyeSk7CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICB9CisgICAgICBicmVhazsKKworICAgIGNhc2UgQ0hFQ0tTVU06CisgICAgICAvKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAxNiBiaXQgZmxldGNoZXIgQ0hFQ0tTVU0gICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOgorICAgICAgICovCisgICAgICAqZm91bmQgfD0gVExWRkxBR19DSEVDS1NVTTsKKyNpZmRlZiBFWFRSRU1FX1RMVl9ERUJVRworICAgICAgemxvZ19pbmZvICgiSVNJUy1UTFYgKCVzKTogQ2hlY2tzdW0gbGVuZ3RoICVkIiwKKwkJIGFyZWF0YWcsCisJCSBsZW5ndGgpOworI2VuZGlmIC8qIEVYVFJFTUVfVExWX0RFQlVHICovCisgICAgICBpZiAoKmV4cGVjdGVkICYgVExWRkxBR19DSEVDS1NVTSkgeworICAgICAgICB0bHZzLT5jaGVja3N1bSA9IChzdHJ1Y3QgY2hlY2tzdW0qKXBudDsKKyAgICAgIH0KKyAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICBicmVhazsKKworICAgIGNhc2UgUFJPVE9DT0xTX1NVUFBPUlRFRDoKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICBOTFBJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6CisgICAgICAgKi8KKyAgICAgICpmb3VuZCB8PSBUTFZGTEFHX05MUElEOworI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMViAoJXMpOiBQcm90b2NvbHMgU3VwcG9ydGVkIGxlbmd0aCAlZCIsCisJCSBhcmVhdGFnLAorCQkgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgaWYgKCpleHBlY3RlZCAmIFRMVkZMQUdfTkxQSUQpIHsKKyAgICAgICAgdGx2cy0+bmxwaWRzID0gKHN0cnVjdCBubHBpZHMqKShwbnQtMSk7CisgICAgICB9CisgICAgICBwbnQgKz0gbGVuZ3RoOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIElQVjRfQUREUjoKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiArICAgICAgICAgICAgICAgICBJUCB2ZXJzaW9uIDQgYWRkcmVzcyAgICAgICAgICAgICAgICAgICAgICAgICAgKyA0CisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoKKyAgICAgICAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfSVBWNF9BRERSOworI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMViAoJXMpOiBJUHY0IEFkZHJlc3MgbGVuZ3RoICVkIiwKKwkJIGFyZWF0YWcsCisJCSBsZW5ndGgpOworI2VuZGlmIC8qIEVYVFJFTUVfVExWX0RFQlVHICovCisgICAgICBpZiAoKmV4cGVjdGVkICYgVExWRkxBR19JUFY0X0FERFIpIHsKKyAgICAgICAgd2hpbGUgKGxlbmd0aCA+IHZhbHVlX2xlbikgeworICAgICAgICAgIGlwdjRfYWRkciA9IChzdHJ1Y3QgaW5fYWRkciopcG50OworCSAgemxvZ19pbmZvICgiSVNJUy1UTFYgKCVzKSA6IElQIEFERFIgJXMsIHBudCAlcCIsIGFyZWF0YWcsIAorCQkgICAgIGluZXRfbnRvYSAoKmlwdjRfYWRkciksIHBudCk7CisgICAgICAgICAgaWYgKCF0bHZzLT5pcHY0X2FkZHJzKSB0bHZzLT5pcHY0X2FkZHJzID0gbGlzdF9uZXcoKTsKKyAgICAgICAgICBsaXN0bm9kZV9hZGQgKHRsdnMtPmlwdjRfYWRkcnMsIGlwdjRfYWRkcik7CisgICAgICAgICAgdmFsdWVfbGVuICs9IDQ7CisgICAgICAgICAgcG50ICs9IDQ7CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICB9CisgICAgICBicmVhazsKKworICAgIGNhc2UgQVVUSF9JTkZPOgorICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfQVVUSF9JTkZPOworI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMVi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AgICAgICAgICAgICBSb3V0ZXIgSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgNAorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfVEVfUk9VVEVSX0lEOworI2lmZGVmIEVYVFJFTUVfVExWX0RFQlVHCisgICAgICB6bG9nX2luZm8gKCJJU0lTLVRMViAoJXMpOiBURSBSb3V0ZXIgSUQgJWQiLAorCQkgYXJlYXRhZywKKwkJIGxlbmd0aCk7CisjZW5kaWYgLyogRVhUUkVNRV9UTFZfREVCVUcgKi8KKyAgICAgIGlmICgqZXhwZWN0ZWQgJiBUTFZGTEFHX1RFX1JPVVRFUl9JRCkgeworICAgICAgICB0bHZzLT5yb3V0ZXJfaWQgPSAoc3RydWN0IHRlX3JvdXRlcl9pZCopKHBudCk7CisgICAgICB9CisgICAgICBwbnQgKz0gbGVuZ3RoOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIElQVjRfSU5UX1JFQUNIQUJJTElUWToKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgMCAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIERlZmF1bHQgTWV0cmljICAgICAgICAgICAgICAgICAgfCAxCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgIFMgICB8ICBJL0UgIHwgICAgICAgICAgICAgICBEZWxheSBNZXRyaWMgICAgICAgICAgICAgICAgICAgIHwgMQorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICBTICAgfCAgSS9FICB8ICAgICAgICAgICAgICAgRXhwZW5zZSBNZXRyaWMgICAgICAgICAgICAgICAgICB8IDEKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgUyAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIEVycm9yIE1ldHJpYyAgICAgICAgICAgICAgICAgICAgfCAxCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgIGlwIGFkZHJlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgNAorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgICAgICBhZGRyZXNzIG1hc2sgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDQKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOgorICAgICAgICovCisgICAgICAqZm91bmQgfD0gVExWRkxBR19JUFY0X0lOVF9SRUFDSEFCSUxJVFk7CisjaWZkZWYgRVhUUkVNRV9UTFZfREVCVUcKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtVExWICglcyk6IElQdjQgaW50ZXJuYWwgUmVhY2hhYmlsaXR5IGxlbmd0aCAlZCIsCisJCSBhcmVhdGFnLAorCQkgbGVuZ3RoKTsKKyNlbmRpZiAvKiBFWFRSRU1FX1RMVl9ERUJVRyAqLworICAgICAgaWYgKCpleHBlY3RlZCAmIFRMVkZMQUdfSVBWNF9JTlRfUkVBQ0hBQklMSVRZKSB7CisgICAgICAgIHdoaWxlIChsZW5ndGggPiB2YWx1ZV9sZW4pIHsKKyAgICAgICAgICBpcHY0X3JlYWNoID0gKHN0cnVjdCBpcHY0X3JlYWNoYWJpbGl0eSopcG50OworICAgICAgICAgIGlmICghdGx2cy0+aXB2NF9pbnRfcmVhY2hzKSB0bHZzLT5pcHY0X2ludF9yZWFjaHMgPSBsaXN0X25ldygpOworICAgICAgICAgIGxpc3Rub2RlX2FkZCAodGx2cy0+aXB2NF9pbnRfcmVhY2hzLCBpcHY0X3JlYWNoKTsKKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gMTI7CisgICAgICAgICAgcG50ICs9IDEyOworICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIHsKKyAgICAgICAgcG50ICs9IGxlbmd0aDsKKyAgICAgIH0KKyAgICAgIGJyZWFrOworCisgICAgY2FzZSBJUFY0X0VYVF9SRUFDSEFCSUxJVFk6CisgICAgICAvKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgIDAgICB8ICBJL0UgIHwgICAgICAgICAgICAgICBEZWZhdWx0IE1ldHJpYyAgICAgICAgICAgICAgICAgIHwgMQorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICBTICAgfCAgSS9FICB8ICAgICAgICAgICAgICAgRGVsYXkgTWV0cmljICAgICAgICAgICAgICAgICAgICB8IDEKKyAgICAgICAqICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiB8ICAgUyAgIHwgIEkvRSAgfCAgICAgICAgICAgICAgIEV4cGVuc2UgTWV0cmljICAgICAgICAgICAgICAgICAgfCAxCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgIFMgICB8ICBJL0UgIHwgICAgICAgICAgICAgICBFcnJvciBNZXRyaWMgICAgICAgICAgICAgICAgICAgIHwgMQorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgICAgICBpcCBhZGRyZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDQKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgYWRkcmVzcyBtYXNrICAgICAgICAgICAgICAgICAgICAgICAgICAgfCA0CisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoKKyAgICAgICAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfVEVfSVBWNF9SRUFDSEFCSUxJVFk7CisjaWZkZWYgRVhUUkVNRV9UTFZfREVCVUcKKyAgICAgIHpsb2dfaW5mbyAoIklTSVMtVExWICglcyk6IElQdjQ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gICAgICAgfCAxCisgICAgICAgKiArLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgIFByZWZpeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMC00CisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgICBzdWIgdGx2cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOgorICAgICAgICovCisgICAgICAqZm91bmQgfD0gVExWRkxBR19URV9JUFY0X1JFQUNIQUJJTElUWTsKKyNpZmRlZiBFWFRSRU1FX1RMVl9ERUJVRworICAgICAgemxvZ19pbmZvICgiSVNJUy1UTFYgKCVzKTogSVB2NCBleHRlbmRlZCBSZWFjaGFiaWxpdHkgbGVuZ3RoICVkIiwKKwkJIGFyZWF0YWcsCisJCSBsZW5ndGgpOworI2VuZGlmIC8qIEVYVFJFTUVfVExWX0RFQlVHICovCisgICAgICBpZiAoKmV4cGVjdGVkICYgVExWRkxBR19URV9JUFY0X1JFQUNIQUJJTElUWSkgeworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgICAgdGVfaXB2NF9yZWFjaCA9IChzdHJ1Y3QgdGVfaXB2NF9yZWFjaGFiaWxpdHkqKXBudDsKKyAgICAgICAgICBpZiAoIXRsdnMtPnRlX2lwdjRfcmVhY2hzKSB0bHZzLT50ZV9pcHY0X3JlYWNocyA9IGxpc3RfbmV3KCk7CisgICAgICAgICAgbGlzdG5vZGVfYWRkICh0bHZzLT50ZV9pcHY0X3JlYWNocywgdGVfaXB2NF9yZWFjaCk7CisgICAgICAgICAgLyogdGhpcyB0cmlja2VyeSBpcyBwZXJtaXRhYmxlIHNpbmNlIG5vIHN1YnRsdnMgYXJlIGRlZmluZWQgKi8KKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gNSArICgodGVfaXB2NF9yZWFjaC0+Y29udHJvbCAmIDB4M0YpID8gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCgodGVfaXB2NF9yZWFjaC0+Y29udHJvbCAmIDB4M0YpLTEpPj4zKSsxKSA6IDApOworICAgICAgICAgIHBudCArPSAgNSArICgodGVfaXB2NF9yZWFjaC0+Y29udHJvbCAmIDB4M0YpID8gCisgICAgICAgICAgICAgICAgICAgICAgKCgoKHRlX2lwdjRfcmVhY2gtPmNvbnRyb2wgJiAweDNGKS0xKT4+MykrMSkgOiAwKTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgZWxzZSB7CisgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICB9CisgICAgICBicmVhazsKKworI2lmZGVmICBIQVZFX0lQVjYKKyAgICBjYXNlIElQVjZfQUREUjoKKyAgICAgIC8qICstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rCisgICAgICAgKiArICAgICAgICAgICAgICAgICBJUCB2ZXJzaW9uIDYgYWRkcmVzcyAgICAgICAgICAgICAgICAgICAgICAgICAgKyAxNgorICAgICAgICogKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSstLS0tLS0tKy0tLS0tLS0rLS0tLS0tLSsKKyAgICAgICAqIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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KyAgICAgICAqIHwgICAgICAgICAgICAgICAgICAgICAgICBDb250cm9sIEluZm9ybWFudGlvbiAgICAgICAgICAgICAgICAgICB8CisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgICAgICAgIElQdjYgUHJlZml4IExlbmd0aCAgICAgICAgICAgICAgICAgICAgIHwtLSsKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rICB8CisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgSVB2NiBQcmVmaXggICAgICAgICAgICAgICAgICAgICAgICAgICAgfDwtKworICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqLworICAgICAgKmZvdW5kIHw9IFRMVkZMQUdfSVBWNl9SRUFDSEFCSUxJVFk7CisgICAgICBpZiAoKmV4cGVjdGVkICYgVExWRkxBR19JUFY2X1JFQUNIQUJJTElUWSkgeworICAgICAgICB3aGlsZSAobGVuZ3RoID4gdmFsdWVfbGVuKSB7CisgICAgICAgICAgaXB2Nl9yZWFjaCA9IChzdHJ1Y3QgaXB2Nl9yZWFjaGFiaWxpdHkqKXBudDsKKyAgICAgICAgICBwcmVmaXhfb2N0ZXRzID0gKChpcHY2X3JlYWNoLT5wcmVmaXhfbGVuICsgNykgLyA4KTsKKyAgICAgICAgICB2YWx1ZV9sZW4gKz0gcHJlZml4X29jdGV0cyArIDY7CisgICAgICAgICAgcG50ICs9ICBwcmVmaXhfb2N0ZXRzICsgNjsKKyAgICAgICAgICAvKiBGSVhNRTogc3ViLXRsdnMgKi8KKyAgICAgICAgICBpZiAoIXRsdnMtPmlwdjZfcmVhY2hzKSB0bHZzLT5pcHY2X3JlYWNocyA9IGxpc3RfbmV3KCk7CisgICAgICAgICAgbGlzdG5vZGVfYWRkICh0bHZzLT5pcHY2X3JlYWNocywgaXB2Nl9yZWFjaCk7CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICB9CisgICAgICBicmVhazsKKyNlbmRpZiAvKiBIQVZFX0lQVjYgKi8KKworICAgIGNhc2UgV0FZM19IRUxMTzoKKyAgICAgIC8qICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKiB8ICAgICAgICAgICAgICAgICAgQWRqYWNlbmN5IHN0YXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxCisgICAgICAgKiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAgICAgICogfCAgICAgICAgICAgICAgICAgIEV4dGVuZGVkIExvY2FsIENpcmN1aXQgSUQgICAgICAgICAgICAgICAgICAgIHwgNAorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICBOZWlnaGJvciBTeXN0ZW0gSUQgKElmIGtub3duKSAgICAgICAgICAgICAgICB8IDAtOAorICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwcm9iYWJseSA2KQorICAgICAgICogKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKKyAgICAgICAqIHwgICAgICAgICAgICAgICAgICBOZWlnaGJvciBMb2NhbCBDaXJjdWl0IElEIChJZiBrbm93bikgICAgICAgICB8IDQKKyAgICAgICAqICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCisgICAgICAgKi8KKyAgICAgICpmb3VuZCB8PSBUTFZGTEFHXzNXQVlfSEVMTE87CisgICAgICBpZiAoKmV4cGVjdGVkICYgVExWRkxBR18zV0FZX0hFTExPKSB7CisgICAgICAgIHdoaWxlIChsZW5ndGggPiB2YWx1ZV9sZW4pIHsKKyAgICAgICAgLyogRklYTUU6IG1ha2UgdGhpcyB3b3JrICovCisvKiAgICAgICAgICAgQWRqYWNlbmN5IFN0YXRlIChvbmUgb2N0ZXQpOgorICAgICAgICAgICAgICAwID0gVXAKKyAgICAgICAgICAgICAgMSA9IEluaXRpYWxpemluZworICAgICAgICAgICAgICAyID0gRG93bgorICAgICAgICAgICAgRXh0ZW5kZWQgTG9jYWwgQ2lyY3VpdCBJRCAoZm91ciBvY3RldHMpCisgICAgICAgICAgICBOZWlnaGJvciBTeXN0ZW0gSUQgaWYga25vd24gKHplcm8gdG8gZWlnaHQgb2N0ZXRzKQorICAgICAgICAgICAgTmVpZ2hib3IgRXh0ZW5kZWQgTG9jYWwgQ2lyY3VpdCBJRCAoZm91ciBvY3RldHMsIGlmIE5laWdoYm9yCisgICAgICAgICAgICAgIFN5c3RlbSBJRCBpcyBwcmVzZW50KSAqLworICAgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHBudCArPSBsZW5ndGg7CisgICAgICB9CisKKyAgICAgIGJyZWFrOworCisgICAgZGVmYXVsdDoKKyAgICAgIHpsb2dfd2FybiAoIklTSVMtVExWICglcyk6IHVuc3VwcG9ydGVkIFRMViB0eXBlICVkLCBsZW5ndGggJWQiLAorCQkgYXJlYXRhZywKKwkJIHR5cGUsCisJCSBsZW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E1FUkNIQU5UQUJJTElUWSBvciAKKyAqIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgCisgKiBtb3JlIGRldGFpbHMuCisgKgorICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcgCisgKiB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuLCAKKyAqIDU5IFRlbXBsZSBQbGFjZSAtIFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNywgVVNBLgorICovCisKKyNpZm5kZWYgX1pFQlJBX0lTSVNfVExWX0gKKyNkZWZpbmUgX1pFQlJBX0lTSVNfVExWX0gKKworLyoKKyAqIFN0cnVjdHVyZXMgZm91bmQgaW4gVExWJ3MuCisgKiB0aGlzIGhlYWRlciBpcyBmdWxseSBjb21wbGllbnQgd2l0aAorICogZHJhZnQtaWV0Zi1pc2lzLXdnLXRsdi1jb2RlcG9pbnRzLTAyLnR4dAorIDEuICBUTFYgQ29kZXBvaW50cyByZXNlcnZlZAorICAgICBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCisgICAgIE5hbWUgICAgICAgICAgICAgICAgIFZhbHVlICAgSUlIICAgTFNQICBTTlAgICBTdGF0dXMKKyAgICAgX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXworCisgICAgIEFyZWEgQWRkcmVzc2VzICAgICAgICAgICAgMSAgeSAgICAgeSAgICBuICBJU08gMTA1ODkKKyAgICAgSUlTIE5laWdoYm9ycyAgICAgICAgICAgICAyICBuICAgICB5ICAgIG4gIElTTyAxMDU4OQorICAgICBFUyBOZWlnaGJvcnMgICAgICAgICAgICAgIDMgIG4gICAgIHkgICAgbiAgSVNPIDEwNTg5CisgICAgIFBhcnQuIERJUyAgICAgICAgICAgICAgICAgNCAgbiAgICAgeSAgICBuICBJU08gMTA1ODkKKyAgICAgUHJlZml4IE5laWdoYm9ycyAgICAgICAgICA1ICBuICAgICB5ICAgIG4gIElTTyAxMDU4OQorICAgICBJSVMgTmVpZ2hib3JzICAgICAgICAgICAgIDYgIHkgICAgIG4gICAgbiAgSVNPIDEwNTg5CisgICAgIFBhZGRpbmcgICAgICAgICAgICAgICAgICAgOCAgeSAgICAgbiAgICBuICBJU08gMTA1ODkKKyAgICAgTFNQIEVudHJpZXMgICAgICAgICAgICAgICA5ICBuICAgICBuICAgIHkgIElTTyAxMDU4OQorICAgICBBdXRoZW50aWNhdGlvbiAgICAgICAgICAgMTAgIHkgICAgIHkgICAgeSAgSVNPIDEwNTg5CisgICAgIE9wdC4gQ2hlY2tzdW0gICAgICAgICAgICAxMiAgeSAgICAgbiAgICB5ICBJRVRGLWRyYWZ0CisgICAgIExTUEJ1ZmZlclNpemUgICAgICAgICAgICAxNCAgbiAgICAgeSAgICBuICBJU08gMTA1ODkgUmV2IDIgRHJhZnQKKyAgICAgVEUgSUlTIE5laWdoLiAgICAgICAgICAgIDIyICBuICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgREVDbmV0IFBoYXNlIElWICAgICAgICAgIDQyICB5ICAgICBuICAgIG4gIERFQyAoYW5jaWVudCkKKyAgICAgSVAgSW50LiBSZWFjaCAgICAgICAgICAgMTI4ICBuICAgICB5ICAgIG4gIFJGQyAxMTk1CisgICAgIFByb3QuIFN1cHBvcnRlZCAgICAgICAgIDEyOSAgeSAgICAgeSAgICBuICBSRkMgMTE5NQorICAgICBJUCBFeHQuIEFkZHJlc3MgICAgICAgICAxMzAgIG4gICAgIHkgICAgbiAgUkZDIDExOTUKKyAgICAgSURSUEkgICAgICAgICAgICAgICAgICAgMTMxICBuICAgICB5ICAgIHkgIFJGQyAxMTk1CisgICAgIElQIEludGYuIEFkZHJlc3MgICAgICAgIDEzMiAgeSAgICAgeSAgICBuICBSRkMgMTE5NQorICAgICBJbGxlZ2FsICAgICAgICAgICAgICAgICAxMzMgIG4gICAgIG4gICAgbiAgUkZDIDExOTUgKG5vdCB1c2VkKQorICAgICBSb3V0ZXIgSUQgICAgICAgICAgICAgICAxMzQgIG4gICAgIHkgICAgbiAgSUVURi1kcmFmdAorICAgICBURSBJUC4gUmVhY2ggICAgICAgICAgICAxMzUgIG4gICAgIHkgICAgbiAgSUVURi1kcmFmdAorICAgICBEeW5hbWljIE5hbWUgICAgICAgICAgICAxMzcgIG4gICAgIHkgICAgbiAgUkZDIDI3NjMKKyAgICAgTm9ydGVsIFByb3ByaWV0YXJ5ICAgICAgMTc2ICBuICAgICB5ICAgIG4KKyAgICAgTm9ydGVsIFByb3ByaWV0YXJ5ICAgICAgMTc3ICBuICAgICB5ICAgIG4KKyAgICAgUmVzdGFydCBUTFYgICAgICAgICAgICAgMjExICB5ICAgICBuICAgIG4gIElFVEYtZHJhZnQKKyAgICAgTVQtSVNOICAgICAgICAgICAgICAgICAgMjIyICBuICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgTS1Ub3BvbG9naWVzICAgICAgICAgICAgMjI5ICB5ICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgSVB2NiBJbnRmLiBBZGRyLiAgICAgICAgMjMyICB5ICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgTVQgSVAuIFJlYWNoICAgICAgICAgICAgMjM1ICBuICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgSVB2NiBJUC4gUmVhY2ggICAgICAgICAgMjM2ICBuICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgTVQgSVB2NiBJUC4gUmVhY2ggICAgICAgMjM3ICBuICAgICB5ICAgIG4gIElFVEYtZHJhZnQKKyAgICAgUDJQIEFkamFjZW5jeSBTdGF0ZSAgICAgMjQwICB5ICAgICBuICAgIG4gIElFVEYtZHJhZnQKKworICovCisKKyNkZWZpbmUgQVJFQV9BRERSRVNTRVMgICAgICAgICAgICAxCisjZGVmaW5lIElTX05FSUdIQk9VUlMgICAgICAgICAgICAgMgorI2RlZmluZSBFU19ORUlHSEJPVVJTICAgICAgICAgICAgIDMKKyNkZWZpbmUgUEFSVElUSU9OX0RFU0lHX0xFVkVMMl9JUyA0CisjZGVmaW5lIFBSRUZJWF9ORUlHSEJPVVJTICAgICAgICAgNQorI2RlZmluZSBMQU5fTkVJR0hCT1VSUyAgICAgICAgICAgIDYKKyNkZWZpbmUgUEFERElORyAgICAgICAgICAgICAgICAgICA4CisjZGVmaW5lIExTUF9FTlRSSUVTICAgICAgICAgICAgICAgOQorI2RlZmluZSBBVVRIX0lORk8gICAgICAgICAgICAgICAgIDEwCisjZGVmaW5lIENIRUNLU1VNICAgICAgICAgICAgICAgICAgMTIKKyNkZWZpbmUgVEVfSVNfTkVJR0hCT1VSUyAgICAgICAgICAyMgorI2RlZmluZSBJUFY0X0lOVF9SRUFDSEFCSUxJVFkgICAgIDEyOAorI2RlZmluZSBJUFY0X0VYVF9SRUFDSEFCSUxJVFkgICAgIDEzMAorI2RlZmluZSBQUk9UT0NPTFNfU1VQUE9SVEVEICAgICAgIDEyOQorI2RlZmluZSBJRFJQX0lORk8gICAgICAgICAgICAgICAgIDEzMQorI2RlZmluZSBJUFY0X0FERFIgICAgICAgICAgICAgICAgIDEzMgorI2RlZmluZSBURV9ST1VURVJfSUQgICAgICAgICAgICAgIDEzNAorI2RlZmluZSBURV9JUFY0X1JFQUNIQUJJTElUWSAgICAgIDEzNQorI2RlZmluZSBEWU5BTUlDX0hPU1ROQU1FICAgICAgICAgIDEzNworI2RlZmluZSBJUFY2X1JFQUNIQUJJTElUWSAgICAgICAgIDIzNgorI2RlZmluZSBJUFY2X0FERFIgICAgICAgICAgICAgICAgIDIzMgorI2RlZmluZSBXQVkzX0hFTExPICAgICAgICAgICAgICAgIDI0MAorCisjZGVmaW5lIElTX05FSUdIQk9VUlNfTEVOIChJU0lTX1NZU19JRF9MRU4gKyA1KQorI2RlZmluZSBMQU5fTkVJR0hCT1VSU19MRU4gNgorI2RlZmluZSBMU1BfRU5UUklFU19MRU4gKDEwICsgSVNJU19TWVNfSURfTEVOKSAvKiBGSVhNRTogc2hvdWxkIGJlIGVudHJ5ICovCisjZGVmaW5lIElQVjRfUkVBQ0hfTEVOIDEyCisjZGVmaW5lIElQVjZfUkVBQ0hfTEVOIDIyCisKKy8qIHN0cnVjdCBmb3IgbmVpZ2hib3IgKi8KK3N0cnVjdCBpc19uZWlnaHsKKyAgc3RydWN0IG1ldHJpYyAgICAgICAgICAgICAgICAgICAgICAgIG1ldHJpY3M7CisgIHVfY2hhciAgICAgICAgIG5laWdoX2lkW0lTSVNfU1lTX0lEX0xFTiArIDFdOworfTsKKworLyogc3RydWN0IGZvciB0ZSBpcyBuZWlnaGJvciAqLworc3RydWN0IHRlX2lzX25laWdoeworICB1X2NoYXIgICAgICAgICBuZWlnaF9pZFtJU0lTX1NZU19JRF9MRU4gKyAxXTsKKyAgdV9jaGFyICAgICAgICAgICAgICAgICAgICAgICAgICB0ZV9tZXRyaWNbM107CisgIHVfY2hhciAgICAgICAgICAgICAgICAgICAgICAgc3ViX3RsdnNfbGVuZ3RoOworfTsKKworLyogc3RydWN0IGZvciBlcyBuZWlnaGJvcnMgKi8KK3N0cnVjdCBlc19uZWlnaHsKKyAgc3RydWN0IG1ldHJpYyAgICAgICAgICAgICAgICAgICAgICAgIG1ldHJpY3M7CisgIC8qIGFwcHJveGltYXRlIHBvc2l0aW9uIG9mIGZpcnN0LCB3ZSB1c2UgdGhlCisgICAqIGxlbmd0aCAoKHVjaGFyKiltZXRyaWMtMSkgdG8ga25vdyBhbGwgICAgICovCisgIHVfY2hhciAgICAgICBmaXJzdF9lc19uZWlnaFtJU0lTX1NZU19JRF9MRU5dOyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKK307CisKK3N0cnVjdCBwYXJ0aXRpb25fZGVzaWdfbGV2ZWwyX2lzeworICBzdHJ1Y3QgbGlzdCAgICAgICAgICAgICAgICAgKmlzaXNfc3lzdGVtX2lkczsKK307CisKKy8qIHN0cnVjdCBmb3IgbGFuIG5laWdoYm9ycyAqLworc3RydWN0IGxhbl9uZWlnaHsKKyAgdV9jaGFyICAgICAgICAgICAgIExBTl9hZGRyWzZdOworfTsKKworLyogc3RydWN0IGZvciBMU1AgZW50cnkgKi8KK3N0cnVjdCBsc3BfZW50cnkgeworICB1X2ludDE2X3QgICAgICAgICAgICAgICAgICByZW1fbGlmZXRpbWU7CisgIHVfY2hhciAgICAgIGxzcF9pZFtJU0lTX1NZU19JRF9MRU4gKyAyXTsKKyAgdV9pbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICBzZXFfbnVtOworICB1X2ludDE2X3QgICAgICAgICAgICAgICAgICAgICAgY2hlY2tzdW07Cit9IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpOworCisvKiBzdHJ1Y3QgZm9yIGNoZWNrc3VtICovCitzdHJ1Y3QgY2hlY2tzdW0geworICB1X2ludDE2X3QgY2hlY2tzdW07Cit9OworCisvKiBpcHY0IHJlYWNoYWJpbGl0eSAqLworc3RydWN0IGlwdjRfcmVhY2hhYmlsaXR5IHsKKyAgc3RydWN0IG1ldHJpYyBtZXRyaWNzOworICBzdHJ1Y3QgaW5fYWRkciBwcmVmaXg7CisgIHN0cnVjdCBpbl9hZGRyICAgbWFzazsKK307CisKKy8qIHRlIHJvdXRlciBpZCAqLworc3RydWN0IHRlX3JvdXRlcl9pZCB7CisgIHN0cnVjdCBpbl9hZGRyICAgICBpZDsKK307CisKKy8qIHRlIGlwdjQgcmVhY2hhYmlsaXR5ICovCitzdHJ1Y3QgdGVfaXB2NF9yZWFjaGFiaWxpdHkgeworICB1X2ludDMyX3QgICAgdGVfbWV0cmljOworICB1X2NoYXIgICAgICAgICBjb250cm9sOworICB1X2NoYXIgICAgcHJlZml4X3N0YXJ0OyAvKiBzaW5jZSB0aGlzIGlzIHZhcmlhYmxlIGxlbmd0aCBieSBuYXR1cmUgaXQgb25seSAqLworfTsJCQkgIC8qIHBvaW50cyB0byBhbiBhcHByb3hpbWF0ZSBsb2NhdGlvbiAqLyAKKworCisKK3N0cnVjdCBpZHJwX2luZm8geworICB1X2NoYXIgbGVuOworICB1X2NoYXIgKnZhbHVlOworfTsKKworI2lmZGVmIEhBVkVfSVBWNgorc3RydWN0IGlwdjZfcmVhY2hhYmlsaXR5IHsKKyAgdV9pbnQzMl90ICAgICAgICAgIG1ldHJpYzsKKyAgdV9jaGFyICAgICAgICAgICAgIGNvbnRyb2xfaW5mbzsgCisgIHVfY2hhciAgICAgICAgICAgICBwcmVmaXhfbGVuOworICB1X2NoYXIgICAgICAgICAgICAgcHJlZml4WzE2XTsKK307CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCisKKy8qIGJpdHMgaW4gY29udHJvbF9pbmZvICovCisjZGVmaW5lIENUUkxfSU5GT19ESVJFQ1RJT04gICAgMHg4MAorI2RlZmluZSBESVJFQ1RJT05fVVAgICAgICAgICAgIDAKKyNkZWZpbmUgRElSRUNUSU9OX0RPV04gICAgICAgICAxCisjZGVmaW5lIENUUkxfSU5GT19ESVNUUklCVVRJT04gMHg0MAorI2RlZmluZSBESVNUUklCVVRJT05fSU5URVJOQUwgIDAKKyNkZWZpbmUgRElTVFJJQlVUSU9OX0VYVEVSTkFMICAxCisjZGVmaW5lIENUUkxfSU5GT19TVUJUTFZTICAgICAgMHgyMAorCisvKgorICogUG9pbnRlciB0byBlYWNoIHRsdiB0eXBlLCBmaWxsZWQgYnkgcGFyc2VfdGx2cygpCisgKi8KK3N0cnVjdCB0bHZzIHsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAqYXJlYV9hZGRyczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmlzX25laWdoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgKnRlX2lzX25laWdoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmVzX25laWdoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICpsc3BfZW50cmllczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAqcHJlZml4X25laWdoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAqbGFuX25laWdoczsKKyAgc3RydWN0IGNoZWNrc3VtICAgICAgICAgICAgICAgICAgICAgICAgICpjaGVja3N1bTsKKyAgc3RydWN0IG5scGlkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKm5scGlkczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAqaXB2NF9hZGRyczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgKmlwdjRfaW50X3JlYWNoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgKmlwdjRfZXh0X3JlYWNoczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICp0ZV9pcHY0X3JlYWNoczsKKyAgc3RydWN0IGhvc3RuYW1lICAgICAgICAgICAgICAgICAgICAgICAgICpob3N0bmFtZTsKKyAgc3RydWN0IHRlX3JvdXRlcl9pZCAgICAgICAgICAgICAgICAgICAgKnJvdXRlcl9pZDsKKyNpZmRlZiBIQVZFX0lQVjYKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAqaXB2Nl9hZGRyczsKKyAgc3RydWN0IGxpc3QgICAgICAgICAgICAgICAgICAgICAgICAgICppcHY2X3JlYWNoczsKKyNlbmRpZgorICBzdHJ1Y3QgaXNpc19wYXNzd2QgICAgICAgICAgICAgICAgICAgICAgYXV0aF9pbmZvOworfTsKKworLyoKKyAqIE93biBkZWZpbml0aW9ucyAtIHVzZWQgdG8gYml0bWFzayBmb3VuZCBhbmQgZXhwZWN0ZWQKKyAqLworCisjZGVmaW5lIFRMVkZMQUdfQVJFQV9BRERSUyAgICAgICAgICAgICAgICAoMTw8MCkKKyNkZWZpbmUgVExWRkxBR19JU19ORUlHSFMgICAgICAgICAgICAgICAgICgxPDwxKQorI2RlZmluZSBUTFZGTEFHX0VTX05FSUdIUyAgICAgICAgICAgICAgICAgKDE8PDIpCisjZGVmaW5lIFRMVkZMQUdfUEFSVElUSU9OX0RFU0lHX0xFVkVMMl9JUyAoMTw8MykKKyNkZWZpbmUgVExWRkxBR19QUkVGSVhfTkVJR0hTICAgICAgICAgICAgICgxPDw0KQorI2RlZmluZSBUTFZGTEFHX0xBTl9ORUlHSFMgICAgICAgICAgICAgICAgKDE8PDUpCisjZGVmaW5lIFRMVkZMQUdfTFNQX0VOVFJJRVMgICAgICAgICAgICAgICAoMTw8NikKKyNkZWZpbmUgVExWRkxBR19QQURESU5HICAgICAgICAgICAgICAgICAgICgxPDw3KQorI2RlZmluZSBUTFZGTEFHX0FVVEhfSU5GTyAgICAgICAgICAgICAgICAgKDE8PDgpCisjZGVmaW5lIFRMVkZMQUdfSVBWNF9JTlRfUkVBQ0hBQklMSVRZICAgICAoMTw8OSkKKyNkZWZpbmUgVExWRkxBR19OTFBJRCAgICAgICAgICAgICAgICAgICAgICgxPDwxMCkKKyNkZWZpbmUgVExWRkxBR19JUFY0X0VYVF9SRUFDSEFCSUxJVFkgICAgICgxPDwxMSkKKyNkZWZpbmUgVExWRkxBR19JUFY0X0FERFIgICAgICAgICAgICAgICAgICgxPDwxMikKKyNkZWZpbmUgVExWRkxBR19EWU5fSE9TVE5BTUUgICAgICAgICAgICAgICgxPDwxMykKKyNkZWZpbmUgVExWRkxBR19JUFY2X0FERFIgICAgICAgICAgICAgICAgICgxPDwxNCkKKyNkZWZpbmUgVExWR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PQyAoTVRZUEVfSVNJU19UTVAsIHNpemUpOworICBpZiAoIW5leHRob3BfbGlzdCkgeworICAgIHpsb2dfZXJyICgiaXNpc196ZWJyYV9hZGRfcm91dGVfaXB2Njogb3V0IG9mIG1lbW9yeSEiKTsKKyAgICByZXR1cm47CisgIH0KKyAgCisgIC8qIGFsbG9jYXRlIG1lbW9yeSBmb3IgaWZpbmRleF9saXN0ICovCisgIHNpemUgPSBzaXplb2YgKHVuc2lnbmVkIGludCkgKiBsaXN0Y291bnQgKHJvdXRlX2luZm8tPm5leHRob3BzNik7CisgIGlmaW5kZXhfbGlzdCA9ICh1bnNpZ25lZCBpbnQgKikgWE1BTExPQyAoTVRZUEVfSVNJU19UTVAsIHNpemUpOworICBpZiAoIWlmaW5kZXhfbGlzdCkgeworICAgIHpsb2dfZXJyICgiaXNpc196ZWJyYV9hZGRfcm91dGVfaXB2Njogb3V0IG9mIG1lbW9yeSEiKTsKKyAgICBYRlJFRSAoTVRZUEVfSVNJU19UTVAsIG5leHRob3BfbGlzdCk7CisgICAgcmV0dXJuOworICB9CisgIAorICAvKiBmb3IgZWFjaCBuZXh0aG9wICovCisgIGkgPSAwOworICBmb3IgKG5vZGUgPSBsaXN0aGVhZCAocm91dGVfaW5mby0+bmV4dGhvcHM2KTsgbm9kZTsgbmV4dG5vZGUgKG5vZGUpKSB7CisgICAgbmV4dGhvcDYgPSBnZXRkYXRhIChub2RlKTsKKyAgICAKKyAgICBpZiAoIUlONl9JU19BRERSX0xJTktMT0NBTCAoJm5leHRob3A2LT5pcDYpICYmCisgICAgICAgICFJTjZfSVNfQUREUl9VTlNQRUNJRklFRCAoJm5leHRob3A2LT5pcDYpKSB7CisgICAgICBhcGkubmV4dGhvcF9udW0tLTsKKyAgICAgIGFwaS5pZmluZGV4X251bS0tOworICAgICAgY29udGludWU7CisgICAgfQorICAgIAorICAgIG5leHRob3BfbGlzdFtpXSA9ICZuZXh0aG9wNi0+aXA2OworICAgIGlmaW5kZXhfbGlzdFtp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fQorCisKKy8qCisgKiAnc2hvdyBjbG5zIG5laWdoYm9ycycgY29tbWFuZAorICovCisKK2ludAorc2hvd19jbG5zX25laWdoIChzdHJ1Y3QgdnR5ICp2dHksIGNoYXIgZGV0YWlsKSAKK3sKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlX2FyZWEsICpub2RlX2NpcmM7CisgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgIHN0cnVjdCBpc2lzX2NpcmN1aXQgKmNpcmN1aXQ7CisgIHN0cnVjdCBsaXN0ICpkYjsKKyAgaW50IGk7CisKKyAgaWYgKCFpc2lzKSB7CisgICAgdnR5X291dCAodnR5LCAiSVMtSVMgUm91dGluZyBQcm9jZXNzIG5vdCBlbmFibGVkJXMiLCBWVFlfTkVXTElORSk7CisgICAgcmV0dXJuIENNRF9TVUNDRVNTOworICB9CisKKyAgZm9yIChub2RlX2FyZWEgPSBsaXN0aGVhZCAoaXNpcy0+YXJlYV9saXN0KTsgbm9kZV9hcmVhOworICAgICAgIG5leHRub2RlIChub2RlX2FyZWEpKSB7CisgICAgYXJlYSA9IGdldGRhdGEgKG5vZGVfYXJlYSk7CisgICAgdnR5X291dCAodnR5LCAiQXJlYSAlczolcyIsIGFyZWEtPmFyZWFfdGFnLCBWVFlfTkVXTElORSk7CisKKyAgICBpZiAoZGV0YWlsPT1JU0lTX1VJX0xFVkVMX0JSSUVGKQorICAgICAgdnR5X291dCAodnR5LCAiICBTeXN0ZW0gSWQgICAgICAgICAgIEludGVyZmFjZSAgIEwgIFN0YXRlICAgICAgICAiCisgICAgICAgICAgICAgICAiSG9sZHRpbWUgU05QQSVzIiwgVlRZX05FV0xJTkUpOworCisgICAgZm9yIChub2RlX2NpcmMgPSBsaXN0aGVhZCAoYXJlYS0+Y2lyY3VpdF9saXN0KTsgbm9kZV9jaXJjOworICAgICAgICAgbmV4dG5vZGUgKG5vZGVfY2lyYykpIHsKKyAgICAgIGNpcmN1aXQgPSBnZXRkYXRhIChub2RlX2NpcmMpOyAgICAgIAorICAgICAgaWYgKGNpcmN1aXQtPmNpcmNfdHlwZSA9PSBDSVJDVUlUX1RfQlJPQURDQVNUKSB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspIHsKKyAgICAgICAgICBkYiA9IGNpcmN1aXQtPnUuYmMuYWRqZGJbaV07CisgICAgICAgICAgaWYgKGRiICYmIGRiLT5jb3VudCkgeworICAgICAgICAgICAgaWYgKGRldGFpbCA9PSBJU0lTX1VJX0xFVkVMX0JSSUVGKQorICAgICAgICAgICAgICBpc2lzX2FkamRiX2l0ZXJhdGUgKGRiLCAodm9pZCAoKikgKHN0cnVjdCBpc2lzX2FkamFjZW5jeSAqLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICopKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzaXNfYWRqX3ByaW50X3Z0eSwgdnR5KTsJICAKKyAgICAgICAgICAgIGlmIChkZXRhaWwgPT0gSVNJU19VSV9MRVZFTF9ERVRBSUwpCisgICAgICAgICAgICAgIGlzaXNfYWRqZGJfaXRlcmF0ZSAoZGIsICh2b2lkICgqKSAoc3RydWN0IGlzaXNfYWRqYWNlbmN5ICosIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNpc19hZGpfcHJpbnRfdnR5X2RldGFpbCwgdnR5KTsJICAKKyAgICAgICAgICAgIGlmIChkZXRhaWwgPT0gSVNJU19VSV9MRVZFTF9FWFRFTlNJVkUpCisgICAgICAgICAgICAgIGlzaXNfYWRqZGJfaXRlcmF0ZSAoZGIsICh2b2lkICgqKSAoc3RydWN0IGlzaXNfYWRqYWNlbmN5ICosIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICopKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc2lzX2Fkal9wcmludF92dHlfZXh0ZW5zaXZlLCB2dHkpOwkgIAorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfSBlbHNlIGlmIChjaXJjdWl0LT5jaXJjX3R5cGUgPT0gQ0lSQ1VJVF9UX1AyUCAmJiAKKyAgICAgICAgICAgICAgICAgY2lyY3VpdC0+dS5wMnAubmVpZ2hib3IpIHsKKyAgICAgICAgaWYgKGRldGFpbD09SVNJU19VSV9MRVZFTF9CUklFRikKKwkgIGlzaXNfYWRqX3AycF9wcmludF92dHkgKGNpcmN1aXQtPnUucDJwLm5laWdoYm9yLCB2dHkpOworCWlmIChkZXRhaWw9PUlTSVNfVUlfTEVWRUxfREVUQUlMKQorICAgICAgICAgIGlzaXNfYWRqX3AycF9wcmludF92dHlfZGV0YWlsIChjaXJjdWl0LT51LnAycC5uZWlnaGJvciwgdnR5KTsKKyAgICAgICAgaWYgKGRldGFpbD09SVNJU19VSV9MRVZFTF9FWFRFTlNJVkUpCisgICAgICAgICAgaXNpc19hZGpfcDJwX3ByaW50X3Z0eV9leHRlbnNpdmUgKGNpcmN1aXQtPnUucDJwLm5laWdoYm9yLCB2dHkpOworICAgICAgfSAgICAgCisgICAgfQorICB9CisgIAorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChzaG93X2NsbnNfbmVpZ2hib3JzLAorICAgICAgIHNob3dfY2xuc19uZWlnaGJvcnNfY21kLAorICAgICAgICJzaG93IGNsbnMgbmVpZ2hib3JzIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJjbG5zIG5ldHdvcmsgaW5mb3JtYXRpb25cbiIKKyAgICAgICAiQ0xOUyBuZWlnaGJvciBhZGphY2VuY2llc1xuIikKK3sKKyAgcmV0dXJuIHNob3dfY2xuc19uZWlnaCh2dHksIElTSVNfVUlfTEVWRUxfQlJJRUYpOworfQorCitBTElBUyAoc2hvd19jbG5zX25laWdoYm9ycywKKyAgICAgICBzaG93X2lzaXNfbmVpZ2hib3JzX2NtZCwKKyAgICAgICAic2hvdyBpc2lzIG5laWdoYm9ycyIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiSVMtSVMgbmV0d29yayBpbmZvcm1hdGlvblxuIgorICAgICAgICJJUy1JUyBuZWlnaGJvciBhZGphY2VuY2llc1xuIikKKworREVGVU4gKHNob3dfY2xuc19uZWlnaGJvcnNfZGV0YWlsLAorICAgICAgIHNob3dfY2xuc19uZWlnaGJvcnNfZGV0YWlsX2NtZCwKKyAgICAgICAic2hvdyBjbG5zIG5laWdoYm9ycyBkZXRhaWwiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgImNsbnMgbmV0d29yayBpbmZvcm1hdGlvblxuIgorICAgICAgICJDTE5TIG5laWdoYm9yIGFkamFjZW5jaWVzXG4iCisgICAgICAgInNob3cgZGV0YWlsZWQgaW5mb3JtYXRpb25cbiIpCit7CisgIHJldHVybiBzaG93X2NsbnNfbmVpZ2godnR5LCBJU0lTX1VJX0xFVkVMX0RFVEFJTCk7Cit9CisKK0FMSUFTIChzaG93X2NsbnNfbmVpZ2hib3JzX2RldGFpbCwKKyAgICAgICBzaG93X2lzaXNfbmVpZ2hib3JzX2RldGFpbF9jbWQsCisgICAgICAgInNob3cgaXNpcyBuZWlnaGJvcnMgZGV0YWlsIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJJUy1JUyBuZXR3b3JrIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIG5laWdoYm9yIGFkamFjZW5jaWVzXG4iCisgICAgICAgInNob3cgZGV0YWlsZWQgaW5mb3JtYXRpb25cbiIpCisKKy8qCisgKiAnaXNpcyBkZWJ1ZycsICdzaG93IGRlYnVnZ2luZycKKyAqLworCit2b2lkCitwcmludF9kZWJ1ZyAoc3RydWN0IHZ0eSAqdnR5LCBpbnQgZmxhZ3MsIGludCBvbm9mZikKK3sKKyAgY2hhciBvbm9mZnNbNF07CisgIGlmIChvbm9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BvcHRpb25cbiIpCit7CisgIHZ0eV9vdXQgKHZ0eSwiSVMtSVM6JXMiLCBWVFlfTkVXTElORSk7CisgIHByaW50X2RlYnVnICh2dHksIGlzaXMtPmRlYnVncywgMSk7CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKGRlYnVnX2lzaXNfYWRqLAorICAgICAgIGRlYnVnX2lzaXNfYWRqX2NtZCwKKyAgICAgICAiZGVidWcgaXNpcyBhZGotcGFja2V0cyIsCisgICAgICAgREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIEFkamFjZW5jeSByZWxhdGVkIHBhY2tldHNcbiIKKyAgICAgICApCit7CisgIGlzaXMtPmRlYnVncyB8PSBERUJVR19BREpfUEFDS0VUUzsKKyAgcHJpbnRfZGVidWcgKHZ0eSxERUJVR19BREpfUEFDS0VUUywxKTsKKworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChub19kZWJ1Z19pc2lzX2FkaiwKKyAgICAgICBub19kZWJ1Z19pc2lzX2Fkal9jbWQsCisgICAgICAgIm5vIGRlYnVnIGlzaXMgYWRqLXBhY2tldHMiLAorICAgICAgIFVOREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIEFkamFjZW5jeSByZWxhdGVkIHBhY2tldHNcbiIKKyAgICAgICApCit7CisKKyAgaXNpcy0+ZGVidWdzICY9IH5ERUJVR19BREpfUEFDS0VUUzsKKyAgcHJpbnRfZGVidWcgKHZ0eSwgREVCVUdfQURKX1BBQ0tFVFMsIDApOworCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworCitERUZVTiAoZGVidWdfaXNpc19jc3VtLAorICAgICAgIGRlYnVnX2lzaXNfY3N1bV9jbWQsCisgICAgICAgImRlYnVnIGlzaXMgY2hlY2tzdW0tZXJyb3JzIiwKKyAgICAgICBERUJVR19TVFIKKy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VHX1BST1RPQ09MX0VSUk9SUzsKKyAgcHJpbnRfZGVidWcgKHZ0eSwgREVCVUdfUFJPVE9DT0xfRVJST1JTLCAwKTsKKyAgCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKGRlYnVnX2lzaXNfc25wLAorICAgICAgIGRlYnVnX2lzaXNfc25wX2NtZCwKKyAgICAgICAiZGVidWcgaXNpcyBzbnAtcGFja2V0cyIsCisgICAgICAgREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIENTTlAvUFNOUCBwYWNrZXRzXG4iCisgICAgICAgKQoreworICBpc2lzLT5kZWJ1Z3MgfD0gREVCVUdfU05QX1BBQ0tFVFM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX1NOUF9QQUNLRVRTLCAxKTsKKworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChub19kZWJ1Z19pc2lzX3NucCwKKyAgICAgICBub19kZWJ1Z19pc2lzX3NucF9jbWQsCisgICAgICAgIm5vIGRlYnVnIGlzaXMgc25wLXBhY2tldHMiLAorICAgICAgIFVOREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIENTTlAvUFNOUCBwYWNrZXRzXG4iCisgICAgICAgKQoreworICBpc2lzLT5kZWJ1Z3MgJj0gfkRFQlVHX1NOUF9QQUNLRVRTIDsKKyAgcHJpbnRfZGVidWcgKHZ0eSwgREVCVUdfU05QX1BBQ0tFVFMsIDApOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisKKworREVGVU4gKGRlYnVnX2lzaXNfdXBkLAorICAgICAgIGRlYnVnX2lzaXNfdXBkX2NtZCwKKyAgICAgICAiZGVidWcgaXNpcyB1cGRhdGUtcGFja2V0cyIsCisgICAgICAgREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgIC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LAorICAgICAgIG5vX2RlYnVnX2lzaXNfc3BmZXZlbnRzX2NtZCwKKyAgICAgICAibm8gZGVidWcgaXNpcyBzcGYtZXZlbnRzIiwKKyAgICAgICBVTkRFQlVHX1NUUgorICAgICAgICJJUy1JUyBpbmZvcm1hdGlvblxuIgorICAgICAgICJJUy1JUyBTaG9ydGVzdCBQYXRoIEZpcnN0IEV2ZW50c1xuIgorICAgICAgICkKK3sKKyAgaXNpcy0+ZGVidWdzICY9IH5ERUJVR19TUEZfRVZFTlRTOworICBwcmludF9kZWJ1ZyAodnR5LCBERUJVR19TUEZfRVZFTlRTICwgMCk7CisgIAorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKKworREVGVU4gKGRlYnVnX2lzaXNfc3Bmc3RhdHMsCisgICAgICAgZGVidWdfaXNpc19zcGZzdGF0c19jbWQsCisgICAgICAgImRlYnVnIGlzaXMgc3BmLXN0YXRpc3RpY3MgIiwKKyAgICAgICBERUJVR19TVFIKKyAgICAgICAiSVMtSVMgaW5mb3JtYXRpb25cbiIKKyAgICAgICAiSVMtSVMgU1BGIFRpbWluZyBhbmQgU3RhdGlzdGljIERhdGFcbiIKKyAgICAgICApCit7CisgIGlzaXMtPmRlYnVncyB8PSBERUJVR19TUEZfU1RBVFM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX1NQRl9TVEFUUywgMSk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fZGVidWdfaXNpc19zcGZzdGF0cywKKyAgICAgICBub19kZWJ1Z19pc2lzX3NwZnN0YXRzX2NtZCwKKyAgICAgICAibm8gZGVidWcgaXNpcyBzcGYtc3RhdGlzdGljcyIsCisgICAgICAgVU5ERUJVR19TVFIKKyAgICAgICAiSVMtSVMgaW5mb3JtYXRpb25cbiIKKyAgICAgICAiSVMtSVMgU1BGIFRpbWluZyBhbmQgU3RhdGlzdGljIERhdGFcbiIKKyAgICAgICApCit7CisgIGlzaXMtPmRlYnVncyAmPSB+REVCVUdfU1BGX1NUQVRTOworICBwcmludF9kZWJ1ZyAodnR5LCBERUJVR19TUEZfU1RBVFMsIDApOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoZGVidWdfaXNpc19zcGZ0cmlnZywKKyAgICAgICBkZWJ1Z19pc2lzX3NwZnRyaWdnX2NtZCwKKyAgICAgICAiZGVidWcgaXNpcyBzcGYtdHJpZ2dlcnMiLAorICAgICAgIERFQlVHX1NUUgorICAgICAgICJJUy1JUyBpbmZvcm1hdGlvblxuIgorICAgICAgICJJUy1JUyBTUEYgdHJpZ2dlcmluZyBldmVudHNcbiIKKyAgICAgICApCit7CisgIGlzaXMtPmRlYnVncyB8PSBERUJVR19TUEZfVFJJR0dFUlM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX1NQRl9UUklHR0VSUywgMSk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fZGVidWdfaXNpc19zcGZ0cmlnZywKKyAgICAgICBub19kZWJ1Z19pc2lzX3NwZnRyaWdnX2NtZCwKKyAgICAgICAibm8gZGVidWcgaXNpcyBzcGYtdHJpZ2dlcnMiLAorICAgICAgIFVOREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIFNQRiB0cmlnZ2VyaW5nIGV2ZW50c1xuIgorICAgICAgICkKK3sKKyAgaXNpcy0+ZGVidWdzICY9IH5ERUJVR19TUEZfVFJJR0dFUlM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX1NQRl9UUklHR0VSUywgMCk7CisgIAorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChkZWJ1Z19pc2lzX3J0ZXZlbnRzLAorICAgICAgIGRlYnVnX2lzaXNfcnRldmVudHNfY21kLAorICAgICAgICJkZWJ1ZyBpc2lzIHJvdXRlLWV2ZW50cyIsCisgICAgICAgREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIFJvdXRlIHJlbGF0ZWQgZXZlbnRzXG4iCisgICAgICAgKQoreworICBpc2lzLT5kZWJ1Z3MgfD0gREVCVUdfUlRFX0VWRU5UUzsKKyAgcHJpbnRfZGVidWcgKHZ0eSwgREVCVUdfUlRFX0VWRU5UUywgMSk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fZGVidWdfaXNpc19ydGV2ZW50cywKKyAgICAgICBub19kZWJ1Z19pc2lzX3J0ZXZlbnRzX2NtZCwKKyAgICAgICAibm8gZGVidWcgaXNpcyByb3V0ZS1ldmVudHMiLAorICAgICAgIFVOREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTIFJvdXRlIHJlbGF0ZWQgZXZlbnRzXG4iCisgICAgICAgKQoreworICBpc2lzLT5kZWJ1Z3MgJj0gfkRFQlVHX1JURV9FVkVOVFM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX1JURV9FVkVOVFMsIDApOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoZGVidWdfaXNpc19ldmVudHMsCisgICAgICAgZGVidWdfaXNpc19ldmVudHNfY21kLAorICAgICAgICJkZWJ1ZyBpc2lzIGV2ZW50cyIsCisgICAgICAgREVCVUdfU1RSCisgICAgICAgIklTLUlTIGluZm9ybWF0aW9uXG4iCisgICAgICAgIklTLUlTICBFdmVudHNcbiIKKyAgICAgICApCit7CisgIGlzaXMtPmRlYnVncyB8PSBERUJVR19FVkVOVFM7CisgIHByaW50X2RlYnVnICh2dHksIERFQlVHX0VWRU5UUywgMSk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fZGVidWdfaXNpc19ldmVudHMsCisgICAgICAgbm9fZGVidWdfaXNpc19ldmVudHNfY21kLAorICAgICAgICJubyBkZWJ1Z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HN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgIGludCBsZXZlbCwgbHNwX2NvdW50OworCisgIGlmIChpc2lzLT5hcmVhX2xpc3QtPmNvdW50ID09IDApCisgICAgcmV0dXJuIENNRF9TVUNDRVNTOworCisgIGZvciAobm9kZSA9IGxpc3RoZWFkIChpc2lzLT5hcmVhX2xpc3QpOyBub2RlOyBuZXh0bm9kZSAobm9kZSkpIHsKKyAgICBhcmVhID0gZ2V0ZGF0YSAobm9kZSk7CisgICAgdnR5X291dCAodnR5LCAiQXJlYSAlczolcyIsIGFyZWEtPmFyZWFfdGFnID8gYXJlYS0+YXJlYV90YWcgOiAibnVsbCIsCisgICAgICAgICAgICAgVlRZX05FV0xJTkUpOworICAgIGZvciAobGV2ZWw9MDtsZXZlbDxJU0lTX0xFVkVMUztsZXZlbCsrKSB7CisgICAgICBpZiAoYXJlYS0+bHNwZGJbbGV2ZWxdICYmIGRpY3RfY291bnQgKGFyZWEtPmxzcGRiW2xldmVsXSkgPiAwKSB7CisgICAgICAgIHZ0eV9vdXQgKHZ0eSwiSVMtSVMgTGV2ZWwtJWQgTGluayBTdGF0ZSBEYXRhYmFzZTolcyIsIGxldmVsKzEsIAorICAgICAgICAgICAgICAgICBWVFlfTkVXTElORSk7CisKKyAgICAgICAgbHNwX2NvdW50ID0gbHNwX3ByaW50X2FsbCAodnR5LCBhcmVhLT5sc3BkYltsZXZlbF0sCisJCQkJICAgSVNJU19VSV9MRVZFTF9ERVRBSUwsCisJCQkJICAgYXJlYS0+ZHluaG9zdG5hbWUpOworCisJdnR5X291dCAodnR5LCIlcyAgICAldSBMU1BzJXMlcyIsCisJCSBWVFlfTkVXTElORSwKKwkJIGxzcF9jb3VudCwKKwkJIFZUWV9ORVdMSU5FLAorCQkgVlRZX05FV0xJTkUpOworICAgICAgfQorICAgIH0KKyAgfQorCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworLyogCisgKiAncm91dGVyIGlzaXMnIGNvbW1hbmQgCisgKi8KK0RFRlVOIChyb3V0ZXJfaXNpcywKKyAgICAgICByb3V0ZXJfaXNpc19jbWQsCisgICAgICAgInJvdXRlciBpc2lzIFdPUkQiLAorICAgICAgICBST1VURVJfU1RSCisgICAgICAgIklTTyBJUy1JU1xuIgorICAgICAgICJJU08gUm91dGluZyBhcmVhIHRhZyIpCit7CisKKyAgcmV0dXJuIGlzaXNfYXJlYV9nZXQgKHZ0eSwgYXJndlswXSk7CisgIAorfQorCisvKiAKKyAqJ25vIHJvdXRlciBpc2lzJyBjb21tYW5kIAorICovCitERUZVTiAobm9fcm91dGVyX2lzaXMsCisgICAgICAgbm9fcm91dGVyX2lzaXNfY21kLAorICAgICAgICJubyByb3V0ZXIgaXNpcyBXT1JEIiwKKyAgICAgICAibm9cbiIKKyAgICAgICBST1VURVJfU1RSCisgICAgICAgIklTTyBJUy1JU1xuIgorICAgICAgICJJU08gUm91dGluZyBhcmVhIHRhZyIpCisKK3sKKyAgcmV0dXJuIGlzaXNfYXJlYV9kZXN0cm95ICh2dHksIGFyZ3ZbMF0pOworfQorCisvKgorICogJ25ldCcgY29tbWFuZAorICovCitERUZVTiAobmV0LAorICAgICAgIG5ldF9jbWQsCisgICAgICAgIm5ldCBXT1JEIiwKKyAgICAgICAiQSBOZXR3b3JrIEVudGl0eSBUaXRsZSBmb3IgdGhpcyBwcm9jZXNzIChPU0kgb25seSlcbiIKKyAgICAgICAiWFguWFhYWC4gLi4uIC5YWFguWFggIE5ldHdvcmsgZW50aXR5IHRpdGxlIChORVQpXG4iICkKK3sKKyAgcmV0dXJuIGFyZWFfbmV0X3RpdGxlICh2dHksIGFyZ3ZbMF0pOworfQorCisKKy8qCisgKiAnbm8gbmV0JyBjb21tYW5kCisgKi8KK0RFRlVOIChub19uZXQsCisgICAgICAgbm9fbmV0X2NtZCwKKyAgICAgICAibm8gbmV0IFdPUkQiLAorICAgICAgIE5PX1NUUgorICAgICAgICJBIE5ldHdvcmsgRW50aXR5IFRpdGxlIGZvciB0aG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fb3V0ICh2dHksICJUb28gbG9uZyBhcmVhIHBhc3N3b3JkICg+MjU0KSVzIiwgVlRZX05FV0xJTkUpOworICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgfQorICBhcmVhLT5kb21haW5fcGFzc3dkLmxlbiA9ICh1X2NoYXIpbGVuOworICBhcmVhLT5kb21haW5fcGFzc3dkLnR5cGUgPSBJU0lTX1BBU1NXRF9UWVBFX0NMRUFSVFhUOworICBzdHJuY3B5IChhcmVhLT5kb21haW5fcGFzc3dkLnBhc3N3ZCwgYXJndlswXSwgMjU1KTsKKyAgCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworCitERUZVTiAobm9fZG9tYWluX3Bhc3N3ZCwKKyAgICAgICBub19kb21haW5fcGFzc3dkX2NtZCwKKyAgICAgICAibm8gZG9tYWluLXBhc3N3b3JkIFdPUkQiLAorICAgICAgIE5PX1NUUgorICAgICAgICJTZXQgdGhlIGF1dGhlbnRpY2F0aW9uIHBhc3N3b3JkIGZvciBhIHJvdXRpbmcgZG9tYWluXG4iKQoreworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICAKKyAgYXJlYSA9IHZ0eS0+aW5kZXg7CisKKyAgaWYgKCFhcmVhKSB7CisgICAgdnR5X291dCAodnR5LCAiQ2FudCBmaW5kIElTLUlTIGluc3RhbmNlJXMiLCBWVFlfTkVXTElORSk7CisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisgIAorICBtZW1zZXQgKCZhcmVhLT5kb21haW5fcGFzc3dkLCAwLCBzaXplb2YgKHN0cnVjdCBpc2lzX3Bhc3N3ZCkpOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoaXNfdHlwZSwKKyAgICAgICBpc190eXBlX2NtZCwKKyAgICAgICAiaXMtdHlwZSAobGV2ZWwtMXxsZXZlbC0xLTJ8bGV2ZWwtMi1vbmx5KSIsCisgICAgICAgIklTIExldmVsIGZvciB0aGlzIHJvdXRpbmcgcH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W11bSBpbnRlcnZhbCBiZXR3ZWVuIHJlZ2VuZXJhdGluZyBzYW1lIExTUFxuIgorICAgICAgICJTZXQgaW50ZXJ2YWwgZm9yIGxldmVsIDEgb25seVxuIgorICAgICAgICJNaW5pbXVtIGludGVydmFsIGluIHNlY29uZHNcbiIKKyAgICAgICApCisKKworREVGVU4gKGxzcF9nZW5faW50ZXJ2YWxfbDIsCisgICAgICAgbHNwX2dlbl9pbnRlcnZhbF9sMl9jbWQsCisgICAgICAgImxzcC1nZW4taW50ZXJ2YWwgbGV2ZWwtMiA8MS0xMjA+IiwKKyAgICAgICAiTWluaW11bSBpbnRlcnZhbCBiZXR3ZWVuIHJlZ2VuZXJhdGluZyBzYW1lIExTUFxuIgorICAgICAgICJTZXQgaW50ZXJ2YWwgZm9yIGxldmVsIDIgb25seVxuIgorICAgICAgICJNaW5pbXVtIGludGVydmFsIGluIHNlY29uZHNcbiIKKyAgICAgICApCit7CisgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgIGludCBpbnRlcnZhbDsKKworICBhcmVhID0gdnR5LT5pbmRleDsKKyAgYXNzZXJ0IChhcmVhKTsKKyAgCisgIGludGVydmFsID0gYXRvaSAoYXJndlswXSk7CisgIGFyZWEtPmxzcF9nZW5faW50ZXJ2YWxbMV0gPSBpbnRlcnZhbDsKKworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChub19sc3BfZ2VuX2ludGVydmFsX2wyLAorICAgICAgIG5vX2xzcF9nZW5faW50ZXJ2YWxfbDJfY21kLAorICAgICAgICJubyBsc3AtZ2VuLWludGVydmFsIGxldmVsLTIiLAorICAgICAgIE5PX1NUUgorICAgICAgICJNaW5pbXVtIGludGVydmFsIGJldHdlZW4gcmVnZW5lcmF0aW5nIHNhbWUgTFNQXG4iCisgICAgICAgIlNldCBpbnRlcnZhbCBmb3IgbGV2ZWwgMiBvbmx5XG4iCisgICAgICAgKQoreworICBzdHJ1Y3QgaXNpc19hcmVhICph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xOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fZHluYW1pY19ob3N0bmFtZSwKKyAgICAgICBub19keW5hbWljX2hvc3RuYW1lX2NtZCwKKyAgICAgICAibm8gaG9zdG5hbWUgZHluYW1pYyIsCisgICAgICAgTk9fU1RSCisgICAgICAgIkR5bmFtaWMgaG9zdG5hbWUgZm9yIElTLUlTXG4iCisgICAgICAgIkR5bmFtaWMgaG9zdG5hbWVcbiIpIAoreworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworCisgIGFyZWEgPSB2dHktPmluZGV4OworICBhc3NlcnQgKGFyZWEpOworICAKKyAgYXJlYS0+ZHluaG9zdG5hbWUgPSAwOworICAKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoc3BmX2ludGVydmFsLAorICAgICAgIHNwZl9pbnRlcnZhbF9jbWQsCisgICAgICAgInNwZi1pbnRlcnZhbCA8MS0xMjA+IiwKKyAgICAgICAiTWluaW11bSBpbnRlcnZhbCBiZXR3ZWVuIFNQRiBjYWxjdWxhdGlvbnMiCisgICAgICAgIk1pbmltdW0gaW50ZXJ2YWwgYmV0d2VlbiBjb25zZWN1dGl2ZSBTUEZzIGluIHNlY29uZHNcbiIpCit7CisgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgIHVfaW50MTZfdCBpbnRlcnZhbDsKKyAgCisgIGFyZWEgPSB2dHktPmluZGV4OworICBpbnRlcnZhbCA9IGF0b2kgKGFyZ3ZbMF0pOworICBhcmVhLT5taW5fc3BmX2ludGVydmFsWzBdID0gaW50ZXJ2YWw7CisgIGFyZWEtPm1pbl9zcGZfaW50ZXJ2YWxbMV0gPSBpbnRlcnZhbDsKKyAgCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKG5vX3NwZl9pbnRlcnZhbCwKKyAgICAgICBub19zcGZfaW50ZXJ2YWxfY21kLAorICAgICAgICJubyBzcGYtaW50ZXJ2YW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ICAgYXJlYS0+dG9wb2xvZ3kgPSBsaXN0X25ldygpOworICAgIG1lbWNweShhcmVhLT50b3BfcGFyYW1zLHZ0eS0+YnVmLDIwMCk7CisgICAgZ2VuX3NwZ3JpZF90b3BvbG9neSAodnR5LCBhcmVhLT50b3BvbG9neSk7CisgICAgcmVtb3ZlX3RvcG9sb2d5X2xzcHMgKGFyZWEpOworICAgIGdlbmVyYXRlX3RvcG9sb2d5X2xzcHMgKGFyZWEpOworICB9CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoc2hvd19pc2lzX3RvcG9sb2d5LAorICAgICAgIHNob3dfaXNpc190b3BvbG9neV9jbWQsCisgICAgICAgInNob3cgaXNpcyB0b3BvbG9neSIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiY2xucyBuZXR3b3JrIGluZm9ybWF0aW9uXG4iCisgICAgICAgIkNMTlMgbmVpZ2hib3IgYWRqYWNlbmNpZXNcbiIpCit7CisgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgIHN0cnVjdCBsaXN0bm9kZSAqbm9kZTsKKyAgc3RydWN0IGxpc3Rub2RlICpub2RlMjsKKyAgc3RydWN0IGFyYyAqYXJjOworICBMSVNUX0xPT1AgKGlzaXMtPmFyZWFfbGlzdCwgYXJlYSwgbm9kZSkgeworICAgIGlmIChhcmVhLT50b3BvbG9neSkgeworICAgICAgdnR5X291dCAodnR5LCAiVG9wb2xvZ3kgZm9yIGlzaXMgYXJlYTolcyVzIixhcmVhLT5hcmVhX3RhZywgVlRZX05FV0xJTkUpOworICAgICAgTElTVF9MT09QIChhcmVhLT50b3BvbG9neSwgYXJjLCBub2RlMikgeworICAgICAgICB2dHlfb3V0ICh2dHksICJhICAlbGQgICAlbGQgICAlbGQlcyIsYXJjLT5mcm9tX25vZGUsIGFyYy0+dG9fbm9kZSwgCisJCSBhcmMtPmRpc3RhbmNlLCBWVFlfTkVXTElORSk7CisgICAgICB9CisgICAgfQorICB9CisgIH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aXNpc19hcmVhICphcmVhOworCisgIGFyZWEgPSB2dHktPmluZGV4OworICBhc3NlcnQgKGFyZWEpOworCisgIG1lbWNweShhcmVhLT50b3BvbG9neV9iYXNlaXMsIERFRkFVTFRfVE9QT0xPR1lfQkFTRUlTLCBJU0lTX1NZU19JRF9MRU4pOworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKKyNlbmRpZiAvKiBUT1BPTE9HWV9HRU5FUkFURSAqLworCitERUZVTiAobHNwX2xpZmV0aW1lLAorICAgICAgIGxzcF9saWZldGltZV9jbWQsCisgICAgICAgImxzcC1saWZldGltZSA8MzgwLTY1NTM1PiIsCisgICAgICAgIk1heGltdW0gTFNQIGxpZmV0aW1lXG4iCisgICAgICAgIkxTUCBsaWZldGltZSBpbiBzZWNvbmRzXG4iCisgICAgICAgKQoreworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICB1aW50MTZfdCBpbnRlcnZhbDsKKworICBhcmVhID0gdnR5LT5pbmRleDsKKyAgYXNzZXJ0IChhcmVhKTsKKyAgCisgIGludGVydmFsID0gYXRvaSAoYXJndlswXSk7CisKKyAgaWYgKGludGVydmFsIDwgSVNJU19NSU5fTFNQX0xJRkVUSU1FKSB7CisgICAgdnR5X291dCAodnR5LCAiTFNQIGxpZmV0aW1lICgldXMpIGJlbG93ICV1cyVzIiwKKwkgICAgIGludGVydmFsLAorCSAgICAgSVNJU19NSU5fTFNQX0xJRkVUSU1FLAorCSAgICAgVlRZX05FV0xJTkUpOworCisgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICB9CisKKworICBhcmVhLT5tYXhfbHNwX2xpZmV0aW1lWzBdID0gaW50ZXJ2YWw7CisgIGFyZWEtPm1heF9sc3BfbGlmZXRpbWVbMV0gPSBpbnRlcnZhbDsKKyAgYXJlYS0+bHNwX3JlZnJlc2hbMF0gPSBpbnRlcnZhbC0zMDA7CisgIGFyZWEtPmxzcF9yZWZyZXNoWzFdID0gaW50ZXJ2YWwtMzAwOworC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gICAgbm9fbHNwX2xpZmV0aW1lX2FyZ19jbWQsCisgICAgICAgIm5vIGxzcC1saWZldGltZSA8MzgwLTY1NTM1PiIsCisgICAgICAgTk9fU1RSCisgICAgICAgIk1heGltdW0gTFNQIGxpZmV0aW1lXG4iCisgICAgICAgIkxTUCBsaWZldGltZSBpbiBzZWNvbmRzXG4iCisgICAgICAgKQorCitERUZVTiAobHNwX2xpZmV0aW1lX2wxLAorICAgICAgIGxzcF9saWZldGltZV9sMV9jbWQsCisgICAgICAgImxzcC1saWZldGltZSBsZXZlbC0xIDwzODAtNjU1MzU+IiwKKyAgICAgICAiTWF4aW11bSBMU1AgbGlmZXRpbWUgZm9yIExldmVsIDEgb25seVxuIgorICAgICAgICJMU1AgbGlmZXRpbWUgZm9yIExldmVsIDEgb25seSBpbiBzZWNvbmRzXG4iCisgICAgICAgKQoreworICBzdHJ1Y3QgaXNpc19hcmVhICphcmVhOworICB1aW50MTZfdCBpbnRlcnZhbDsKKworICBhcmVhID0gdnR5LT5pbmRleDsKKyAgYXNzZXJ0IChhcmVhKTsKKyAgCisgIGludGVydmFsID0gYXRvaSAoYXJndlswXSk7CisKKyAgaWYgKGludGVydmFsIDwgSVNJU19NSU5fTFNQX0xJRkVUSU1FKSB7CisgICAgdnR5X291dCAodnR5LCAiTGV2ZWwtMSBMU1AgbGlmZXRpbWUgKCV1cykgYmVsb3cgJXVzJXMiLAorCSAgICAgaW50ZXJ2YWwsCisJICAgICBJU0lTX01JTl9MU1BfTElGRVRJTUUsCisJICAgICBWVFlfTkVXTElORSk7CisKKyAgICByZXR1cm4gQ01EX1dBUk5JTkc7CisgIH0KKworCisgIGFyZWEtPm1heF9sc3BfbGlmZXRpbWVbMF0gPSBpbnRlcnZhbDsKKyAgYXJlYS0+bHNwX3JlZnJlc2hbMF0gPSBpbnRlcnZhbC0zMDA7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAobm9fbHNwX2xpZmV0aW1lX2wxLAorICAgICA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CitBTElBUyAobm9fbHNwX2xpZmV0aW1lX2wyLAorICAgICAgIG5vX2xzcF9saWZldGltZV9sMl9hcmdfY21kLAorICAgICAgICJubyBsc3AtbGlmZXRpbWUgbGV2ZWwtMiA8MzgwLTY1NTM1PiIsCisgICAgICAgTk9fU1RSCisgICAgICAgIk1heGltdW0gTFNQIGxpZmV0aW1lIGZvciBMZXZlbCAyIG9ubHlcbiIKKyAgICAgICAiTFNQIGxpZmV0aW1lIGZvciBMZXZlbCAyIG9ubHkgaW4gc2Vjb25kc1xuIgorICAgICAgICkKKworCisKKworLyogSVMtSVMgY29uZmlndXJhdGlvbiB3cml0ZSBmdW5jdGlvbiAqLworaW50Citpc2lzX2NvbmZpZ193cml0ZSAoc3RydWN0IHZ0eSAqdnR5KQoreworICBpbnQgd3JpdGUgPSAwOworICAKKyAgaWYgKGlzaXMgIT0gTlVMTCkgeworICAgIHN0cnVjdCBpc2lzX2FyZWEgKmFyZWE7CisgICAgc3RydWN0IGxpc3Rub2RlICpub2RlOworICAgIHN0cnVjdCBsaXN0bm9kZSAqbm9kZTI7CisKKyAgICBMSVNUX0xPT1AgKGlzaXMtPmFyZWFfbGlzdCwgYXJlYSwgbm9kZSkgeworICAgICAgLyogSVNJUyAtIEFyZWEgbmFtZSAqLworICAgICAgdnR5X291dCAodnR5LCAicm91dGVyIGlzaXMgJXMlcyIsYXJlYS0+YXJlYV90YWcsIFZUWV9ORVdMSU5FKTsKKyAgICAgIHdyaXRlKys7CisgICAgICAvKiBJU0lTIC0gTmV0ICovCisgICAgICBpZiAobGlzdGNvdW50IChhcmVhLT5hcmVhX2FkZHJzKSA+IDApIHsKKyAgICAgICAgc3RydWN0IGFyZWFfYWRkciAqYXJlYV9hZGRyOworICAgICAgICBMSVNUX0xPT1AgKGFyZWEtPmFyZWFfYWRkcnMsIGFyZWFfYWRkciwgbm9kZTIpIHsKKyAgICAgICAgICB2dHlfb3V0ICh2dHksICIgbmV0ICVzJXMiLCAKKwkJICAgaXNvbmV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VMsIAorCQkgSVNJU19TWVNfSURfTEVOKSkgeworICAgICAgICB2dHlfb3V0ICh2dHksICIgdG9wb2xvZ3kgYmFzZV9pcyAlcyVzIiwgCisJCSBzeXNpZF9wcmludCAoYXJlYS0+dG9wb2xvZ3lfYmFzZWlzKSwgVlRZX05FV0xJTkUpOworICAgICAgICB3cml0ZSArKzsKKyAgICAgIH0KKworICAgICAgI2VuZGlmIC8qIFRPUE9MT0dZX0dFTkVSQVRFICovCisgICAgfQorICB9CisgIAorICByZXR1cm4gd3JpdGU7Cit9CisKK3N0cnVjdCBjbWRfbm9kZSBpc2lzX25vZGUgPQoreworICBJU0lTX05PREUsCisgICIlcyhjb25maWdfcm91dGVyKSMgIiwKKyAgMQorfTsKKwordm9pZCAKK2lzaXNfaW5pdCAoKQoreworCisgIC8qIEluc3RhbGwgSVMtSVMgdG9wIG5vZGUgKi8KKyAgaW5zdGFsbF9ub2RlICgmaXNpc19ub2RlLCBpc2lzX2NvbmZpZ193cml0ZSk7CisgIAorICBpbnN0YWxsX2VsZW1lbnQgKFZJRVdfTk9ERSwgJnNob3dfY2xuc19uZWlnaGJvcnNfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZzaG93X2lzaXNfbmVpZ2hib3JzX2NtZCk7CisgIGluc3RhbGxfZWxlbWVudCAoVklFV19OT0RFLCAmc2hvd19jbG5zX25laWdoYm9yc19kZXRhaWxfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZzaG93X2lzaXNfbmVpZ2hib3JzX2RldGFpbF9jbWQpOworCisgIGluc3RhbGxfZWxlbWVudCAoVklFV19OT0RFLCAmc2hvd19ob3N0bmFtZV9jbWQpOworICBpbnN0YWxsX2VsZW1lbnQgKFZJRVdfTk9ERSwgJnNob3dfZGF0YWJhc2VfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZzaG93X2RhdGFiYXNlX2RldGFpbF9jbWQpOworCisgIG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Z2VzOworI2lmZGVmIFRPUE9MT0dZX0dFTkVSQVRFCisgIHN0cnVjdCBsaXN0ICAgICAgICAgICAgICAgICAgICp0b3BvbG9neTsKKyAgY2hhciAgIHRvcG9sb2d5X2Jhc2Vpc1tJU0lTX1NZU19JRF9MRU5dOyAvKiBpcyBmb3IgdGhlIGZpcnN0IGlzIGVtdWxhdGVkICAqLworICBjaGFyICAgICAgICAgICAgICAgICAgICB0b3BfcGFyYW1zWzIwMF07IC8qIEZJWE1FOiB3aGF0IGlzIHJlYXNvbmFibGU/ICAgICovCisjZW5kaWYgLyogVE9QT0xPR1lfR0VORVJBVEUgKi8KK307CisKK3ZvaWQgaXNpc19pbml0KHZvaWQpOworc3RydWN0IGlzaXNfYXJlYSAqaXNpc19hcmVhX2xvb2t1cCAoY2hhciAqKTsKKworI2RlZmluZSBERUJVR19BREpfUEFDS0VUUyAgICAgICAgICAgICAgICAoMTw8MCkKKyNkZWZpbmUgREVCVUdfQ0hFQ0tTVU1fRVJST1JTICAgICAgICAgICAgKDE8PDEpCisjZGVmaW5lIERFQlVHX0xPQ0FMX1VQREFURVMgICAgICAgICAgICAgICgxPDwyKQorI2RlZmluZSBERUJVR19QUk9UT0NPTF9FUlJPUlMgICAgICAgICAgICAoMTw8MykKKyNkZWZpbmUgREVCVUdfU05QX1BBQ0tFVFMgICAgICAgICAgICAgICAgKDE8PDQpCisjZGVmaW5lIERFQlVHX1VQREFURV9QQUNLRVRTICAgICAgICAgICAgICgxPDw1KQorI2RlZmluZSBERUJVR19TUEZfRVZFTlRTICAgICAgICAgICAgICAgICAoMTw8NikKKyNkZWZpbmUgREVCVUdfU1BGX1NUQVRTICAgICAgICAgICAgICAgICAgKDE8PDcpCisjZGVmaW5lIERFQlVHX1NQRl9UUklHR0VSUyAgICAgICAgICAgICAgICgxPDw4KQorI2RlZmluZSBERUJVR19SVEVfRVZFTlRTICAgICAgICAgICAgICAgICAoMTw8OSkKKyNkZWZpbmUgREVCVUdfRVZFTlRTICAgIC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isgKiBGSVhNRTogQ2hlY2sgZm9yIG92ZXJmbG93IAorICovCisKK2ludAoraXNvX2NzdW1fdmVyaWZ5ICh1X2NoYXIgKmJ1ZmZlciwgaW50IGxlbiwgdWludDE2X3QgKmNzdW0pCit7IAorICB1X2ludDhfdCAqcDsKKyAgdV9pbnQzMl90IGMwOworICB1X2ludDMyX3QgYzE7CisgIHVfaW50MTZfdCBjaGVja3N1bTsKKyAgaW50IGk7CisKKyAgcCA9IGJ1ZmZlcjsKKyAgY2hlY2tzdW0gPSAwOworICBjMCA9ICpjc3VtICYgMHhmZjAwOworICBjMSA9ICpjc3VtICYgMHgwMGZmOworCisgIC8qCisgICAqIElmIGJvdGggYXJlIHplcm8gcmV0dXJuIGNvcnJlY3QKKyAgICovCisgIGlmIChjMCA9PSAwICYmIGMxID09IDApCisgICAgcmV0dXJuIDA7CisKKyAgLyoKKyAgICogSWYgZWl0aGVyLCBidXQgbm90IGJvdGggYXJlIHplcm8gcmV0dXJuIGluY29ycmVjdAorICAgKi8KKyAgaWYgKGMwID09IDAgfHwgYzEgPT0gMCkKKyAgICByZXR1cm4gMTsKKyAgCisgIC8qCisgICAqIE90aGVyd2lzZSBpbml0aWFsaXplIHRvIHplcm8gYW5kIGNhbGN1bGF0ZS4uLgorICAgKi8KKyAgYzAgPSAwOworICBjMSA9IDA7CisKKyAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7CisgICAgYzAgPSBjMCArICoocCsrKTsKKyAgICBjMSArPSBjMDsKKyAgfQorCisgIGMwID0gYzAgJSAyNTU7CisgIGMxID0gYzEgJSAyNTU7CisgIAorICBpZiAoIGMwID09IDAgJiYgYzEgPT0gMCkKKyAgICByZXR1cm4gMDsKKworICByZXR1cm4gMTsKK30KKworCisvKgorICogQ3JlYXRlcyB0aGUgY2hlY2tzdW0uICpjc3VtIHBvaW50cyB0byB0aGUgcG9zaXRpb24gb2YgdGhlIGNoZWNrc3VtIGluIHRoZSAKKyAqIFBEVS4gCisgKiBC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RlIHNwYWNlcyAqLworICBpZiAoKmNwID09ICdcMCcpCisgICAgcmV0dXJuIE5VTEw7CisKKyAgc3RhcnQgPSBjcDsKKworICB3aGlsZSAoISgqY3AgPT0gJ1xyJyB8fCAqY3AgPT0gJ1xuJykgJiYgKmNwICE9ICdcMCcpCisgICAgY3ArKzsKKworICBzdHJsZW4gPSBjcCAtIHN0YXJ0OworICB0b2tlbiA9IFhNQUxMT0MgKE1UWVBFX1NUUlZFQywgc3RybGVuICsgMSk7CisgIG1lbWNweSAodG9rZW4sIHN0YXJ0LCBzdHJsZW4pOworICAqKHRva2VuICsgc3RybGVuKSA9ICdcMCc7CisKKyAgKnN0cmluZyA9IGNwOworCisgIHJldHVybiB0b2tlbjsKK30KKworLyogTmV3IHN0cmluZyB2ZWN0b3IuICovCit2ZWN0b3IKK2NtZF9tYWtlX2Rlc2N2ZWMgKGNoYXIgKnN0cmluZywgY2hhciAqZGVzY3N0cikKK3sKKyAgaW50IG11bHRpcGxlID0gMDsKKyAgY2hhciAqc3A7CisgIGNoYXIgKnRva2VuOworICBpbnQgbGVuOworICBjaGFyICpjcDsKKyAgY2hhciAqZHA7CisgIHZlY3RvciBhbGx2ZWM7CisgIHZlY3RvciBzdHJ2ZWMgPSBOVUxMOworICBzdHJ1Y3QgZGVzYyAqZGVzYzsKKworICBjcCA9IHN0cmluZzsKKyAgZHAgPSBkZXNjc3RyOworCisgIGlmIChjcCA9PSBOVUxMKQorICAgIHJldHVybiBOVUxMOworCisgIGFsbHZlYyA9IHZlY3Rvcl9pbml0IChWRUNUT1JfTUlOX1NJWkUpOworCisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIHdoaWxlIChpc3NwYWNlICgoaW50KSAqY3ApICYmICpjcCAhPSAnXDAnKQorCWNwKys7CisKKyAgICAgIGlmICgqY3AgPT0gJygnKQorCXsKKwkgIG11bHRpcGxlID0gMTsKKwkgIGNwKys7CisJfQorICAgICAgaWYgKCpjcCA9PSAnKScpCisJeworCSAgbXVsdGlwbGUgPSAwOworCSAgY3ArKzsKKwl9CisgICAgICBpZiAoKmNwID09ICd8JykKKwl7CisJICBpZiAoISBtdWx0aXBsZSkKKwkgICAgeworCSAgICAgIGZwcmludGYgKHN0ZGVyciwgIkNvbW1hbmQgcGFyc2UgZXJyb3IhOiAlc1xuIiwgc3RyaW5nKTsKKwkgICAgICBleGl0ICgxKTsKKwkgICAgfQorCSAgY3ArKzsKKwl9CisgICAgICAKKyAgICAgIHdoaWxlIChpc3NwYWNlICgoaW50KSAqY3ApICYmICpjcCAhPSAnXDAnKQorCWNwKys7CisKKyAgICAgIGlmICgqY3AgPT0gJygnKQorCXsKKwkgIG11bHRpcGxlID0gMTsKKwkgIGNwKys7CisJfQorCisgICAgICBpZiAoKmNwID09ICdcMCcpIAorCXJldHVybiBhbGx2ZWM7CisKKyAgICAgIHNwID0gY3A7CisKKyAgICAgIHdoaWxlICghIChpc3NwYWNlICgoaW50KSAqY3ApIHx8ICpjcCA9PSAnXHInIHx8ICpjcCA9PSAnXG4nIHx8ICpjcCA9PSAnKScgfHwgKmNwID09ICd8JykgJiYgKmNwICE9ICdcMCcpCisJY3ArKzsKKworICAgICAgbGVuID0gY3AgLSBzcDsKKworICAgICAgdG9rZW4gPSBYTUFMTE9DIChNVFlQRV9TVFJWRUMsIGxlbiArIDEpOworICAgICAgbWVtY3B5ICh0b2tlbiwgc3AsIGxlbik7CisgICAgICAqKHRva2VuICsgbGVuKSA9ICdcMCc7CisKKyAgICAgIGRlc2MgPSBYQ0FMTE9DIChNVFlQRV9ERVNDLCBzaXplb2YgKHN0cnVjdCBkZXNjKSk7CisgICAgICBkZXNjLT5jbWQgPSB0b2tlbjsKKyAgICAgIGRlc2MtPnN0ciA9IGNtZF9kZXNjX3N0ciAoJmRwKTsKKworICAgICAgaWYgKG11bHRpcGxlKQorCXsKKwkgIGlmIChtdWx0aXBsZSA9PSAxKQorCSAgICB7CisJICAgICAgc3RydmVjID0gdmVjdG9yX2luaXQgKFZFQ1RPUl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mFsLWxlbmd0aCAlZCVzIiwgaG9zdC5saW5lcywKKwkgICAgIFZUWV9ORVdMSU5FKTsKKworICBpZiAoISBob3N0Lm1vdGQpCisgICAgdnR5X291dCAodnR5LCAibm8gYmFubmVyIG1vdGQlcyIsIFZUWV9ORVdMSU5FKTsKKworICByZXR1cm4gMTsKK30KKworLyogVXRpbGl0eSBmdW5jdGlvbiBmb3IgZ2V0dGluZyBjb21tYW5kIHZlY3Rvci4gKi8KK3ZlY3RvcgorY21kX25vZGVfdmVjdG9yICh2ZWN0b3IgdiwgZW51bSBub2RlX3R5cGUgbnR5cGUpCit7CisgIHN0cnVjdCBjbWRfbm9kZSAqY25vZGUgPSB2ZWN0b3Jfc2xvdCAodiwgbnR5cGUpOworICByZXR1cm4gY25vZGUtPmNtZF92ZWN0b3I7Cit9CisKKy8qIEZpbHRlciBjb21tYW5kIHZlY3RvciBieSBzeW1ib2wgKi8KK2ludAorY21kX2ZpbHRlcl9ieV9zeW1ib2wgKGNoYXIgKmNvbW1hbmQsIGNoYXIgKnN5bWJvbCkKK3sKKyAgaW50IGksIGxpbTsKKworICBpZiAoc3RyY21wIChzeW1ib2wsICJJUFY0X0FERFJFU1MiKSA9PSAwKQorICAgIHsKKyAgICAgIGkgPSAwOworICAgICAgbGltID0gc3RybGVuIChjb21tYW5kKTsKKyAgICAgIHdoaWxlIChpIDwgbGltKQorCXsKKwkgIGlmICghIChpc2RpZ2l0ICgoaW50KSBjb21tYW5kW2ldKSB8fCBjb21tYW5kW2ldID09ICcuJyB8fCBjb21tYW5kW2ldID09ICcvJykpCisJICAgIHJldHVybiAxOworCSAgaSsrOworCX0KKyAgICAgIHJldHVybiAwOworICAgIH0KKyAgaWYgKHN0cmNtcCAoc3ltYm9sLCAiU1RSSU5HIikgPT0gMCkKKyAgICB7CisgICAgICBpID0gMDsKKyAgICAgIGxpbSA9IHN0cmxlbiAoY29tbWFuZCk7CisgICAgICB3aGlsZSAoaSA8IGxpbSkKKwl7CisJICBpZiAoISAoaXNhbHBoYSAoKGludCkgY29tbWFuZFtpXSkgfHwgY29tbWFuZFtpXSA9PSAnXycgfHwgY29tbWFuZFtpXSA9PSAnLScpKQorCSAgICByZXR1cm4gMTsKKwkgIGkrKzsKKwl9CisgICAgICByZXR1cm4gMDsKKyAgICB9CisgIGlmIChzdHJjbXAgKHN5bWJvbCwgIklGTkFNRSIpID09IDApCisgICAgeworICAgICAgaSA9IDA7CisgICAgICBsaW0gPSBzdHJsZW4gKGNvbW1hbmQpOworICAgICAgd2hpbGUgKGkgPCBsaW0pCisJeworCSAgaWYgKCEgaXNhbG51bSAoKGludCkgY29tbWFuZFtpXSkpCisJICAgIHJldHVybiAxOworCSAgaSsrOworCX0KKyAgICAgIHJldHVybiAwOworICAgIH0KKyAgcmV0dXJuIDA7Cit9CisKKy8qIENvbXBsZXRpb24gbWF0Y2ggdHlwZXMuICovCitlbnVtIG1hdGNoX3R5cGUgCit7CisgIG5vX21hdGNoLAorICBleHRlbmRfbWF0Y2gsCisgIGlwdjRfcHJlZml4X21hdGNoLAorICBpcHY0X21hdGNoLAorICBpcHY2X3ByZWZpeF9tYXRjaCwKKyAgaXB2Nl9tYXRjaCwKKyAgcmFuZ2VfbWF0Y2gsCisgIHZhcmFyZ19tYXRjaCwKKyAgcGFydGx5X21hdGNoLAorICBleGFjdF9tYXRjaCAKK307CisKK2VudW0gbWF0Y2hfdHlwZQorY21kX2lwdjRfbWF0Y2ggKGNoYXIgKnN0cikKK3sKKyAgY2hhciAqc3A7CisgIGludCBkb3RzID0gMCwgbnVtcyA9IDA7CisgIGNoYXIgYnVmWzRdOworCisgIGlmIChzdHIgPT0gTlVMTCkKKyAgICByZXR1cm4gcGFydGx5X21hdGNoOworCisgIGZvciAoOzspCisgICAgeworICAgICAgbWVtc2V0IChidWYsIDAsIHNpemVvZiAoYnVmKSk7CisgICAgICBzcCA9IHN0cjsKKyAgICAgIHdoaWxlICgqc3RyICE9ICdcMCcpCisJeworCSAgaWYgKCpzdHIgPT0gJy4nKQorCSAgICB7CisJICAgICAgaWYgKGRvdHMgPj0gMykKKwkJcmV0dXJuIG5vX21hdGNoOworCisJICAgICAgaWYgKCooc3RyICsgMSkgPT0gJy4nKQorCQlyZXR1cm4gbm9fbWF0Y2g7CisKKwkgICAgICBpZiAoKihzdHIgKyAxKSA9PSAnXDAnKQorCQlyZXR1cm4gcGFydGx5X21hdGNoOworCisJICAgICAgZG90cysrOworCSAgICAgIGJyZWFrOworCSAgICB9CisJICBpZiAoIWlzZGlnaXQgKChpbnQpICpzdHIpKQorCSAgICByZXR1cm4gbm9fbWF0Y2g7CisKKwkgIHN0cisrOworCX0KKworICAgICAgaWYgKHN0ciAtIHNwID4gMykKKwlyZXR1cm4gbm9fbWF0Y2g7CisKKyAgICAgIHN0cm5jcHkgKGJ1Ziwgc3AsIHN0ciAtIHNwKTsKKyAgICAgIGlmIChhdG9pIChidWYpID4gMjU1KQorCXJldHVybiBub19tYXRjaDsKKworICAgICAgbnVtcysrOworCisgICAgICBpZiAoKnN0ciA9PSAnXDAnKQorCWJyZWFrOworCisgICAgICBzdHIrKzsKKyAgICB9CisKKyAgaWYgKG51bXMgPCA0KQorICAgIHJldHVybiBwYXJ0bHlfbWF0Y2g7CisKKyAgcmV0dXJuIGV4YWN0X21hdGNoOworfQorCitlbnVtIG1hdGNoX3R5cGUKK2NtZF9pcHY0X3ByZWZpeF9tYXRjaCAoY2hhciAqc3RyKQoreworICBjaGFyICpzcDsKKyAgaW50IGRvdHMgPSAwOworICBjaGFyIGJ1Zls0XTsKKworICBpZiAoc3RyID09IE5VTEwpCisgICAgcmV0dXJuIHBhcnRseV9tYXRjaDsKKworICBmb3IgKDs7KQorICAgIHsKKyAgICAgIG1lbXNldCAoYnVmLCAwLCBzaXplb2YgKGJ1ZikpOworICAgICAgc3AgPSBzdHI7CisgICAgICB3aGlsZSAoKnN0ciAhPSAnXDAnICYmICpzdHIgIT0gJy8nKQorCXsKKwkgIGlmICgqc3RyID09ICcuJykKKwkgICAgeworCSAgICAgIGlmIChkb3RzID09IDMpCisJCXJldHVybiBub19tYXRjaDsKKworCSAgICAgIGlmICgqKHN0ciArIDEpID09ICcuJyB8fCAqKHN0ciArIDEpID09ICcvJykKKwkJcmV0dXJuIG5vX21hdGNoOworCisJICAgICAgaWYgKCooc3RyICsgMSkgPT0gJ1wwJykKKwkJcmV0dXJuIHBhcnRseV9tYXRjaDsKKworCSAgICAgIGRvdHMrKzsKKwkgICAgICBicmVhazsKKwkgICAgfQorCisJICBpZiAoIWlzZGlnaXQgKChpbnQpICpzdHIpKQorCSAgICByZXR1cm4gbm9fbWF0Y2g7CisKKwkgIHN0cisrOworCX0KKworICAgICAgaWYgKHN0ciAtIHNwID4gMykKKwlyZXR1cm4gbm9fbWF0Y2g7CisKKyAgICAgIHN0cm5jcHkgKGJ1Ziwgc3AsIHN0ciAtIHNwKTsKKyAgICAgIGlmIChhdG9pIChidWYpID4gMjU1KQorCXJldHVybiBub19tYXRjaDsKKworICAgICAgaWYgKGRvdHMgPT0gMykKKwl7CisJICBpZiAoKnN0ciA9PSAnLycpCisJICAgIHsKKwkgICAgICBpZiAoKihzdHIgKyAxKSA9PSAnXDAnKQorCQlyZXR1cm4gcGFydGx5X21hdGNoOworCisJICAgICAgc3RyKys7CisJICAgICAgYnJlYWs7CisJICAgIH0KKwkgIGVsc2UgaWYgKCpzdHIgPT0gJ1wwJykKKwkgICAgcmV0dXJuIHBhcnRseV9tYXRjaDsKKwl9CisKKyAgICAgIGlmICgqc3RyID09ICdcMCcpCisJcmV0dXJuIHBhcnRseV9tYXRjaDsKKworICAgICAgc3RyKys7CisgICAgfQorCisgIHNwID0gc3RyOworICB3aGlsZSAoKnN0ciAhPSAnXDAnKQorICAgIHsKKyAgICAgIGlmICghaXNkaWdpdCAoKGludCkgKnN0cikpCisJcmV0dXJuIG5vX21hdGNoOworCisgICAgICBzdHIrKzsKKyAgICB9CisKKyAgaWYgKGF0b2kgKHNwKSA+IDMyKQorICAgIHJldHVybiBub19tYX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eworCSAgICAgIHNwID0gc3RyOworCSAgICAgIHN0YXRlID0gU1RBVEVfQUREUjsKKwkgICAgfQorCisJICBjb250aW51ZTsKKwljYXNlIFNUQVRFX0NPTE9OOgorCSAgY29sb25zKys7CisJICBpZiAoKihzdHIgKyAxKSA9PSAnOicpCisJICAgIHN0YXRlID0gU1RBVEVfRE9VQkxFOworCSAgZWxzZQorCSAgICB7CisJICAgICAgc3AgPSBzdHIgKyAxOworCSAgICAgIHN0YXRlID0gU1RBVEVfQUREUjsKKwkgICAgfQorCSAgYnJlYWs7CisJY2FzZSBTVEFURV9ET1VCTEU6CisJICBpZiAoZG91YmxlX2NvbG9uKQorCSAgICByZXR1cm4gbm9fbWF0Y2g7CisKKwkgIGlmICgqKHN0ciArIDEpID09ICc6JykKKwkgICAgcmV0dXJuIG5vX21hdGNoOworCSAgZWxzZQorCSAgICB7CisJICAgICAgaWYgKCooc3RyICsgMSkgIT0gJ1wwJykKKwkJY29sb25zKys7CisJICAgICAgc3AgPSBzdHIgKyAxOworCSAgICAgIHN0YXRlID0gU1RBVEVfQUREUjsKKwkgICAgfQorCisJICBkb3VibGVfY29sb24rKzsKKwkgIG51bXMrKzsKKwkgIGJyZWFrOworCWNhc2UgU1RBVEVfQUREUjoKKwkgIGlmICgqKHN0ciArIDEpID09ICc6JyB8fCAqKHN0ciArIDEpID09ICdcMCcpCisJICAgIHsKKwkgICAgICBpZiAoc3RyIC0gc3AgPiAzKQorCQlyZXR1cm4gbm9fbWF0Y2g7CisKKwkgICAgICBudW1zKys7CisJICAgICAgc3RhdGUgPSBTVEFURV9DT0xPTjsKKwkgICAgfQorCSAgaWYgKCooc3RyICsgMSkgPT0gJy4nKQorCSAgICBzdGF0ZSA9IFNUQVRFX0RPVDsKKwkgIGJyZWFrOworCWNhc2UgU1RBVEVfRE9UOgorCSAgc3RhdGUgPSBTVEFURV9BRERSOworCSAgYnJlYWs7CisJZGVmYXVsdDoKKwkgIGJyZWFrOworCX0KKworICAgICAgaWYgKG51bXMgPiA4KQorCXJldHVybiBub19tYXRjaDsKKworICAgICAgaWYgKGNvbG9ucyA+IDcpCisJcmV0dXJuIG5vX21hdGNoOworCisgICAgICBzdHIrKzsKKyAgICB9CisKKyNpZiAwCisgIGlmIChudW1zIDwgMTEpCisgICAgcmV0dXJuIHBhcnRseV9tYXRjaDsKKyNlbmRpZiAvKiAwICovCisKKyAgcmV0dXJuIGV4YWN0X21hdGNoOworfQorCitlbnVtIG1hdGNoX3R5cGUKK2NtZF9pcHY2X3ByZWZpeF9tYXRjaCAoY2hhciAqc3RyKQoreworICBpbnQgc3RhdGUgPSBTVEFURV9TVEFSVDsKKyAgaW50IGNvbG9ucyA9IDAsIG51bXMgPSAwLCBkb3VibGVfY29sb24gPSAwOworICBpbnQgbWFzazsKKyAgY2hhciAqc3AgPSBOVUxMOworICBjaGFyICplbmRwdHIgPSBOVUxMOworCisgIGlmIChzdHIgPT0gTlVMTCkKKyAgICByZXR1cm4gcGFydGx5X21hdGNoOworCisgIGlmIChzdHJzcG4gKHN0ciwgSVBWNl9QUkVGSVhfU1RSKSAhPSBzdHJsZW4gKHN0cikpCisgICAgcmV0dXJuIG5vX21hdGNoOworCisgIHdoaWxlICgqc3RyICE9ICdcMCcgJiYgc3RhdGUgIT0gU1RBVEVfTUFTSykKKyAgICB7CisgICAgICBzd2l0Y2ggKHN0YXRlKQorCXsKKwljYXNlIFNUQVRFX1NUQVJUOgorCSAgaWYgKCpzdHIgPT0gJzonKQorCSAgICB7CisJICAgICAgaWYgKCooc3RyICsgMSkgIT0gJzonICYmICooc3RyICsgMSkgIT0gJ1wwJykKKwkJcmV0dXJuIG5vX21hdGNoOworCSAgICAgIGNvbG9ucy0tOworCSAgICAgIHN0YXRlID0gU1RBVEVfQ09MT047CisJICAgIH0KKwkgIGVsc2UKKwkgICAgeworCSAgICAgIHNwID0gc3RyOworCSAgICAgIHN0YXRlID0gU1RBVEVfQUREUjsKKwkgICAgfQorCisJICBjb250aW51ZTsKKwljYXNlIFNUQVRFX0NPTE9OOgorCSAgY29sb25zKys7CisJICBpZiAoKihzdHIgKyAxKSA9PSAnLycpCisJICAgIHJldHVybiBub19tYXRjaDsKKwkgIGVsc2UgaWYgKCooc3RyICsgMSkgPT0gJzonKQorCSAgICBzdGF0ZSA9IFNUQVRFX0RPVUJMRTsKKwkgIGVsc2UKKwkgICAgeworCSAgICAgIHNwID0gc3RyICsgMTsKKwkgICAgICBzdGF0ZSA9IFNUQVRFX0FERFI7CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgU1RBVEVfRE9VQkxFOgorCSAgaWYgKGRvdWJsZV9jb2xvbikKKwkgICAgcmV0dXJuIG5vX21hdGNoOworCisJICBpZiAoKihzdHIgKyAxKSA9PSAnOicpCisJICAgIHJldHVybiBub19tYXRjaDsKKwkgIGVsc2UKKwkgICAgeworCSAgICAgIGlmICgqKHN0ciArIDEpICE9ICdcMCcgJiYgKihzdHIgKyAxKSAhPSAnLycpCisJCWNvbG9ucysrOworCSAgICAgIHNwID0gc3RyICsgMTsKKworCSAgICAgIGlmICgqKHN0ciArIDEpID09ICcvJykKKwkJc3RhdGUgPSBTVEFURV9TTEFTSDsKKwkgICAgICBlbHNlCisJCXN0YXRlID0gU1RBVEVfQUREUjsKKwkgICAgfQorCisJICBkb3VibGVfY29sb24rKzsKKwkgIG51bXMgKz0gMTsKKwkgIGJyZWFrOworCWNhc2UgU1RBVEVfQUREUjoKKwkgIGlmICgqKHN0ciArIDEpID09ICc6JyB8fCAqKHN0ciArIDEpID09ICcuJworCSAgICAgIHx8ICooc3RyICsgMSkgPT0gJ1wwJyB8fCAqKHN0ciArIDEpID09ICcvJykKKwkgICAgeworCSAgICAgIGlmIChzdHIgLSBzcCA+IDMpCisJCXJldHVybiBub19tYXRjaDsKKworCSAgICAgIGZvciAoOyBzcCA8PSBzdHI7IHNwKyspCisJCWlmICgqc3AgPT0gJy8nKQorCQkgIHJldHVybiBub19tYXRjaDsKKworCSAgICAgIG51bXMrKzsKKworCSAg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kpCisgICAgeworICAgICAgaWYgKGNtZF9pcHY2X3ByZWZpeF9tYXRjaCAoc3JjKSkKKwlyZXR1cm4gZHN0OworICAgICAgZWxzZQorCXJldHVybiBOVUxMOworICAgIH0KKworICBpZiAoQ01EX0lQVjQgKGRzdCkpCisgICAgeworICAgICAgaWYgKGNtZF9pcHY0X21hdGNoIChzcmMpKQorCXJldHVybiBkc3Q7CisgICAgICBlbHNlCisJcmV0dXJuIE5VTEw7CisgICAgfQorCisgIGlmIChDTURfSVBWNF9QUkVGSVggKGRzdCkpCisgICAgeworICAgICAgaWYgKGNtZF9pcHY0X3ByZWZpeF9tYXRjaCAoc3JjKSkKKwlyZXR1cm4gZHN0OworICAgICAgZWxzZQorCXJldHVybiBOVUxMOworICAgIH0KKworICAvKiBPcHRpb25hbCBvciB2YXJpYWJsZSBjb21tYW5kcyBhbHdheXMgbWF0Y2ggb24gJz8nICovCisgIGlmIChDTURfT1BUSU9OIChkc3QpIHx8IENNRF9WQVJJQUJMRSAoZHN0KSkKKyAgICByZXR1cm4gZHN0OworCisgIC8qIEluIGNhc2Ugb2YgJ2NvbW1hbmQgXHQnLCBnaXZlbiBzcmMgaXMgTlVMTCBzdHJpbmcuICovCisgIGlmIChzcmMgPT0gTlVMTCkKKyAgICByZXR1cm4gZHN0OworCisgIGlmIChzdHJuY21wIChzcmMsIGRzdCwgc3RybGVuIChzcmMpKSA9PSAwKQorICAgIHJldHVybiBkc3Q7CisgIGVsc2UKKyAgICByZXR1cm4gTlVMTDsKK30KKworLyogQ2hlY2sgc2FtZSBzdHJpbmcgZWxlbWVudCBleGlzdGVuY2UuICBJZiBpdCBpc24ndCB0aGVyZSByZXR1cm4KKyAgICAxLiAqLworaW50CitjbWRfdW5pcXVlX3N0cmluZyAodmVjdG9yIHYsIGNoYXIgKnN0cikKK3sKKyAgaW50IGk7CisgIGNoYXIgKm1hdGNoOworCisgIGZvciAoaSA9IDA7IGkgPCB2ZWN0b3JfbWF4ICh2KTsgaSsrKQorICA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VfY21kLAorICAgICAgICJlbmFibGUiLAorICAgICAgICJUdXJuIG9uIHByaXZpbGVnZWQgbW9kZSBjb21tYW5kXG4iKQoreworICAvKiBJZiBlbmFibGUgcGFzc3dvcmQgaXMgTlVMTCwgY2hhbmdlIHRvIEVOQUJMRV9OT0RFICovCisgIGlmICgoaG9zdC5lbmFibGUgPT0gTlVMTCAmJiBob3N0LmVuYWJsZV9lbmNyeXB0ID09IE5VTEwpIHx8CisgICAgICB2dHktPnR5cGUgPT0gVlRZX1NIRUxMX1NFUlYpCisgICAgdnR5LT5ub2RlID0gRU5BQkxFX05PREU7CisgIGVsc2UKKyAgICB2dHktPm5vZGUgPSBBVVRIX0VOQUJMRV9OT0RFOworCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworLyogRGlzYWJsZSBjb21tYW5kICovCitERUZVTiAoZGlzYWJsZSwgCisgICAgICAgY29uZmlnX2Rpc2FibGVfY21kLAorICAgICAgICJkaXNhYmxlIiwKKyAgICAgICAiVHVybiBvZmYgcHJpdmlsZWdlZCBtb2RlIGNvbW1hbmRcbiIpCit7CisgIGlmICh2dHktPm5vZGUgPT0gRU5BQkxFX05PREUpCisgICAgdnR5LT5ub2RlID0gVklFV19OT0RFOworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKKy8qIERvd24gdnR5IG5vZGUgbGV2ZWwuICovCitERUZVTiAoY29uZmlnX2V4aXQsCisgICAgICAgY29uZmlnX2V4aXRfY21kLAorICAgICAgICJleGl0IiwKKyAgICAgICAiRXhpdCBjdXJyZW50IG1vZGUgYW5kIGRvd24gdG8gcHJldmlvdXMgbW9kZVxuIikKK3sKKyAgc3dpdGNoICh2dHktPm5vZGUpCisgICAgeworICAgIGNhc2UgVklFV19OT0RFOgorICAgIGNhc2UgRU5BQkxFX05PREU6CisgICAgICBpZiAodnR5X3NoZWxsICh2dHkpKQorCWV4aXQgKDApOworICAgICAgZWxzZQorCXZ0eS0+c3RhdHVzID0gVlRZX0NMT1NFOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDT05GSUdfTk9ERToKKyAgICAgIHZ0eS0+bm9kZSA9IEVOQUJMRV9OT0RFOworICAgICAgdnR5X2NvbmZpZ191bmxvY2sgKHZ0eSk7CisgICAgICBicmVhazsKKyAgICBjYXNlIElOVEVSRkFDRV9OT0RFOgorICAgIGNhc2UgWkVCUkFfTk9ERToKKyAgICBjYXNlIEJHUF9OT0RFOgorICAgIGNhc2UgUklQX05PREU6CisgICAgY2FzZSBSSVBOR19OT0RFOgorICAgIGNhc2UgT1NQRl9OT0RFOgorICAgIGNhc2UgT1NQRjZfTk9ERToKKyAgICBjYXNlIElTSVNfTk9ERToKKyAgICBjYXNlIEtFWUNIQUlOX05PREU6CisgICAgY2FzZSBNQVNDX05PREU6CisgICAgY2FzZSBSTUFQX05PREU6CisgICAgY2FzZSBWVFlfTk9ERToKKyAgICAgIHZ0eS0+bm9kZSA9IENPTkZJR19OT0RFOworICAgICAgYnJlYWs7CisgICAgY2FzZSBCR1BfVlBOVjRfTk9ERToKKyAgICBjYXNlIEJHUF9JUFY0X05PREU6CisgICAgY2FzZSBCR1BfSVBWNE1fTk9ERToKKyAgICBjYXNlIEJHUF9JUFY2X05PREU6CisgICAgICB2dHktPm5vZGUgPSBCR1BfTk9ERTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgS0VZQ0hBSU5fS0VZX05PREU6CisgICAgICB2dHktPm5vZGUgPSBLRVlDSEFJTl9OT0RFOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisvKiBxdWl0IGlzIGFsaWFzIG9mIGV4aXQuICovCitBTElBUyAoY29uZmlnX2V4aXQsCisgICAgICAgY29uZmlnX3F1aXRfY21kLAorICAgICAgICJxdWl0IiwKKyAgICAgICAiRXhpdCBjdXJyZW50IG1vZGUgYW5kIGRvd24gdG8gcHJldmlvdXMgbW9kZVxuIikKKyAgICAgICAKKy8qIEVuZCBvZiBjb25maWd1cmF0aW9uLiAqLworREVGVU4gKGNvbmZpZ19lbmQsCisgICAgICAgY29uZmlnX2VuZF9jbWQsCisgICAgICAgImVuZCIsCisgICAgICAgIkVuZCBjdXJyZW50IG1vZGUgYW5kIGNoYW5nZSB0byBlbmFibGUgbW9kZS4iKQoreworICBzd2l0Y2ggKHZ0eS0+bm9kZSkKKyAgICB7CisgICAgY2FzZSBWSUVXX05PREU6CisgICAgY2FzZSBFTkFCTEVfTk9ERToKKyAgICAgIC8qIE5vdGhpbmcgdG8gZG8uICovCisgICAgICBicmVhazsKKyAgICBjYXNlIENPTkZJR19OT0RFOgorICAgIGNhc2UgSU5URVJGQUNFX05PREU6CisgICAgY2FzZSBaRUJSQV9OT0RFOgorICAgIGNhc2UgUklQX05PREU6CisgICAgY2FzZSBSSVBOR19OT0RFOgorICAgIGNhc2UgQkdQX05PREU6CisgICAgY2FzZSBCR1BfVlBOVjRfTk9ERToKKyAgICBjYXNlIEJHUF9JUFY0X05PREU6CisgICAgY2FzZSBCR1BfSVBWNE1fTk9ERToKKyAgICBjYXNlIEJHUF9JUFY2X05PREU6CisgICAgY2FzZSBSTUFQX05PREU6CisgICAgY2FzZSBPU1BGX05PREU6CisgICAgY2FzZSBPU1BGNl9OT0RFOgorICAgIGNhc2UgSVNJU19OT0RFOgorICAgIGNhc2UgS0VZQ0hBSU5fTk9ERToKKyAgICBjYXNlIEtFWUNIQUlOX0tFWV9OT0RFOgorICAgIGNhc2UgTUFTQ19OT0RFOgorICAgIGNhc2UgVlRZX05PREU6CisgICAgICB2dHlfY29uZmlnX3VubG9jayAodnR5KTsKKyAgICAgIHZ0eS0+bm9kZSA9IEVOQUJMRV9OT0RFOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisvKiBTaG93IHZlcnNpb24uICovCitERUZVTiAoc2hvd192Z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pCisgICAgICB2dHlfb3V0ICh2dHksICIgICVzJXMiLCBjbWQtPnN0cmluZywKKwkgICAgICAgVlRZX05FV0xJTkUpOworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKKy8qIFdyaXRlIGN1cnJlbnQgY29uZmlndXJhdGlvbiBpbnRvIGZpbGUuICovCitERUZVTiAoY29uZmlnX3dyaXRlX2ZpbGUsIAorICAgICAgIGNvbmZpZ193cml0ZV9maWxlX2NtZCwKKyAgICAgICAid3JpdGUgZmlsZSIsICAKKyAgICAgICAiV3JpdGUgcnVubmluZyBjb25maWd1cmF0aW9uIHRvIG1lbW9yeSwgbmV0d29yaywgb3IgdGVybWluYWxcbiIKKyAgICAgICAiV3JpdGUgdG8gY29uZmlndXJhdGlvbiBmaWxlXG4iKQoreworICBpbnQgaTsKKyAgaW50IGZkOworICBzdHJ1Y3QgY21kX25vZGUgKm5vZGU7CisgIGNoYXIgKmNvbmZpZ19maWxlOworICBjaGFyICpjb25maWdfZmlsZV90bXAgPSBOVUxMOworICBjaGFyICpjb25maWdfZmlsZV9zYXYgPSBOVUxMOworICBzdHJ1Y3QgdnR5ICpmaWxlX3Z0eTsKKworICAvKiBDaGVjayBhbmQgc2VlIGlmIHdlIGFyZSBvcGVyYXRpbmcgdW5kZXIgdnR5c2ggY29uZmlndXJhdGlvbiAqLworICBpZiAoaG9zdC5jb25maWcgPT0gTlVMTCkKKyAgICB7CisgICAgICB2dHlfb3V0ICh2dHksICJDYW4ndCBzYXZlIHRvIGNvbmZpZ3VyYXRpb24gZmlsZSwgdXNpbmcgdnR5c2guJXMiLAorCSAgICAgICBWVFlfTkVXTElORSk7CisgICAgICByZXR1cm4gQ01EX1dBUk5JTkc7CisgICAgfQorCisgIC8qIEdldCBmaWxlbmFtZS4gKi8KKyAgY29uZmlnX2ZpbGUgPSBob3N0LmNvbmZpZzsKKyAgCisgIGNvbmZpZ19maWxlX3NhdiA9IG1hbGxvYyAoc3RybGVuIChjb25maWdfZmlsZSkgK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V9vdXQgKHZ0eSwgIkNhbid0IHVubGluayBjb25maWd1cmF0aW9uIGZpbGUgJXMuJXMiLCBjb25maWdfZmlsZSwKKwkgICAgICAgIFZUWV9ORVdMSU5FKTsKKyAgICAgIGZyZWUgKGNvbmZpZ19maWxlX3Nhdik7CisgICAgICBmcmVlIChjb25maWdfZmlsZV90bXApOworICAgICAgdW5saW5rIChjb25maWdfZmlsZV90bXApOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOyAgICAgIAorICAgIH0KKyAgaWYgKGxpbmsgKGNvbmZpZ19maWxlX3RtcCwgY29uZmlnX2ZpbGUpICE9IDApCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiQ2FuJ3Qgc2F2ZSBjb25maWd1cmF0aW9uIGZpbGUgJXMuJXMiLCBjb25maWdfZmlsZSwKKwkgICAgICAgVlRZX05FV0xJTkUpOworICAgICAgZnJlZSAoY29uZmlnX2ZpbGVfc2F2KTsKKyAgICAgIGZyZWUgKGNvbmZpZ19maWxlX3RtcCk7CisgICAgICB1bmxpbmsgKGNvbmZpZ19maWxlX3RtcCk7CisgICAgICByZXR1cm4gQ01EX1dBUk5JTkc7ICAgICAgCisgICAgfQorICB1bmxpbmsgKGNvbmZpZ19maWxlX3RtcCk7CisgIHN5bmMgKCk7CisgIAorICBmcmVlIChjb25maWdfZmlsZV9zYXYpOworICBmcmVlIChjb25maWdfZmlsZV90bXApOworICB2dHlfb3V0ICh2dHksICJDb25maWd1cmF0aW9uIHNhdmVkIHRvICVzJXMiLCBjb25maWdfZmlsZSwKKwkgICBWVFlfTkVXTElORSk7CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworQUxJQVMgKGNvbmZpZ193cml0ZV9maWxlLCAKKyAgICAgICBjb25maWdfd3JpdGVfY21kLAorICAgICAgICJ3cml0ZSIsICAKKyAgICAgICAiV3JpdGUgcnVubmluZyBjb25maWd1cmF0aW9uIHRvIG1lbW9yeSwgbmV0d29yaywgb3IgdGVybWluYWxcbiIpCisKK0FMSUFTIChjb25maWdfd3JpdGVfZmlsZSwgCisgICAgICAgY29uZmlnX3dyaXRlX21lbW9yeV9jbWQsCisgICAgICAgIndyaXRlIG1lbW9yeSIsICAKKyAgICAgICAiV3JpdGUgcnVubmluZyBjb25maWd1cmF0aW9uIHRvIG1lbW9yeSwgbmV0d29yaywgb3IgdGVybWluYWxcbiIKKyAgICAgICAiV3JpdGUgY29uZmlndXJhdGlvbiB0byB0aGUgZmlsZSAoc2FtZSBhcyB3cml0ZSBmaWxlKVxuIikKKworQUxJQVMgKGNvbmZpZ193cml0ZV9maWxlLCAKKyAgICAgICBjb3B5X3J1bm5pbmdjb25maWdfc3RhcnR1cGNvbmZpZ19jbWQsCisgICAgICAgImNvcHkgcnVubmluZy1jb25maWcgc3RhcnR1cC1jb25maWciLCAgCisgICAgICAgIkNvcHkgY29uZmlndXJhdGlvblxuIgorICAgICAgICJDb3B5IHJ1bm5pbmcgY29uZmlnIHRvLi4uIFxuIgorICAgICAgICJDb3B5IHJ1bm5pbmcgY29uZmlnIHRvIHN0YXJ0dXAgY29uZmlnIChzYW1lIGFzIHdyaXRlIGZpbGUpXG4iKQorCisvKiBXcml0ZSBjdXJyZW50IGNvbmZpZ3VyYXRpb24gaW50byB0aGUgdGVybWluYWwuICovCitERUZVTiAoY29uZmlnX3dyaXRlX3Rlcm1pbmFsLAorICAgICAgIGNvbmZpZ193cml0ZV90ZXJtaW5hbF9jbWQsCisgICAgICAgIndyaXRlIHRlcm1pbmFsIiwKKyAgICAgICAiV3JpdGUgcnVubmluZyBjb25maWd1cmF0aW9uIHRvIG1lbW9yeSwgbmV0d29yaywgb3IgdGVybWluYWxcbiIKKyAgICAgICAiV3JpdGUgdG8gdGVybWluYWxcbiIpCit7CisgIGludCBpOworICBzdHJ1Y3QgY21kX25vZGUgKm5vZGU7CisKKyAgaWYgKHZ0eS0+dHlwZSA9PSBWVFlfU0hFTExfU0VSVikKKyAgICB7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgdmVjdG9yX21heCAoY21kdmVjKTsgaSsrKQorCWlmICgobm9kZSA9IHZlY3Rvcl9zbG90IChjbWR2ZWMsIGkpKSAmJiBub2RlLT5mdW5jICYmIG5vZGUtPnZ0eXNoKQorCSAgeworCSAgICBpZiAoKCpub2RlLT5mdW5jKSAodnR5KSkKKwkgICAgICB2dHlfb3V0ICh2dHksICIhJXMiLCBWVFlfTkVXTElORSk7CisJICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiJXNDdXJyZW50IGNvbmZpZ3VyYXRpb246JXMiLCBWVFlfTkVXTElORSwKKwkgICAgICAgVlRZX05FV0xJTkUpOworICAgICAgdnR5X291dCAodnR5LCAiISVzIiwgVlRZX05FV0xJTkUpOworCisgICAgICBmb3IgKGkgPSAwOyBpIDwgdmVjdG9yX21heCAoY21kdmVjKTsgaSsrKQorCWlmICgobm9kZSA9IHZlY3Rvcl9zbG90IChjbWR2ZWMsIGkpKSAmJiBub2RlLT5mdW5jKQorCSAgeworCSAgICBpZiAoKCpub2RlLT5mdW5jKSAodnR5KSkKKwkgICAgICB2dHlfb3V0ICh2dHksICIhJXMiLCBWVFlfTkVXTElORSk7CisJICB9CisgICAgICB2dHlfb3V0ICh2dHksICJlbmQlcyIsVlRZX05FV0xJTkUpOworICAgIH0KKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisvKiBXcml0ZSBjdXJyZW50IGNvbmZpZ3VyYXRpb24gaW50byB0aGUgdGVybWluYWwuICovCitBTElBUyAoY29uZmlnX3dyaXRlX3Rlcm1pbmFsLAorICAgICAgIHNob3dfcnVubmluZ19jb25maWdfY21kLAorICAgICAgICJzaG93IHJ1bm5pbmctY29uZmlnIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJydW5uaW5nIGNvbmZpZ3VyYXRpb25cbiIpCisKKy8qIFdyaXRlIHN0YXJ0dXAgY29uZmlndXJhdGlvbiBpbnRvIHRoZSB0ZXJtaW5hbC4gKi8KK0RFRlVOIChzaG93X3N0YXJ0dXBfY29uZmlnLAorICAgICAgIHNob3dfc3RhcnR1cF9jb25maWdfY21kLAorICAgICAgICJzaG93IHN0YXJ0dXAtY29uZmlnIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJDb250ZW50ZXMgb2Ygc3RhcnR1cCBjb25maWd1cmF0aW9uXG4iKQoreworICBjaGFyIGJ1ZltCVUZTSVpdOworICBGSUxFICpjb25mcDsKKworICBjb25mcCA9IGZvcGVuIChob3N0LmNvbmZpZywgInIiKTsKKyAgaWYgKGNvbmZwID09IE5VTEwpCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiQ2FuJ3Qgb3BlbiBjb25maWd1cmF0aW9uIGZpbGUgWyVzXSVzIiwKKwkgICAgICAgaG9zdC5jb25maWcsIFZUWV9ORVdMSU5FKTsKKyAgICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgICB9CisKKyAgd2hpbGUgKGZnZXRzIChidWYsIEJVRlNJWiwgY29uZnApKQorICAgIHsKKyAgICAgIGNoYXIgKmNwID0gYnVmOworCisgICAgICB3aGlsZSAoKmNwICE9ICdccicgJiYgKmNwICE9ICdcbicgJiYgKmNwICE9ICdcMCcpCisJY3ArKzsKKyAgICAgICpjcCA9ICdcMCc7CisKKyAgICAgIHZ0eV9vdXQgKHZ0eSwgIiVzJXMiLCBidWYsIFZUWV9ORVdMSU5FKTsKKyAgICB9CisKKyAgZmNsb3NlIChjb25mcCk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisvKiBIb3N0bmFtZSBjb25maWd1cmF0aW9uICovCitERUZVTiAoY29uZmlnX2hvc3RuYW1lLCAKKyAgICAgICBob3N0bmFtZV9jbWQsCisgICAgICAgImhvc3RuYW1lIFdPUkQiLAorICAgICAgICJTZXQgc3lzdGVtJ3MgbmV0d29yayBuYW1lXG4iCisgICAgICAgIlRoaXMgc3lzdGVtJ3MgbmV0d29yayBuYW1lXG4iKQoreworICBpZiAoIWlzYWxw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cy4gKi8KK3ZvaWQKK2NtZF9pbml0IChpbnQgdGVybWluYWwpCit7CisgIC8qIEFsbG9jYXRlIGluaXRpYWwgdG9wIHZlY3RvciBvZiBjb21tYW5kcy4gKi8KKyAgY21kdmVjID0gdmVjdG9yX2luaXQgKFZFQ1RPUl9NSU5fU0laRSk7CisKKyAgLyogRGVmYXVsdCBob3N0IHZhbHVlIHNldHRpbmdzLiAqLworICBob3N0Lm5hbWUgPSBOVUxMOworICBob3N0LnBhc3N3b3JkID0gTlVMTDsKKyAgaG9zdC5lbmFibGUgPSBOVUxMOworICBob3N0LmxvZ2ZpbGUgPSBOVUxMOworICBob3N0LmNvbmZpZyA9IE5VTEw7CisgIGhvc3QubGluZXMgPSAtMTsKKyAgaG9zdC5tb3RkID0gZGVmYXVsdF9tb3RkOworCisgIC8qIEluc3RhbGwgdG9wIG5vZGVzLiAqLworICBpbnN0YWxsX25vZGUgKCZ2aWV3X25vZGUsIE5VTEwpOworICBpbnN0YWxsX25vZGUgKCZlbmFibGVfbm9kZSwgTlVMTCk7CisgIGluc3RhbGxfbm9kZSAoJmF1dGhfbm9kZSwgTlVMTCk7CisgIGluc3RhbGxfbm9kZSAoJmF1dGhfZW5hYmxlX25vZGUsIE5VTEwpOworICBpbnN0YWxsX25vZGUgKCZjb25maWdfbm9kZSwgY29uZmlnX3dyaXRlX2hvc3QpOworCisgIC8qIEVhY2ggbm9kZSdzIGJhc2ljIGNvbW1hbmRzLiAqLworICBpbnN0YWxsX2VsZW1lbnQgKFZJRVdfTk9ERSwgJnNob3dfdmVyc2lvbl9jbWQpOworICBpZiAodGVybWluYWwpCisgICAgeworICAgICAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZjb25maWdfbGlzdF9jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZjb25maWdfZXhpdF9jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZjb25maWdfcXVpdF9jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZjb25maWdfaGVscF9jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChWSUVXX05PREUsICZjb25maWdfZW5hYmxlX2NtZCk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKFZJRVdfTk9ERSwgJmNvbmZpZ190ZXJtaW5hbF9sZW5ndGhfY21kKTsKKyAgICAgIGluc3RhbGxfZWxlbWVudCAoVklFV19OT0RFLCAmY29uZmlnX3Rlcm1pbmFsX25vX2xlbmd0aF9jbWQpOworICAgIH0KKworICBpZiAodGVybWluYWwpCisgICAgeworICAgICAgaW5zdGFsbF9kZWZhdWx0IChFTkFCTEVfTk9ERSk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKEVOQUJMRV9OT0RFLCAmY29uZmlnX2Rpc2FibGVfY21kKTsKKyAgICAgIGluc3RhbGxfZWxlbWVudCAoRU5BQkxFX05PREUsICZjb25maWdfdGVybWluYWxfY21kKTsKKyAgICAgIGluc3RhbGxfZWxlbWVudCAoRU5BQkxFX05PREUsICZzaG93X3J1bm5pbmdfY29uZmlnX2NtZCk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKEVOQUJMRV9OT0RFLCAmY29weV9ydW5uaW5nY29uZmlnX3N0YXJ0dXBjb25maWdfY21kKTsKKyAgICB9CisgIGluc3RhbGxfZWxlbWVudCAoRU5BQkxFX05PREUsICZzaG93X3N0YXJ0dXBfY29uZmlnX2NtZCk7CisgIGluc3RhbGxfZWxlbWVudCAoRU5BQkxFX05PREUsICZzaG93X3ZlcnNpb25fY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChFTkFCTEVfTk9ERSwgJmNvbmZpZ190ZXJtaW5hbF9sZW5ndGhfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChFTkFCTEVfTk9ERSwgJmNvbmZpZ190ZXJtaW5hbF9ub19sZW5ndGhfY21kKTsKKworICBpZiAodGVybWluYWwpCisgICAgaW5zdGFsbF9kZWZhdWx0IChDT05GSUdfTk9ERSk7CisgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZob3N0bmFtZV9jbWQpOworICBpbnN0YWxsX2VsZW1lbnQgKENPTkZJR19OT0RFLCAmbm9faG9zdG5hbWVfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChDT05GSUdfTk9ERSwgJnBhc3N3b3JkX2NtZCk7CisgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZwYXNzd29yZF90ZXh0X2NtZCk7CisgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZlbmFibGVfcGFzc3dvcmRfY21kKTsKKyAgaW5zdGFsbF9lbGVtZW50IChDT05GSUdfTk9ERSwgJmVuYWJsZV9wYXNzd29yZF90ZXh0X2NtZCk7CisgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZub19lbmFibGVfcGFzc3dvcmRfY21kKTsKKyAgaWYgKHRlcm1pbmFsKQorICAgIHsKKyAgICAgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZjb25maWdfbG9nX3N0ZG91dF9jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChDT05GSUdfTk9ERSwgJm5vX2NvbmZpZ19sb2dfc3Rkb3V0X2NtZCk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKENPTkZJR19OT0RFLCAmY29uZmlnX2xvZ19maWxlX2NtZCk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKENPTkZJR19OT0RFLCAmbm9fY29uZmlnX2xvZ19maWxlX2NtZCk7CisgICAgICBpbnN0YWxsX2VsZW1lbnQgKENPTkZJR19OT0RFLCAmY29uZmlnX2xvZ19zeXNsb2dfY21kKTsKKyAgICAgIGluc3RhbGxfZWxlbWVudCAoQ09ORklHX05PREUsICZub19jb25maWdfbG9nX3N5c2xvZ19jbWQpOworICAgICAgaW5zdGFsbF9lbGVtZW50IChDT05GSUdfTk9ERSwgJmNvbmZ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yogRG9jdW1lbnRhdGlvbiBvZiB0aGlzIGNvbW1hbmQuICovCisgIGludCBkYWVtb247ICAgICAgICAgICAgICAgICAgIC8qIERhZW1vbiB0byB3aGljaCB0aGlzIGNvbW1hbmQgYmVsb25nLiAqLworICB2ZWN0b3Igc3RydmVjOwkJLyogUG9pbnRpbmcgb3V0IGVhY2ggZGVzY3JpcHRpb24gdmVjdG9yLiAqLworICBpbnQgY21kc2l6ZTsJCQkvKiBDb21tYW5kIGluZGV4IGNvdW50LiAqLworICBjaGFyICpjb25maWc7CQkJLyogQ29uZmlndXJhdGlvbiBzdHJpbmcgKi8KKyAgdmVjdG9yIHN1YmNvbmZpZzsJCS8qIFN1YiBjb25maWd1cmF0aW9uIHN0cmluZyAqLworfTsKKworLyogQ29tbWFuZCBkZXNjcmlwdGlvbiBzdHJ1Y3R1cmUuICovCitzdHJ1Y3QgZGVzYworeworICBjaGFyICpjbWQ7CQkJLyogQ29tbWFuZCBzdHJpbmcuICovCisgIGNoYXIgKnN0cjsJCQkvKiBDb21tYW5kJ3MgZGVzY3JpcHRpb24uICovCit9OworCisvKiBSZXR1cm4gdmFsdWUgb2YgdGhlIGNvbW1hbmRzLiAqLworI2RlZmluZSBDTURfU1VDQ0VTUyAgICAgICAgICAgICAgMAorI2RlZmluZSBDTURfV0FSTklORyAgICAgICAgICAgICAgMQorI2RlZmluZSBDTURfRVJSX05PX01BVENIICAgICAgICAgMgorI2RlZmluZSBDTURfRVJSX0FNQklHVU9VUyAgICAgICAgMworI2RlZmluZSBDTURfRVJSX0lOQ09NUExFVEUgICAgICAgNAorI2RlZmluZSBDTURfRVJSX0VYRUVEX0FSR0NfTUFYICAgNQorI2RlZmluZSBDTURfRVJSX05PVEhJTkdfVE9ETyAgICAgNgorI2RlZmluZSBDTURfQ09NUExFVEVfRlVMTF9NQVRDSCAgNworI2RlZmluZSBDTURfQ09NUExFVEVfTUFUQ0ggICAgICAgOAorI2RlZmluZSBDTURfQ09NUExFVEVfTElTVF9NQV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bnN0YWxsOyBkbworICAgICAgZm9yIGFjX2V4ZWNfZXh0IGluICcnICRhY19leGVjdXRhYmxlX2V4dGVuc2lvbnM7IGRvCisgICAgICAgIGlmICRhc19leGVjdXRhYmxlX3AgIiRhc19kaXIvJGFjX3Byb2ckYWNfZXhlY19leHQiOyB0aGVuCisgICAgICAgICAgaWYgdGVzdCAkYWNfcHJvZyA9IGluc3RhbGwgJiYKKyAgICAgICAgICAgIGdyZXAgZHNwbXNnICIkYXNfZGlyLyRhY19wcm9nJGFjX2V4ZWNfZXh0IiA+L2Rldi9udWxsIDI+JjE7IHRoZW4KKyAgICAgICAgICAgICMgQUlYIGluc3RhbGwuICBJdCBoYXMgYW4gaW5jb21wYXRpYmxlIGNhbGxpbmcgY29udmVudGlvbi4KKyAgICAgICAgICAgIDoKKyAgICAgICAgICBlbGlmIHRlc3QgJGFjX3Byb2cgPSBpbnN0YWxsICYmCisgICAgICAgICAgICBncmVwIHB3cGx1cyAiJGFzX2Rpci8kYWNfcHJvZyRhY19leGVjX2V4dCIgPi9kZXYvbnVsbCAyPiYxOyB0aGVuCisgICAgICAgICAgICAjIHByb2dyYW0tc3BlY2lmaWMgaW5zdGFsbCBzY3JpcHQgdXNlZCBieSBIUCBwd3BsdXMtLWRvbid0IHVzZS4KKyAgICAgICAgICAgIDoKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBhY19jdl9wYXRoX2luc3RhbGw9IiRhc19kaXIvJGFjX3Byb2ckYWNfZXhlY19leHQgLWMiCisgICAgICAgICAgICBicmVhayAzCisgICAgICAgICAgZmkKKyAgICAgICAgZmkKKyAgICAgIGRvbmUKKyAgICBkb25lCisgICAgOzsKK2VzYWMKK2RvbmUKKworCitmaQorICBpZiB0ZXN0ICIke2FjX2N2X3BhdGhfaW5zdGFsbCtzZXR9IiA9IHNldDsgdGhlbgorICAgIElOU1RBTEw9JGFjX2N2X3BhdGhfaW5zdGFsbAorICBlbHNlCisgICAgIyBBcyBhIGxhc3QgcmVzb3J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worICAgICsrZm9vOworICB9CisgIHsgLyogU3VuIFNDMS4wIEFOU0kgY29tcGlsZXIgcmVqZWN0cyB0aGlzIC0tIGJ1dCBub3QgdGhlIGFib3ZlLiAqLworICAgIHR5cGVkZWYgY29uc3QgaW50ICppcHRyOworICAgIGlwdHIgcCA9IDA7CisgICAgKytwOworICB9CisgIHsgLyogQUlYIFhMIEMgMS4wMi4wLjAgcmVqZWN0cyB0aGlzIHNheWluZworICAgICAgICJrLmMiLCBsaW5lIDIuMjc6IDE1MDYtMDI1IChTKSBPcGVyYW5kIG11c3QgYmUgYSBtb2RpZmlhYmxlIGx2YWx1ZS4gKi8KKyAgICBzdHJ1Y3QgcyB7IGludCBqOyBjb25zdCBpbnQgKmFwWzNdOyB9OworICAgIHN0cnVjdCBzICpiOyBiLT5qID0gNTsKKyAgfQorICB7IC8qIFVMVFJJWC0zMiBWMy4xIChSZXYgOSkgdmNjIHJlamVjdHMgdGhpcyAqLworICAgIGNvbnN0IGludCBmb28gPSAxMDsKKyAgfQorI2VuZGlmCisKKyAgOworICByZXR1cm4gMDsKK30KK19BQ0VPRgorcm0gLWYgY29uZnRlc3QuJGFjX29iamV4dAoraWYgeyAoZXZhbCBlY2hvICIkYXNfbWU6JExJTkVOTzogXCIkYWNfY29tcGlsZVwiIikgPiY1CisgIChldmFsICRhY19jb21waWxlKSAyPiY1CisgIGFjX3N0YXR1cz0kPworICBlY2hvICIkYXNfbWU6JExJTkVOTzogXCQ/ID0gJGFjX3N0YXR1cyIgPiY1CisgIChleGl0ICRhY19zdGF0dXMpOyB9ICYmCisgICAgICAgICB7IGFjX3RyeT0ndGVzdCAtcyBjb25mdGVzdC4kYWNfb2JqZXh0JworICB7IChldmFsIGVjaG8gIiRhc19tZTokTElORU5POiBcIiRhY190cnlcIiIpID4mNQorICAoZXZhbCAkYWNfdHJ5KSAyPiY1CisgIGFjX3N0YXR1cz0kPworICBlY2hvICIkYXNfbWU6JExJTkVOTzogXCQ/ID0gJGFjX3N0YXR1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AgICAgZXh0ZXJuICJDIgorIyAgZW5kaWYKKyAgIGludCBGNzdfRFVNTVlfTUFJTigpIHsgcmV0dXJuIDE7IH0KKyNlbmRpZgoraW50CittYWluICgpCit7CittYWluICgpOworICA7CisgIHJldHVybiAwOworfQorX0FDRU9GCitybSAtZiBjb25mdGVzdC4kYWNfb2JqZXh0IGNvbmZ0ZXN0JGFjX2V4ZWV4dAoraWYgeyAoZXZhbCBlY2hvICIkYXNfbWU6JExJTkVOTzogXCIkYWNfbGlua1wiIikgPiY1CisgIChldmFsICRhY19saW5rKSAyPiY1CisgIGFjX3N0YXR1cz0kPworICBlY2hvICIkYXNfbWU6JExJTkVOTzogXCQ/ID0gJGFjX3N0YXR1cyIgPiY1CisgIChleGl0ICRhY19zdGF0dXMpOyB9ICYmCisgICAgICAgICB7IGFjX3RyeT0ndGVzdCAtcyBjb25mdGVzdCRhY19leGVleHQnCisgIHsgKGV2YWwgZWNobyAiJGFzX21lOiRMSU5FTk86IFwiJGFjX3RyeVwiIikgPiY1CisgIChldmFsICRhY190cnkpIDI+JjUKKyAgYWNfc3RhdHVzPSQ/CisgIGVjaG8gIiRhc19tZTokTElORU5POiBcJD8gPSAkYWNfc3RhdHVzIiA+JjUKKyAgKGV4aXQgJGFjX3N0YXR1cyk7IH07IH07IHRoZW4KKyAgYWNfY3ZfbGliX3JlYWRsaW5lX21haW49eWVzCitlbHNlCisgIGVjaG8gIiRhc19tZTogZmFpbGVkIHByb2dyYW0gd2FzOiIgPiY1CitjYXQgY29uZnRlc3QuJGFjX2V4dCA+JjUKK2FjX2N2X2xpYl9yZWFkbGluZV9tYWluPW5vCitmaQorcm0gLWYgY29uZnRlc3QuJGFjX29iamV4dCBjb25mdGVzdCRhY19leGVleHQgY29uZnRlc3QuJGFjX2V4dAorTElCUz0kYWNfY2hlY2tfbGliX3NhdmVfTElCUworZmkKK2VjaG8gIiRhc19tZTokTElORU5POiByZXN1bHQ6ICRhY19jdl9saWJfcmVhZGxpbmVfbWFpbi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kVfUFJPQ19ORVRfSUZfSU5FVDYgMQorX0FDRU9GCisKKyAgSUZfUFJPQz1pZl9wcm9jLm8KK2ZpCisKKworZWNobyAiJGFzX21lOiRMSU5FTk86IGNoZWNraW5nIGlwZm9yd2FyZCBtZXRob2QgY2hlY2siID4mNQorZWNobyAkRUNIT19OICJjaGVja2luZyBpcGZvcndhcmQgbWV0aG9kIGNoZWNrLi4uICRFQ0hPX0MiID4mNgoraWYgdGVzdCAiJHt6ZWJyYV9pcGZvcndhcmRfcGF0aCtzZXR9IiA9IHNldDsgdGhlbgorICBlY2hvICRFQ0hPX04gIihjYWNoZWQpICRFQ0hPX0MiID4mNgorZWxzZQorICBmb3IgemVicmFfaXBmb3J3YXJkX3BhdGggaW4gL3Byb2MvbmV0L3NubXAgL2Rldi9pcCAvZGV2L251bGw7CitkbworICB0ZXN0IHhgbHMgJHplYnJhX2lwZm9yd2FyZF9wYXRoIDI+L2Rldi9udWxsYCA9IHgiJHplYnJhX2lwZm9yd2FyZF9wYXRoIiAmJiBicmVhaworZG9uZQorY2FzZSAkemVicmFfaXBmb3J3YXJkX3BhdGggaW4KKyAgIi9wcm9jL25ldC9zbm1wIikgIElQRk9SV0FSRD1pcGZvcndhcmRfcHJvYy5vCisgICAgICAgICAgICAgICAgICAgICB6ZWJyYV9pcGZvcndhcmRfcGF0aD0icHJvYyI7OworICAiL2Rldi9pcCIpCisgICAgICAgICAgICAgICAgICAgICBjYXNlICIkaG9zdCIgaW4KKyAgICAgICAgICAgICAgICAgICAgICAgKi1uZWMtc3lzdjQqKSAgSVBGT1JXQVJEPWlwZm9yd2FyZF9ld3MubworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ZWJyYV9pcGZvcndhcmRfcGF0aD0iZXdzIjs7CisgICAgICAgICAgICAgICAgICAgICAgICopICAgICAgICAgICAgIElQRk9SV0FSRD1pcGZvcndhcmRfc29sYXJpcy5vCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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guKlwpWyRdTElORU5PXChbXickYXNfY3JfYWxudW0nX11cKSxcMVwyXDFcMywKKyAgICAgIHQgbG9vcAorICAgICAgcywtJCwsCisgICAgICBzLF5bJyRhc19jcl9kaWdpdHMnXSpcbiwsCisgICAgJyA+JGFzX21lLmxpbmVubyAmJgorICBjaG1vZCAreCAkYXNfbWUubGluZW5vIHx8CisgICAgeyB7IGVjaG8gIiRhc19tZTokTElORU5POiBlcnJvcjogY2Fubm90IGNyZWF0ZSAkYXNfbWUubGluZW5vOyByZXJ1biB3aXRoIGEgUE9TSVggc2hlbGwiID4mNQorZWNobyAiJGFzX21lOiBlcnJvcjogY2Fubm90IGNyZWF0ZSAkYXNfbWUubGluZW5vOyByZXJ1biB3aXRoIGEgUE9TSVggc2hlbGwiID4mMjt9CisgICB7IChleGl0IDEpOyBleGl0IDE7IH07IH0KKworICAjIERvbid0IHRyeSB0byBleGVjIGFzIGl0IGNoYW5nZXMgJFswXSwgY2F1c2luZyBhbGwgc29ydCBvZiBwcm9ibGVtcworICAjICh0aGUgZGlybmFtZSBvZiAkWzBdIGlzIG5vdCB0aGUgcGxhY2Ugd2hlcmUgd2UgbWlnaHQgZmluZCB0aGUKKyAgIyBvcmlnaW5hbCBhbmQgc28gb24uICBBdXRvY29uZiBpcyBlc3BlY2lhbGx5IHNlbnNpYmxlIHRvIHRoaXMpLgorICAuIC4vJGFzX21lLmxpbmVubworICAjIEV4aXQgc3RhdHVzIGlzIHRoYXQgb2YgdGhlIGxhc3QgY29tbWFuZC4KKyAgZXhpdAorfQorCisKK2Nhc2UgYGVjaG8gInRlc3RpbmdcYyI7IGVjaG8gMSwyLDNgLGBlY2hvIC1uIHRlc3Rpbmc7IGVjaG8gMSwyLDNgIGluCisgICpjKiwtbiopIEVDSE9fTj0gRUNIT19DPScKKycgRUNIT19UPScJJyA7OworICAqYyosKiAgKSBFQ0hPX049LW4gRUNIT19DPSBFQ0hPX1Q9IDs7CisgICopICAgICAgIEVDSE9fTj0gRUNIT19DP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TkVUX0lGX0lORVQ2KQorICBJRl9QUk9DPWlmX3Byb2MubworZmkKK0FDX1NVQlNUKElGX1BST0MpCisKK2RubCAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorZG5sIGNoZWNrIGlwZm9yd2FyZCBkZXRlY3QgbWV0aG9kCitkbmwgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KK0FDX0NBQ0hFX0NIRUNLKGlwZm9yd2FyZCBtZXRob2QgY2hlY2ssIHplYnJhX2lwZm9yd2FyZF9wYXRoLAorW2ZvciB6ZWJyYV9pcGZvcndhcmRfcGF0aCBpbiAvcHJvYy9uZXQvc25tcCAvZGV2L2lwIC9kZXYvbnVsbDsKK2RvCisgIHRlc3QgeGBscyAkemVicmFfaXBmb3J3YXJkX3BhdGggMj4vZGV2L251bGxgID0geCIkemVicmFfaXBmb3J3YXJkX3BhdGgiICYmIGJyZWFrCitkb25lCitjYXNlICR6ZWJyYV9pcGZvcndhcmRfcGF0aCBpbgorICAiL3Byb2MvbmV0L3NubXAiKSAgSVBGT1JXQVJEPWlwZm9yd2FyZF9wcm9jLm8KKyAgICAgICAgICAgICAgICAgICAgIHplYnJhX2lwZm9yd2FyZF9wYXRoPSJwcm9jIjs7CisgICIvZGV2L2lwIikgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgIiRob3N0IiBpbgorICAgICAgICAgICAgICAgICAgICAgICAqLW5lYy1zeXN2NCopICBJUEZPUldBUkQ9aXBmb3J3YXJkX2V3cy5vCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHplYnJhX2lwZm9yd2FyZF9wYXRoPSJld3MiOzsKKyAgICAgICAgICAgICAgICAgICAgICAgKikgICAgICAgICAgICAgSVBGT1JXQVJEPWlwZm9yd2FyZF9zb2xhcmlzLm8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemVicmFfaXBmb3J3YXJkX3BhdGg9InNvbGFyaX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cmludGYgKHpsLT5mcCwgIiVzOiAiLCB6bG9nX3Byb3RvX25hbWVzW3psLT5wcm90b2NvbF0pOworICAgICAgdmZwcmludGYgKHpsLT5mcCwgZm9ybWF0LCBhcmdzW1pMT0dfRklMRV9JTkRFWF0pOworICAgICAgZnByaW50ZiAoemwtPmZwLCAiXG4iKTsKKyAgICAgIGZmbHVzaCAoemwtPmZwKTsKKyAgICB9CisKKyAgLyogc3Rkb3V0IG91dHB1dC4gKi8KKyAgaWYgKHpsLT5mbGFncyAmIFpMT0dfU1RET1VUKQorICAgIHsKKyAgICAgIHRpbWVfcHJpbnQgKHN0ZG91dCk7CisgICAgICBpZiAoemwtPnJlY29yZF9wcmlvcml0eSkgZnByaW50ZiAoc3Rkb3V0LCAiJXM6ICIsIHpsb2dfcHJpb3JpdHlbcHJpb3JpdHldKTsKKyAgICAgIGZwcmludGYgKHN0ZG91dCwgIiVzOiAiLCB6bG9nX3Byb3RvX25hbWVzW3psLT5wcm90b2NvbF0pOworICAgICAgdmZwcmludGYgKHN0ZG91dCwgZm9ybWF0LCBhcmdzW1pMT0dfU1RET1VUX0lOREVYXSk7CisgICAgICBmcHJpbnRmIChzdGRvdXQsICJcbiIpOworICAgICAgZmZsdXNoIChzdGRvdXQpOworICAgIH0KKworICAvKiBzdGRlcnIgb3V0cHV0LiAqLworICBpZiAoemwtPmZsYWdzICYgWkxPR19TVERFUlIpCisgICAgeworICAgICAgdGltZV9wcmludCAoc3RkZXJyKTsKKyAgICAgIGlmICh6bC0+cmVjb3JkX3ByaW9yaXR5KSBmcHJpbnRmIChzdGRlcnIsICIlczogIiwgemxvZ19wcmlvcml0eVtwcmlvcml0eV0pOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJXM6ICIsIHpsb2dfcHJvdG9fbmFtZXNbemwtPnByb3RvY29sXSk7CisgICAgICB2ZnByaW50ZiAoc3RkZXJyLCBmb3JtYXQsIGFyZ3NbWkxPR19TVERFUlJfSU5ERVhdKTsKKyAgICAgIGZ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ID0gMDsgaW5kZXggPCBaTE9HX01BWF9JTkRFWDsgaW5kZXgrKykKKyAgICB2YV9zdGFydChhcmdzW2luZGV4XSwgZm9ybWF0KTsKKworICB2emxvZyAoemwsIExPR19XQVJOSU5HLCBmb3JtYXQsIGFyZ3MpOworCisgIGZvciAoaW5kZXggPSAwOyBpbmRleCA8IFpMT0dfTUFYX0lOREVYOyBpbmRleCsrKQorICAgIHZhX2VuZCAoYXJnc1tpbmRleF0pOworfQorCit2b2lkCitwbG9nX2luZm8gKHN0cnVjdCB6bG9nICp6bCwgY29uc3QgY2hhciAqZm9ybWF0LCAuLi4pCit7CisgIHZhX2xpc3QgYXJnc1taTE9HX01BWF9JTkRFWF07CisgIGludCBpbmRleDsKKworICBmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBaTE9HX01BWF9JTkRFWDsgaW5kZXgrKykKKyAgICB2YV9zdGFydChhcmdzW2luZGV4XSwgZm9ybWF0KTsKKworICB2emxvZyAoemwsIExPR19JTkZPLCBmb3JtYXQsIGFyZ3MpOworCisgIGZvciAoaW5kZXggPSAwOyBpbmRleCA8IFpMT0dfTUFYX0lOREVYOyBpbmRleCsrKQorICAgIHZhX2VuZCAoYXJnc1tpbmRleF0pOworfQorCit2b2lkCitwbG9nX25vdGljZSAoc3RydWN0IHpsb2cgKnpsLCBjb25zdCBjaGFyICpmb3JtYXQsIC4uLikKK3sKKyAgdmFfbGlzdCBhcmdzW1pMT0dfTUFYX0lOREVYXTsKKyAgaW50IGluZGV4OworCisgIGZvciAoaW5kZXggPSAwOyBpbmRleCA8IFpMT0dfTUFYX0lOREVYOyBpbmRleCsrKQorICAgIHZhX3N0YXJ0KGFyZ3NbaW5kZXhdLCBmb3JtYXQpOworCisgIHZ6bG9nICh6bCwgTE9HX05PVElDRSwgZm9ybWF0LCBhcmdzKTsKKworICBmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBaTE9HX01BWF9JTkRFWDsgaW5kZXgrKykKKyAgICB2YV9lbmQgKGFyZ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T5mYWNpbGl0eSk7CisgIAorICByZXR1cm4gemw7Cit9CisKK3ZvaWQKK2Nsb3NlemxvZyAoc3RydWN0IHpsb2cgKnpsKQoreworICBjbG9zZWxvZygpOworICBmY2xvc2UgKHpsLT5mcCk7CisKKyAgWEZSRUUgKE1UWVBFX1pMT0csIHpsKTsKK30KKworLyogQ2FsbGVkIGZyb20gY29tbWFuZC5jLiAqLwordm9pZAoremxvZ19zZXRfZmxhZyAoc3RydWN0IHpsb2cgKnpsLCBpbnQgZmxhZ3MpCit7CisgIGlmICh6bCA9PSBOVUxMKQorICAgIHpsID0gemxvZ19kZWZhdWx0OworCisgIHpsLT5mbGFncyB8PSBmbGFnczsKK30KKwordm9pZAoremxvZ19yZXNldF9mbGFnIChzdHJ1Y3QgemxvZyAqemwsIGludCBmbGFncykKK3sKKyAgaWYgKHpsID09IE5VTEwpCisgICAgemwgPSB6bG9nX2RlZmF1bHQ7CisKKyAgemwtPmZsYWdzICY9IH5mbGFnczsKK30KKworaW50Cit6bG9nX3NldF9maWxlIChzdHJ1Y3QgemxvZyAqemwsIGludCBmbGFncywgY2hhciAqZmlsZW5hbWUpCit7CisgIEZJTEUgKmZwOworCisgIC8qIFRoZXJlIGlzIG9wZW5kIGZpbGUuICAqLworICB6bG9nX3Jlc2V0X2ZpbGUgKHpsKTsKKworICAvKiBTZXQgZGVmYXVsdCB6bC4gKi8KKyAgaWYgKHpsID09IE5VTEwpCisgICAgemwgPSB6bG9nX2RlZmF1bHQ7CisKKyAgLyogT3BlbiBmaWxlLiAqLworICBmcCA9IGZvcGVuIChmaWxlbmFtZSwgImEiKTsKKyAgaWYgKGZwID09IE5VTEwpCisgICAgcmV0dXJuIDA7CisKKyAgLyogU2V0IGZsYWdzLiAqLworICB6bC0+ZmlsZW5hbWUgPSBzdHJkdXAgKGZpbGVuYW1lKTsKKyAgemwtPmZsYWdzIHw9IFpMT0dfRklMRTsKKyAgemwtPmZwID0gZnA7CisKKyAgcmV0dXJuIDE7Cit9CisK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OSBUZW1wbGUgUGxhY2UgLSBTdWl0ZSAzMzAsIEJvc3RvbiwgTUEKKyAqIDAyMTExLTEzMDcsIFVTQS4gIAorICovCisKKyNpZm5kZWYgX1pFQlJBX0xPR19ICisjZGVmaW5lIF9aRUJSQV9MT0dfSAorCisjaW5jbHVkZSA8c3lzbG9nLmg+CisKKyNkZWZpbmUgWkxPR19OT0xPRyAgICAgICAgICAgICAgMHgwMAorI2RlZmluZSBaTE9HX0ZJTEUJCTB4MDEKKyNkZWZpbmUgWkxPR19TWVNMT0cJCTB4MDIKKyNkZWZpbmUgWkxPR19TVERPVVQgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBaTE9HX1NUREVSUiAgICAgICAgICAgICAweDA4CisKKyNkZWZpbmUgWkxPR19OT0xPR19JTkRFWCAgICAgICAgMAorI2RlZmluZSBaTE9HX0ZJTEVfSU5ERVggICAgICAgICAxCisjZGVmaW5lIFpMT0dfU1lTTE9HX0lOREVYICAgICAgIDIKKyNkZWZpbmUgWkxPR19TVERPVVRfSU5ERVggICAgICAgMworI2RlZmluZSBaTE9HX1NUREVSUl9JTkRFWCAgICAgICA0CisjZGVmaW5lIFpMT0dfTUFYX0lOREVYICAgICAgICAgIDUKKwordHlwZWRlZiBlbnVtIAoreworICBaTE9HX05PTkUsCisgIFpMT0dfREVGQVVMVCwKKyAgWkxPR19aRUJSQSwKKyAgWkxPR19SSVAsCisgIFpMT0dfQkdQLAorICBaTE9HX09TUEYsCisgIFpMT0dfUklQTkcsICAKKyAgWkxPR19PU1BGNiwKKyAgWkxPR19JU0lTLAorICBaTE9HX01BU0MKK30gemxvZ19wcm90b190OworCitzdHJ1Y3QgemxvZyAKK3sKKyAgY29uc3QgY2hhciAqaWRlbnQ7CisgIHpsb2dfcHJvdG9fdCBwcm90b2NvbDsKKyAgaW50IGZsYWdzOworICBGSUxFICpmcDsKKyAgY2hhciAqZmlsZW5hbWU7CisgIGludCBzeXNsb2c7CisgIGludCBzdGF0OworICBpbnQgY29ub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ChpbnQgdHlwZSkKK3sKKyAgbXN0YXRbdHlwZV0uYWxsb2MrKzsKK30KKworLyogRGVjcmVtZW50IGFsbG9jYXRpb24gY291bnRlci4gKi8KK3ZvaWQKK2FsbG9jX2RlYyAoaW50IHR5cGUpCit7CisgIG1zdGF0W3R5cGVdLmFsbG9jLS07Cit9CisMCisvKiBMb29raW5nIHVwIG1lbW9yeSBzdGF0dXMgZnJvbSB2dHkgaW50ZXJmYWNlLiAqLworI2luY2x1ZGUgInZlY3Rvci5oIgorI2luY2x1ZGUgInZ0eS5oIgorI2luY2x1ZGUgImNvbW1hbmQuaCIKKworLyogRm9yIHByZXR0eSBwcmludG5nIG9mIG1lbW9yeSBhbGxvY2F0ZSBpbmZvcm1hdGlvbi4gKi8KK3N0cnVjdCBtZW1vcnlfbGlzdAoreworICBpbnQgaW5kZXg7CisgIGNoYXIgKmZvcm1hdDsKK307CisKK3N0cnVjdCBtZW1vcnlfbGlzdCBtZW1vcnlfbGlzdF9saWJbXSA9Cit7CisgIHsgTVRZUEVfVE1QLCAgICAgICAgICAgICAgICAiVGVtcG9yYXJ5IG1lbW9yeSIgfSwKKyAgeyBNVFlQRV9ST1VURV9UQUJMRSwgICAgICAgICJSb3V0ZSB0YWJsZSAgICAgIiB9LAorICB7IE1UWVBFX1JPVVRFX05PREUsICAgICAgICAgIlJvdXRlIG5vZGUgICAgICAiIH0sCisgIHsgTVRZUEVfUklCLCAgICAgICAgICAgICAgICAiUklCICAgICAgICAgICAgICIgfSwKKyAgeyBNVFlQRV9ORVhUSE9QLCAgICAgICAgICAgICJOZXh0aG9wICAgICAgICAgIiB9LAorICB7IE1UWVBFX0xJTktfTElTVCwgICAgICAgICAgIkxpbmsgTGlzdCAgICAgICAiIH0sCisgIHsgTVRZUEVfTElOS19OT0RFLCAgICAgICAgICAiTGluayBOb2RlICAgICAgICIgfSwKKyAgeyBNVFlQRV9IQVNILCAgICAgICAgICAgICAgICJIYXNoICAgICAgICAgICAgIiB9LAorICB7IE1U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AgICAgICAiIH0sCisgIHsgTVRZUEVfS0VZQ0hBSU4sICAgICAgICAgICAiS2V5IGNoYWluICAgICAgICIgfSwKKyAgeyBNVFlQRV9LRVksICAgICAgICAgICAgICAgICJLZXkgICAgICAgICAgICAgIiB9LAorICB7IE1UWVBFX1ZUWSwgICAgICAgICAgICAgICAgIlZUWSAgICAgICAgICAgICAiIH0sCisgIHsgLTEsIE5VTEwgfQorfTsKKworc3RydWN0IG1lbW9yeV9saXN0IG1lbW9yeV9saXN0X2JncFtdID0KK3sKKyAgeyBNVFlQRV9CR1BfUEVFUiwgICAgICAgICAgICAgICAiQkdQIHBlZXIiIH0sCisgIHsgTVRZUEVfQVRUUiwgICAgICAgICAgICAgICAgICAgIkJHUCBhdHRyaWJ1dGUiIH0sCisgIHsgTVRZUEVfQVNfUEFUSCwgICAgICAgICAgICAgICAgIkJHUCBhc3BhdGgiIH0sCisgIHsgTVRZUEVfQVNfU0VHLCAgICAgICAgICAgICAgICAgIkJHUCBhc3BhdGggc2VnIiB9LAorICB7IE1UWVBFX0FTX1NUUiwgICAgICAgICAgICAgICAgICJCR1AgYXNwYXRoIHN0ciIgfSwKKyAgeyAwLCBOVUxMIH0sCisgIHsgTVRZUEVfQkdQX1RBQkxFLCAgICAgICAgICAgICAgIkJHUCB0YWJsZSIgfSwKKyAgeyBNVFlQRV9CR1BfTk9ERSwgICAgICAgICAgICAgICAiQkdQIG5vZGUiIH0sCisgIHsgTVRZUEVfQkdQX0FEVkVSVElTRV9BVFRSLCAgICAgIkJHUCBhZHYgYXR0ciIgfSwKKyAgeyBNVFlQRV9CR1BfQURWRVJUSVNFLCAgICAgICAgICAiQkdQIGFkdiIgfSwKKyAgeyBNVFlQRV9CR1BfQURKX0lOLCAgICAgICAgICAgICAiQkdQIGFkaiBpbiIgfSwKKyAgeyBNVFlQRV9CR1BfQURKX09VVCwgICAgICAgICAgICAiQkdQIGFkaiBvdXQiIH0sCisgIHsgMCwgTlVMTCB9LAorICB7IE1UWVBFX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SwgbWVtb3J5X2xpc3Rfb3NwZjYpOworICBzaG93X21lbW9yeV92dHkgKHZ0eSwgbWVtb3J5X2xpc3Rfc2VwYXJhdG9yKTsKKyAgc2hvd19tZW1vcnlfdnR5ICh2dHksIG1lbW9yeV9saXN0X2JncCk7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitBTElBUyAoc2hvd19tZW1vcnlfYWxsLAorICAgICAgIHNob3dfbWVtb3J5X2NtZCwKKyAgICAgICAic2hvdyBtZW1vcnkiLAorICAgICAgICJTaG93IHJ1bm5pbmcgc3lzdGVtIGluZm9ybWF0aW9uXG4iCisgICAgICAgIk1lbW9yeSBzdGF0aXN0aWNzXG4iKQorCitERUZVTiAoc2hvd19tZW1vcnlfbGliLAorICAgICAgIHNob3dfbWVtb3J5X2xpYl9jbWQsCisgICAgICAgInNob3cgbWVtb3J5IGxpYiIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiTWVtb3J5IHN0YXRpc3RpY3NcbiIKKyAgICAgICAiTGlicmFyeSBtZW1vcnlcbiIpCit7CisgIHNob3dfbWVtb3J5X3Z0eSAodnR5LCBtZW1vcnlfbGlzdF9saWIpOworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChzaG93X21lbW9yeV9yaXAsCisgICAgICAgc2hvd19tZW1vcnlfcmlwX2NtZCwKKyAgICAgICAic2hvdyBtZW1vcnkgcmlwIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJNZW1vcnkgc3RhdGlzdGljc1xuIgorICAgICAgICJSSVAgbWVtb3J5XG4iKQoreworICBzaG93X21lbW9yeV92dHkgKHZ0eSwgbWVtb3J5X2xpc3RfcmlwKTsKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoc2hvd19tZW1vcnlfYmdwLAorICAgICAgIHNob3dfbWVtb3J5X2JncF9jbWQsCisgICAgICAgInNob3cgbWVtb3J5IGJncCIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiTWVtb3J5IHN0YXRpc3RpY3NcbiIKKyAgICAgICAiQkdQIG1lbW9yeVxuIikKK3sKKyAgc2hvd19tZW1vcnlfdnR5ICh2dHksIG1lbW9yeV9saXN0X2JncCk7CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKHNob3dfbWVtb3J5X29zcGYsCisgICAgICAgc2hvd19tZW1vcnlfb3NwZl9jbWQsCisgICAgICAgInNob3cgbWVtb3J5IG9zcGYiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgIk1lbW9yeSBzdGF0aXN0aWNzXG4iCisgICAgICAgIk9TUEYgbWVtb3J5XG4iKQoreworICBzaG93X21lbW9yeV92dHkgKHZ0eSwgbWVtb3J5X2xpc3Rfb3NwZik7CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKHNob3dfbWVtb3J5X29zcGY2LAorICAgICAgIHNob3dfbWVtb3J5X29zcGY2X2NtZCwKKyAgICAgICAic2hvdyBtZW1vcnkgb3NwZjYiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgIk1lbW9yeSBzdGF0aXN0aWNzXG4iCisgICAgICAgIk9TUEY2IG1lbW9yeVxuIikKK3sKKyAgc2hvd19tZW1vcnlfdnR5ICh2dHksIG1lbW9yeV9saXN0X29zcGY2KTsKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCisKK0RFRlVOIChzaG93X21lbW9yeV9pc2lzLAorICAgICAgIHNob3dfbWVtb3J5X2lzaXNfY21kLAorICAgICAgICJzaG93IG1lbW9yeSBpc2lzIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgICJNZW1vcnkgc3RhdGlzdGljc1xuIgorICAgICAgICJJU0lTIG1lbW9yeVxuIikKK3sKKyAgc2hvd19tZW1vcnlfdnR5ICh2dHksIG1lbW9yeV9saXN0X2lzaXMpOworICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK3ZvaWQKK21lbW9yeV9pbml0ICgpCit7Cisg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IpOworICAgICAgVU5TRVRfRkxBRyAocmliLT5mbGFncywgWkVCUkFfRkxBR19TRUxFQ1RFRCk7CisgICAgfQorfQorCisvKiBDb3JlIGZ1bmN0aW9uIGZvciBwcm9jZXNzaW5nIHJvdXRpbmcgaW5mb3JtYXRpb24gYmFzZS4gKi8KK3ZvaWQKK3JpYl9wcm9jZXNzIChzdHJ1Y3Qgcm91dGVfbm9kZSAqcm4sIHN0cnVjdCByaWIgKmRlbCkKK3sKKyAgc3RydWN0IHJpYiAqcmliOworICBzdHJ1Y3QgcmliICpuZXh0OworICBzdHJ1Y3QgcmliICpmaWIgPSBOVUxMOworICBzdHJ1Y3QgcmliICpzZWxlY3QgPSBOVUxMOworCisgIGZvciAocmliID0gcm4tPmluZm87IHJpYjsgcmliID0gbmV4dCkKKyAgICB7CisgICAgICBuZXh0ID0gcmliLT5uZXh0OworCisgICAgICAvKiBDdXJyZW50bHkgaW5zdGFsbGVkIHJpYi4gKi8KKyAgICAgIGlmIChDSEVDS19GTEFHIChyaWItPmZsYWdzLCBaRUJSQV9GTEFHX1NFTEVDVEVEKSkKKwlmaWIgPSByaWI7CisKKyAgICAgIC8qIFNraXAgdW5yZWFjaGFibGUgbmV4dGhvcC4gKi8KKyAgICAgIGlmICghIG5leHRob3BfYWN0aXZlX3VwZGF0ZSAocm4sIHJpYiwgMCkpCisJY29udGludWU7CisKKyAgICAgIC8qIEluZmluaXQgZGlzdGFuY2UuICovCisgICAgICBpZiAocmliLT5kaXN0YW5jZSA9PSBESVNUQU5DRV9JTkZJTklUWSkKKwljb250aW51ZTsKKworICAgICAgLyogTmV3bHkgc2VsZWN0ZWQgcmliLiAqLworICAgICAgaWYgKCEgc2VsZWN0IHx8IHJpYi0+ZGlzdGFuY2UgPCBzZWxlY3QtPmRpc3RhbmNlIAorCSAgfHwgcmliLT50eXBlID09IFpFQlJBX1JPVVRFX0NPTk5FQ1QpCisJc2VsZWN0ID0gcmliOworICAgIH0KKworICAvKiBEZWxldGVkIHJvd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HRob3AuICovCisgICAgICBuZXh0aG9wX2FjdGl2ZV91cGRhdGUgKHJuLCBmaWIsIDEpOworICAgIH0KKworICAvKiBJbnN0YWxsIG5ldyByaWIgaW50byBmb3J3YXJkaW5nIHRhYmxlLiAqLworICBpZiAoc2VsZWN0KQorICAgIHsKKyAgICAgIC8qIFNldCByZWFsIG5leHRob3AuICovCisgICAgICBuZXh0aG9wX2FjdGl2ZV91cGRhdGUgKHJuLCBzZWxlY3QsIDEpOworCisgICAgICBpZiAoISBSSUJfU1lTVEVNX1JPVVRFIChzZWxlY3QpKQorCXJpYl9pbnN0YWxsX2tlcm5lbCAocm4sIHNlbGVjdCk7CisgICAgICBTRVRfRkxBRyAoc2VsZWN0LT5mbGFncywgWkVCUkFfRkxBR19TRUxFQ1RFRCk7CisgICAgICByZWRpc3RyaWJ1dGVfYWRkICgmcm4tPnAsIHNlbGVjdCk7CisgICAgfQorfQorCisvKiBBZGQgUklCIHRvIGhlYWQgb2YgdGhlIHJvdXRlIG5vZGUuICovCit2b2lkCityaWJfYWRkbm9kZSAoc3RydWN0IHJvdXRlX25vZGUgKnJuLCBzdHJ1Y3QgcmliICpyaWIpCit7CisgIHN0cnVjdCByaWIgKmhlYWQ7CisKKyAgaGVhZCA9IHJuLT5pbmZvOworICBpZiAoaGVhZCkKKyAgICBoZWFkLT5wcmV2ID0gcmliOworICByaWItPm5leHQgPSBoZWFkOworICBybi0+aW5mbyA9IHJpYjsKK30KKwordm9pZAorcmliX2RlbG5vZGUgKHN0cnVjdCByb3V0ZV9ub2RlICpybiwgc3RydWN0IHJpYiAqcmliKQoreworICBpZiAocmliLT5uZXh0KQorICAgIHJpYi0+bmV4dC0+cHJldiA9IHJpYi0+cHJldjsKKyAgaWYgKHJpYi0+cHJldikKKyAgICByaWItPnByZXYtPm5leHQgPSByaWItPm5leHQ7CisgIGVsc2UKKyAgICBybi0+aW5mbyA9IHJpYi0+bmV4dDsKK30KKworaW50CityaWJfYWRkX2lwdjQgKGludCB0eXB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pYi0+dHlwZSA9PSBaRUJSQV9ST1VURV9DT05ORUNUKQorCXsKKwkgIG5leHRob3AgPSByaWItPm5leHRob3A7CisKKwkgIC8qIER1cGxpY2F0ZSBjb25uZWN0ZWQgcm91dGUgY29tZXMgaW4uICovCisJICBpZiAocmliLT50eXBlID09IHR5cGUKKwkgICAgICAmJiAoISB0YWJsZSB8fCByaWItPnRhYmxlID09IHRhYmxlKQorCSAgICAgICYmIG5leHRob3AgJiYgbmV4dGhvcC0+dHlwZSA9PSBORVhUSE9QX1RZUEVfSUZJTkRFWAorCSAgICAgICYmIG5leHRob3AtPmlmaW5kZXggPT0gaWZpbmRleCkKKwkgICAgeworCSAgICAgIHJpYi0+cmVmY250Kys7CisJICAgICAgcmV0dXJuIDAgOworCSAgICB9CisJfQorICAgICAgZWxzZSBpZiAocmliLT50eXBlID09IHR5cGUKKwkgICAgICAgJiYgKCEgdGFibGUgfHwgcmliLT50YWJsZSA9PSB0YWJsZSkpCisJeworCSAgc2FtZSA9IHJpYjsKKwkgIHJpYl9kZWxub2RlIChybiwgc2FtZSk7CisJICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworCSAgYnJlYWs7CisJfQorICAgIH0KKworICAvKiBBbGxvY2F0ZSBuZXcgcmliIHN0cnVjdHVyZS4gKi8KKyAgcmliID0gWE1BTExPQyAoTVRZUEVfUklCLCBzaXplb2YgKHN0cnVjdCByaWIpKTsKKyAgbWVtc2V0IChyaWIsIDAsIHNpemVvZiAoc3RydWN0IHJpYikpOworICByaWItPnR5cGUgPSB0eXBlOworICByaWItPmRpc3RhbmNlID0gZGlzdGFuY2U7CisgIHJpYi0+ZmxhZ3MgPSBmbGFnczsKKyAgcmliLT5tZXRyaWMgPSBtZXRyaWM7CisgIHJpYi0+dGFibGUgPSB0YWJsZTsKKyAgcmliLT5uZXh0aG9wX251bSA9IDA7CisgIHJpYi0+dXB0aW1lID0gdGltZSAoTlVMTCk7CisKKyAgLyogTmV4dGhvcCBzZXR0aW5ncy4g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b3V0ZS4gKi8KKyAgaWYgKHJpYi0+dHlwZSA9PSBaRUJSQV9ST1VURV9LRVJORUwgfHwgcmliLT50eXBlID09IFpFQlJBX1JPVVRFX0NPTk5FQ1QpCisgICAgZm9yIChuZXh0aG9wID0gcmliLT5uZXh0aG9wOyBuZXh0aG9wOyBuZXh0aG9wID0gbmV4dGhvcC0+bmV4dCkKKyAgICAgIFNFVF9GTEFHIChuZXh0aG9wLT5mbGFncywgTkVYVEhPUF9GTEFHX0ZJQik7CisKKyAgLyogTGluayBuZXcgcmliIHRvIG5vZGUuKi8KKyAgcmliX2FkZG5vZGUgKHJuLCByaWIpOworCisgIC8qIFByb2Nlc3MgdGhpcyByb3V0ZSBub2RlLiAqLworICByaWJfcHJvY2VzcyAocm4sIHNhbWUpOworCisgIC8qIEZyZWUgaW1wbGljaXQgcm91dGUuKi8KKyAgaWYgKHNhbWUpCisgICAgbmV3cmliX2ZyZWUgKHNhbWUpOworCisgIHJldHVybiAwOworfQorCitpbnQKK3JpYl9kZWxldGVfaXB2NCAoaW50IHR5cGUsIGludCBmbGFncywgc3RydWN0IHByZWZpeF9pcHY0ICpwLAorCQkgc3RydWN0IGluX2FkZHIgKmdhdGUsIHVuc2lnbmVkIGludCBpZmluZGV4LCBpbnQgdGFibGUpCit7CisgIHN0cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworICBzdHJ1Y3QgcmliICpmaWIgPSBOVUxMOworICBzdHJ1Y3QgcmliICpzYW1lID0gTlVMTDsKKyAgc3RydWN0IG5leHRob3AgKm5leHRob3A7CisgIGNoYXIgYnVmMVtCVUZTSVpdOworICBjaGFyIGJ1ZjJbQlVGU0laXTsKKworICAvKiBBcHBseSBtYXNrLiAqLworICBhcHBseV9tYXNrX2lwdjQgKHApOworCisgIC8qIExvb2t1cCByb3V0ZSBub2RlLiAqLworICBybiA9IHJvdXRlX25vZGVfbG9va3VwIChyaWJfdGFibGVfaXB2NCwgKHN0cnVjdCBw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kgICAgICAmJiBuZXh0aG9wICYmIG5leHRob3AtPnR5cGUgPT0gTkVYVEhPUF9UWVBFX0lGSU5ERVgKKwkgICAgICAmJiBuZXh0aG9wLT5pZmluZGV4ID09IGlmaW5kZXgpCisJICAgIHsKKwkgICAgICBpZiAocmliLT5yZWZjbnQpCisJCXsKKwkJICByaWItPnJlZmNudC0tOworCQkgIHJvdXRlX3VubG9ja19ub2RlIChybik7CisJCSAgcm91dGVfdW5sb2NrX25vZGUgKHJuKTsKKwkJICByZXR1cm4gMDsKKwkJfQorCSAgICAgIHNhbWUgPSByaWI7CisJICAgICAgYnJlYWs7CisJICAgIH0KKwl9CisgICAgICBlbHNlCisJeworCSAgaWYgKHJpYi0+dHlwZSA9PSB0eXBlCisJICAgICAgJiYgKCF0YWJsZSB8fCByaWItPnRhYmxlID09IHRhYmxlKSkKKwkgICAgeworCSAgICAgIHNhbWUgPSByaWI7CisJICAgICAgYnJlYWs7CisJICAgIH0KKwl9CisgICAgfQorCisgIC8qIElmIHNhbWUgdHlwZSBvZiByb3V0ZSBjYW4ndCBiZSBmb3VuZCBhbmQgdGhpcyBtZXNzYWdlIGlzIGZyb20KKyAgICAga2VybmVsLiAqLworICBpZiAoISBzYW1lKQorICAgIHsKKyAgICAgIGlmIChmaWIgJiYgdHlwZSA9PSBaRUJSQV9ST1VURV9LRVJORUwpCisJeworCSAgLyogVW5zZXQgZmxhZ3MuICovCisJICBmb3IgKG5leHRob3AgPSBmaWItPm5leHRob3A7IG5leHRob3A7IG5leHRob3AgPSBuZXh0aG9wLT5uZXh0KQorCSAgICBVTlNFVF9GTEFHIChuZXh0aG9wLT5mbGFncywgTkVYVEhPUF9GTEFHX0ZJQik7CisKKwkgIFVOU0VUX0ZMQUcgKGZpYi0+ZmxhZ3MsIFpFQlJBX0ZMQUdfU0VMRUNURUQpOworCX0KKyAgICAgIGVsc2UKKwl7CisJICBpZiAoSVNfWkVCUkFfREVCVUdfS0VSTkVMKQorCSAgICB7CisJICAgICAgaW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+aW5mbzsgcmliOyByaWIgPSByaWItPm5leHQpCisgICAgaWYgKHJpYi0+dHlwZSA9PSBaRUJSQV9ST1VURV9TVEFUSUMgJiYgcmliLT5kaXN0YW5jZSA9PSBzaS0+ZGlzdGFuY2UpCisgICAgICBicmVhazsKKyAgaWYgKCEgcmliKQorICAgIHsKKyAgICAgIHJvdXRlX3VubG9ja19ub2RlIChybik7CisgICAgICByZXR1cm47CisgICAgfQorCisgIC8qIExvb2t1cCBuZXh0aG9wLiAqLworICBmb3IgKG5leHRob3AgPSByaWItPm5leHRob3A7IG5leHRob3A7IG5leHRob3AgPSBuZXh0aG9wLT5uZXh0KQorICAgIGlmIChzdGF0aWNfaXB2NF9uZXh0aG9wX3NhbWUgKG5leHRob3AsIHNpKSkKKyAgICAgIGJyZWFrOworCisgIC8qIENhbid0IGZpbmQgbmV4dGhvcC4gKi8KKyAgaWYgKCEgbmV4dGhvcCkKKyAgICB7CisgICAgICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworICAgICAgcmV0dXJuOworICAgIH0KKyAgCisgIC8qIENoZWNrIG5leHRob3AuICovCisgIGlmIChyaWItPm5leHRob3BfbnVtID09IDEpCisgICAgeworICAgICAgcmliX2RlbG5vZGUgKHJuLCByaWIpOworICAgICAgcmliX3Byb2Nlc3MgKHJuLCByaWIpOworICAgICAgbmV3cmliX2ZyZWUgKHJpYik7CisgICAgICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIHJpYl91bmluc3RhbGwgKHJuLCByaWIpOworICAgICAgbmV4dGhvcF9kZWxldGUgKHJpYiwgbmV4dGhvcCk7CisgICAgICBuZXh0aG9wX2ZyZWUgKG5leHRob3ApOworICAgICAgcmliX3Byb2Nlc3MgKHJuLCByaWIpOworICAgIH0KKworICAvKiBVbmxvY2sgbm9kZS4gKi8KKyAgcm91dGVfdW5sb2NrX25vZGUgKHJuKTsKK30KKworLyogQWRkIHN0YXRpYyByb3V0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SBpZiAodXB0aW1lIDwgT05FX1dFRUtfU0VDT05EKQorCSAgICB2dHlfb3V0ICh2dHksICIsICVkZCUwMmRoJTAyZG0iLCAKKwkJICAgICB0bS0+dG1feWRheSwgdG0tPnRtX2hvdXIsIHRtLT50bV9taW4pOworCSAgZWxzZQorCSAgICB2dHlfb3V0ICh2dHksICIsICUwMmR3JWRkJTAyZGgiLCAKKwkJICAgICB0bS0+dG1feWRheS83LAorCQkgICAgIHRtLT50bV95ZGF5IC0gKCh0bS0+dG1feWRheS83KSAqIDcpLCB0bS0+dG1faG91cik7CisJfQorICAgICAgdnR5X291dCAodnR5LCAiJXMiLCBWVFlfTkVXTElORSk7CisgICAgfQorfQorCisjZGVmaW5lIFNIT1dfUk9VVEVfVjRfSEVBREVSICJDb2RlczogSyAtIGtlcm5lbCByb3V0ZSwgQyAtIGNvbm5lY3RlZCwgUyAtIHN0YXRpYywgUiAtIFJJUCwgTyAtIE9TUEYsJXMgSSAtIElTLUlTLCAlcyAgICAgICBCIC0gQkdQLCA+IC0gc2VsZWN0ZWQgcm91dGUsICogLSBGSUIgcm91dGUlcyVzIgorCitERUZVTiAoc2hvd19pcF9yb3V0ZSwKKyAgICAgICBzaG93X2lwX3JvdXRlX2NtZCwKKyAgICAgICAic2hvdyBpcCByb3V0ZSIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICBJUF9TVFIKKyAgICAgICAiSVAgcm91dGluZyB0YWJsZVxuIikKK3sKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworICBzdHJ1Y3QgcmliICpyaWI7CisgIGludCBmaXJzdCA9IDE7CisKKyAgLyogU2hvdyBhbGwgSVB2NCByb3V0ZXMuICovCisgIGZvciAocm4gPSByb3V0ZV90b3AgKHJpYl90YWJsZV9pcHY0KTsgcm47IHJuID0gcm91dGVfbmV4dCAocm4pKQorICAgIGZvciAocmliID0gcm4tPmluZm87IHJpYjsgcmliID0gcmliLT5uZXh0KQorICAgICAgeworCWlmIChmaXJzdCkKKwkgIHsKKwkgICAgdnR5X291dCAodnR5LCBTSE9XX1JPVVRFX1Y0X0hFQURFUiwgVlRZX05FV0xJTkUsIFZUWV9ORVdMSU5FLCBWVFlfTkVXTElORSwgVlRZX05FV0xJTkUpOworCSAgICBmaXJzdCA9IDA7CisJICB9CisJdnR5X3Nob3dfaXBfcm91dGUgKHZ0eSwgcm4sIHJpYik7CisgICAgICB9CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKHNob3dfaXBfcm91dGVfcHJlZml4X2xvbmdlciwKKyAgICAgICBzaG93X2lwX3JvdXRlX3ByZWZpeF9sb25nZXJfY21kLAorICAgICAgICJzaG93IGlwIHJvdXRlIEEuQi5DLkQvTSBsb25nZXItcHJlZml4ZXMiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgSVBfU1RSCisgICAgICAgIklQIHJvdXRpbmcgdGFibGVcbiIKKyAgICAgICAiSVAgcHJlZml4IDxuZXR3b3JrPi88bGVuZ3RoPiwgZS5nLiwgMzUuMC4wLjAvOFxuIgorICAgICAgICJTaG93IHJvdXRlIG1hdGNoaW5nIHRoZSBzcGVjaWZpZWQgTmV0d29yay9NYXNrIHBhaXIgb25seVxuIikKK3sKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworICBzdHJ1Y3QgcmliICpyaWI7CisgIHN0cnVjdCBwcmVmaXggcDsKKyAgaW50IHJldDsKKyAgaW50IGZpcnN0ID0gMTsKKworICByZXQgPSBzdHIycHJlZml4IChhcmd2WzBdLCAmcCk7CisgIGlmICghIHJldCkKKyAgICB7CisgICAgICB2dHlfb3V0ICh2dHksICIlJSBNYWxmb3JtZWQgUHJlZml4JXMiLCBWVFlfTkVXTElORSk7CisgICAgICByZXR1cm4gQ01EX1dBUk5JTkc7CisgICAgfQorICAKKyAgLyogU2hvdyBtYXRjaGVkIHR5cGUgSVB2NCByb3V0ZXMuICovCisgIGZvciAocm4gPSByb3V0ZV90b3AgKHJpYl90YWJsZV9pcHY0KTsgcm47IHJuID0gcm91dGVfbmV4dCAocm4pKQorICAgIGZvciAocmliID0gcm4tPmluZm87IHJpYjsgcmliID0gcmliLT5uZXh0KQorICAgICAgaWYgKHByZWZpeF9tYXRjaCAoJnAsICZybi0+cCkpCisJeworCSAgaWYgKGZpcnN0KQorCSAgICB7CisJICAgICAgdnR5X291dCAodnR5LCBTSE9XX1JPVVRFX1Y0X0hFQURFUiwgVlRZX05FV0xJTkUsIFZUWV9ORVdMSU5FLCBWVFlfTkVXTElORSwgVlRZX05FV0xJTkUpOworCSAgICAgIGZpcnN0ID0gMDsKKwkgICAgfQorCSAgdnR5X3Nob3dfaXBfcm91dGUgKHZ0eSwgcm4sIHJpYik7CisJfQorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChzaG93X2lwX3JvdXRlX3N1cGVybmV0cywKKyAgICAgICBzaG93X2lwX3JvdXRlX3N1cGVybmV0c19jbWQsCisgICAgICAgInNob3cgaXAgcm91dGUgc3VwZXJuZXRzLW9ubHkiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgSVBfU1RSCisgICAgICAgIklQIHJvdXRpbmcgdGFibGVcbiIKKyAgICAgICAiU2hvdyBzdXBlcm5ldCBlbnRyaWVzIG9ubHlcbiIpCit7CisgIHN0cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworICB1X2ludDMyX3QgYWRkcjsgCisgIGludCBmaXJzdCA9IDE7CisKKworICAvKiBTaG93IG1hdGNoZWQgdHlwZSBJUHY0IHJvdXRlcy4gKi8KKyAgZm9yIChybiA9IHJvdXRlX3RvcCAocmliX3RhYmxlX2lwdjQpOyBybjsgcm4gPSByb3V0ZV9uZXh0IChybikpCisgICAgZm9yIChyaWIgPSBybi0+aW5mbzsgcmliOyByaWIgPSByaWItPm5leHQpCisgICAgICB7CisJYWRkciA9IG50b2hsIChybi0+cC51LnByZWZpeDQuc19hZGRyKTsKKworCWlmICgoSU5fQ0xBU1NDIChhZ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dCBpbiB0YWJsZSVzIiwgVlRZX05FV0xJTkUpOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICAgIH0KKworICB2dHlfc2hvd19pcF9yb3V0ZV9kZXRhaWwgKHZ0eSwgcm4pOworCisgIHJvdXRlX3VubG9ja19ub2RlIChybik7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoc2hvd19pcF9yb3V0ZV9wcmVmaXgsCisgICAgICAgc2hvd19pcF9yb3V0ZV9wcmVmaXhfY21kLAorICAgICAgICJzaG93IGlwIHJvdXRlIEEuQi5DLkQvTSIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICBJUF9TVFIKKyAgICAgICAiSVAgcm91dGluZyB0YWJsZVxuIgorICAgICAgICJJUCBwcmVmaXggPG5ldHdvcms+LzxsZW5ndGg+LCBlLmcuLCAzNS4wLjAuMC84XG4iKQoreworICBpbnQgcmV0OworICBzdHJ1Y3QgcHJlZml4X2lwdjQgcDsKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworCisgIHJldCA9IHN0cjJwcmVmaXhfaXB2NCAoYXJndlswXSwgJnApOworICBpZiAocmV0IDw9IDApCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiTWFsZm9ybWVkIElQdjQgYWRkcmVzcyVzIiwgVlRZX05FV0xJTkUpOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICAgIH0KKworICBybiA9IHJvdXRlX25vZGVfbWF0Y2ggKHJpYl90YWJsZV9pcHY0LCAoc3RydWN0IHByZWZpeCAqKSAmcCk7CisgIGlmICghIHJuIHx8IHJuLT5wLnByZWZpeGxlbiAhPSBwLnByZWZpeGxlbikKKyAgICB7CisgICAgICB2dHlfb3V0ICh2dHksICIlJSBOZXR3b3JrIG5vdCBpbiB0YWJsZSVzIiwgVlRZX05FV0xJTkUpOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICAgIH0KKworICB2dHlfc2hvd19pcF9yb3V0ZV9kZXRhaW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VBFX0lGSU5ERVgKKwkgICAgICAmJiBuZXh0aG9wLT5pZmluZGV4ID09IGlmaW5kZXgpCisJICB7CisJICAgIHJpYi0+cmVmY250Kys7CisJICAgIHJldHVybiAwOworCSAgfQorCX0KKyAgICAgIGVsc2UgaWYgKHJpYi0+dHlwZSA9PSB0eXBlCisJICAgICAgICYmICghIHRhYmxlIHx8IChyaWItPnRhYmxlID09IHRhYmxlKSkpCisJeworCSAgc2FtZSA9IHJpYjsKKwkgIHJpYl9kZWxub2RlIChybiwgc2FtZSk7CisJICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworCSAgYnJlYWs7CisJfQorICAgIH0KKworICAvKiBBbGxvY2F0ZSBuZXcgcmliIHN0cnVjdHVyZS4gKi8KKyAgcmliID0gWE1BTExPQyAoTVRZUEVfUklCLCBzaXplb2YgKHN0cnVjdCByaWIpKTsKKyAgbWVtc2V0IChyaWIsIDAsIHNpemVvZiAoc3RydWN0IHJpYikpOworICByaWItPnR5cGUgPSB0eXBlOworICByaWItPmRpc3RhbmNlID0gZGlzdGFuY2U7CisgIHJpYi0+ZmxhZ3MgPSBmbGFnczsKKyAgcmliLT5tZXRyaWMgPSBtZXRyaWM7CisgIHJpYi0+dGFibGUgPSB0YWJsZTsKKyAgcmliLT5uZXh0aG9wX251bSA9IDA7CisgIHJpYi0+dXB0aW1lID0gdGltZSAoTlVMTCk7CisKKyAgLyogTmV4dGhvcCBzZXR0aW5ncy4gKi8KKyAgaWYgKGdhdGUpCisgICAgeworICAgICAgaWYgKGlmaW5kZXgpCisJbmV4dGhvcF9pcHY2X2lmaW5kZXhfYWRkIChyaWIsIGdhdGUsIGlmaW5kZXgpOworICAgICAgZWxzZQorCW5leHRob3BfaXB2Nl9hZGQgKHJpYiwgZ2F0ZSk7CisgICAgfQorICBlbHNlCisgICAgbmV4dGhvcF9pZmluZGV4X2FkZCAocmliLCBpZmluZGV4KTsKKworICAvKiBJZiB0aGlzIHJvdXRlIGlzIGtlcm5lbCByb3V0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ChyaWJfdGFibGVfaXB2NiwgKHN0cnVjdCBwcmVmaXggKikgcCk7CisgIGlmICghIHJuKQorICAgIHsKKyAgICAgIGlmIChJU19aRUJSQV9ERUJVR19LRVJORUwpCisJeworCSAgaWYgKGdhdGUpCisJICAgIHpsb2dfaW5mbyAoInJvdXRlICVzLyVkIHZpYSAlcyBpZmluZGV4ICVkIGRvZXNuJ3QgZXhpc3QgaW4gcmliIiwKKwkJICAgICAgIGluZXRfbnRvcCAoQUZfSU5FVDYsICZwLT5wcmVmaXgsIGJ1ZjEsIEJVRlNJWiksCisJCSAgICAgICBwLT5wcmVmaXhsZW4sCisJCSAgICAgICBpbmV0X250b3AgKEFGX0lORVQ2LCBnYXRlLCBidWYyLCBCVUZTSVopLAorCQkgICAgICAgaWZpbmRleCk7CisJICBlbHNlCisJICAgIHpsb2dfaW5mbyAoInJvdXRlICVzLyVkIGlmaW5kZXggJWQgZG9lc24ndCBleGlzdCBpbiByaWIiLAorCQkgICAgICAgaW5ldF9udG9wIChBRl9JTkVUNiwgJnAtPnByZWZpeCwgYnVmMSwgQlVGU0laKSwKKwkJICAgICAgIHAtPnByZWZpeGxlbiwKKwkJICAgICAgIGlmaW5kZXgpOworCX0KKyAgICAgIHJldHVybiBaRUJSQV9FUlJfUlROT0VYSVNUOworICAgIH0KKworICAvKiBMb29rdXAgc2FtZSB0eXBlIHJvdXRlLiAqLworICBmb3IgKHJpYiA9IHJuLT5pbmZvOyByaWI7IHJpYiA9IHJpYi0+bmV4dCkKKyAgICB7CisgICAgICBpZiAoQ0hFQ0tfRkxBRyAocmliLT5mbGFncywgWkVCUkFfRkxBR19TRUxFQ1RFRCkpCisJZmliID0gcmliOworCisgICAgICBpZiAocmliLT50eXBlID09IFpFQlJBX1JPVVRFX0NPTk5FQ1QpCisJeworCSAgbmV4dGhvcCA9IHJpYi0+bmV4dGhvcDsKKworCSAgaWYgKHJpYi0+dHlwZSA9PSB0eXBlCisJICAgICAgJiYgKCEgdGFibGUgfHwgcmli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cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworCisgIGZvciAocm4gPSByb3V0ZV90b3AgKHJpYl90YWJsZV9pcHY2KTsgcm47IHJuID0gcm91dGVfbmV4dCAocm4pKQorICAgIGZvciAocmliID0gcm4tPmluZm87IHJpYjsgcmliID0gcmliLT5uZXh0KQorICAgICAgaWYgKCEgUklCX1NZU1RFTV9ST1VURSAocmliKQorCSAgJiYgQ0hFQ0tfRkxBRyAocmliLT5mbGFncywgWkVCUkFfRkxBR19TRUxFQ1RFRCkpCisJcmliX3VuaW5zdGFsbF9rZXJuZWwgKHJuLCByaWIpOworfQorDAorLyogSW5zdGFsbCBzdGF0aWMgcm91dGUgaW50byByaWIuICovCit2b2lkCitzdGF0aWNfaXB2Nl9pbnN0YWxsIChzdHJ1Y3QgcHJlZml4X2lwdjYgKnAsIHN0cnVjdCBzdGF0aWNfaXB2NiAqc2kpCit7CisgIHN0cnVjdCByaWIgKnJpYjsKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworCisgIC8qIExvb2t1cCBleGlzdGluZyByb3V0ZSAqLworICBybiA9IHJvdXRlX25vZGVfZ2V0IChyaWJfdGFibGVfaXB2NiwgKHN0cnVjdCBwcmVmaXggKikgcCk7CisgIGZvciAocmliID0gcm4tPmluZm87IHJpYjsgcmliID0gcmliLT5uZXh0KQorICAgIGlmIChyaWItPnR5cGUgPT0gWkVCUkFfUk9VVEVfU1RBVElDICYmIHJpYi0+ZGlzdGFuY2UgPT0gc2ktPmRpc3RhbmNlKQorICAgICAgYnJlYWs7CisKKyAgaWYgKHJpYikKKyAgICB7CisgICAgICAvKiBTYW1lIGRpc3RhbmNlIHN0YXRpYyByb3V0ZSBpcyB0aGVyZS4gIFVwZGF0ZSBpdCB3aXRoIG5ldworICAgICAgICAgbmV4dGhvcC4gKi8KKyAgICAgIHJpYl91bmluc3RhbGwgKHJuLCByaWIpOworICAgICAgcm91dGVfdW5sb2NrX25vZGUgKHJu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ApCisgICAgcmV0dXJuIDE7CisgIHJldHVybiAwOzsKK30KKwordm9pZAorc3RhdGljX2lwdjZfdW5pbnN0YWxsIChzdHJ1Y3QgcHJlZml4X2lwdjYgKnAsIHN0cnVjdCBzdGF0aWNfaXB2NiAqc2kpCit7CisgIHN0cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworICBzdHJ1Y3QgbmV4dGhvcCAqbmV4dGhvcDsKKworICAvKiBMb29rdXAgZXhpc3Rpbmcgcm91dGUgd2l0aCB0eXBlIGFuZCBkaXN0YW5jZS4gKi8KKyAgcm4gPSByb3V0ZV9ub2RlX2xvb2t1cCAocmliX3RhYmxlX2lwdjYsIChzdHJ1Y3QgcHJlZml4ICopIHApOworICBpZiAoISBybikKKyAgICByZXR1cm47CisKKyAgZm9yIChyaWIgPSBybi0+aW5mbzsgcmliOyByaWIgPSByaWItPm5leHQpCisgICAgaWYgKHJpYi0+dHlwZSA9PSBaRUJSQV9ST1VURV9TVEFUSUMgJiYgcmliLT5kaXN0YW5jZSA9PSBzaS0+ZGlzdGFuY2UpCisgICAgICBicmVhazsKKyAgaWYgKCEgcmliKQorICAgIHsKKyAgICAgIHJvdXRlX3VubG9ja19ub2RlIChybik7CisgICAgICByZXR1cm47CisgICAgfQorCisgIC8qIExvb2t1cCBuZXh0aG9wLiAqLworICBmb3IgKG5leHRob3AgPSByaWItPm5leHRob3A7IG5leHRob3A7IG5leHRob3AgPSBuZXh0aG9wLT5uZXh0KQorICAgIGlmIChzdGF0aWNfaXB2Nl9uZXh0aG9wX3NhbWUgKG5leHRob3AsIHNpKSkKKyAgICAgIGJyZWFrOworCisgIC8qIENhbid0IGZpbmQgbmV4dGhvcC4gKi8KKyAgaWYgKCEgbmV4dGhvcCkKKyAgICB7CisgICAgICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworICAgICAgcmV0dXJuOworICAgIH0KKyAgCisgIC8qIENoZWNrIG5leHRob3AuICovCisgIGlmIChyaWItP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IgLSBSSVBuZywgTyAtIE9TUEZ2MywgSSAtIElTLUlTLCVzICAgICAgIEIgLSBCR1AsICogLSBGSUIgcm91dGUuJXMlcyIKKworREVGVU4gKHNob3dfaXB2Nl9yb3V0ZSwKKyAgICAgICBzaG93X2lwdjZfcm91dGVfY21kLAorICAgICAgICJzaG93IGlwdjYgcm91dGUiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgSVBfU1RSCisgICAgICAgIklQdjYgcm91dGluZyB0YWJsZVxuIikKK3sKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworICBzdHJ1Y3QgcmliICpyaWI7CisgIGludCBmaXJzdCA9IDE7CisKKyAgLyogU2hvdyBhbGwgSVB2NiByb3V0ZS4gKi8KKyAgZm9yIChybiA9IHJvdXRlX3RvcCAocmliX3RhYmxlX2lwdjYpOyBybjsgcm4gPSByb3V0ZV9uZXh0IChybikpCisgICAgZm9yIChyaWIgPSBybi0+aW5mbzsgcmliOyByaWIgPSByaWItPm5leHQpCisgICAgICB7CisJaWYgKGZpcnN0KQorCSAgeworCSAgICB2dHlfb3V0ICh2dHksIFNIT1dfUk9VVEVfVjZfSEVBREVSLCBWVFlfTkVXTElORSwgVlRZX05FV0xJTkUsIFZUWV9ORVdMSU5FKTsKKwkgICAgZmlyc3QgPSAwOworCSAgfQorCXZ0eV9zaG93X2lwdjZfcm91dGUgKHZ0eSwgcm4sIHJpYik7CisgICAgICB9CisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKHNob3dfaXB2Nl9yb3V0ZV9wcmVmaXhfbG9uZ2VyLAorICAgICAgIHNob3dfaXB2Nl9yb3V0ZV9wcmVmaXhfbG9uZ2VyX2NtZCwKKyAgICAgICAic2hvdyBpcHY2IHJvdXRlIFg6WDo6WDpYL00gbG9uZ2VyLXByZWZpeGVzIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgIElQX1NUUgorICAgICAgICJJUHY2IHJvdXRpbmcgdGFibGVcbiIKKyAgICAgICAiSVB2NiBwcmVmaXhcbiIKKyAgICAgICAiU2hvdyByb3V0ZSBtYXRjaGluZyB0aGUgc3BlY2lmaWVkIE5ldHdvcmsvTWFzayBwYWlyIG9ubHlcbiIpCit7CisgIHN0cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworICBzdHJ1Y3QgcHJlZml4IHA7CisgIGludCByZXQ7CisgIGludCBmaXJzdCA9IDE7CisKKyAgcmV0ID0gc3RyMnByZWZpeCAoYXJndlswXSwgJnApOworICBpZiAoISByZXQpCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiJSUgTWFsZm9ybWVkIFByZWZpeCVzIiwgVlRZX05FV0xJTkUpOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICAgIH0KKworICAvKiBTaG93IG1hdGNoZWQgdHlwZSBJUHY2IHJvdXRlcy4gKi8KKyAgZm9yIChybiA9IHJvdXRlX3RvcCAocmliX3RhYmxlX2lwdjYpOyBybjsgcm4gPSByb3V0ZV9uZXh0IChybikpCisgICAgZm9yIChyaWIgPSBybi0+aW5mbzsgcmliOyByaWIgPSByaWItPm5leHQpCisgICAgICBpZiAocHJlZml4X21hdGNoICgmcCwgJnJuLT5wKSkKKwl7CisJICBpZiAoZmlyc3QpCisJICAgIHsKKwkgICAgICB2dHlfb3V0ICh2dHksIFNIT1dfUk9VVEVfVjZfSEVBREVSLCBWVFlfTkVXTElORSwgVlRZX05FV0xJTkUsIFZUWV9ORVdMSU5FKTsKKwkgICAgICBmaXJzdCA9IDA7CisJICAgIH0KKwkgIHZ0eV9zaG93X2lwdjZfcm91dGUgKHZ0eSwgcm4sIHJpYik7CisJfQorICByZXR1cm4gQ01EX1NVQ0NFU1M7Cit9CisKK0RFRlVOIChzaG93X2lwdjZfcm91dGVfcHJvdG9jb2wsCisgICAgICAgc2hvd19pcHY2X3JvdXRlX3Byb3RvY29sX2NtZCwKKyAgICAgICAic2hvdyBpcHY2IHJvdXRlIChiZ3B8Y29ubmVjdGVkfGtlcm5lbHxvc3BmNnxpc2lzfHJpcG5nfHN0YXRpYykiLAorICAgICAgIFNIT1dfU1RSCisgICAgICAgSVBfU1RSCisgICAgICAgIklQIHJvdXRpbmcgdGFibGVcbiIKKyAgICAgICAiQm9yZGVyIEdhdGV3YXkgUHJvdG9jb2wgKEJHUClcbiIKKyAgICAgICAiQ29ubmVjdGVkXG4iCisgICAgICAgIktlcm5lbFxuIgorICAgICAgICJPcGVuIFNob3J0ZXN0IFBhdGggRmlyc3QgKE9TUEZ2MylcbiIKKyAgICAgICAiSVNPIElTLUlTIChJU0lTKVxuIgorICAgICAgICJSb3V0aW5nIEluZm9ybWF0aW9uIFByb3RvY29sIChSSVBuZylcbiIKKyAgICAgICAiU3RhdGljIHJvdXRlc1xuIikKK3sKKyAgaW50IHR5cGU7CisgIHN0cnVjdCByb3V0ZV9ub2RlICpybjsKKyAgc3RydWN0IHJpYiAqcmliOworICBpbnQgZmlyc3QgPSAxOworCisgIGlmIChzdHJuY21wIChhcmd2WzBdLCAiYiIsIDEpID09IDApCisgICAgdHlwZSA9IFpFQlJBX1JPVVRFX0JHUDsKKyAgZWxzZSBpZiAoc3RybmNtcCAoYXJndlswXSwgImMiLCAxKSA9PSAwKQorICAgIHR5cGUgPSBaRUJSQV9ST1VURV9DT05ORUNUOworICBlbHNlIGlmIChzdHJuY21wIChhcmd2WzBdLCAiayIsIDEpID09MCkKKyAgICB0eXBlID0gWkVCUkFfUk9VVEVfS0VSTkVMOworICBlbHNlIGlmIChzdHJuY21wIChhcmd2WzBdLCAibyIsIDEpID09IDApCisgICAgdHlwZSA9IFpFQlJBX1JPVVRFX09TUEY2OworICBlbHNlIGlmIChzdHJuY21wIChhcmd2WzBdLCAiaSIsIDEpID09IDApCisgICAgdHlwZSA9IFpFQlJBX1JPVVRFX0lTSVM7CisgIGVsc2UgaWYgKHN0cm5jbXAgKGFyZ3ZbMF0sICJyIiwgMSkgPT0gMCkKKyAgICB0eXBlID0gWkVCUkFf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3RydWN0IHJvdXRlX25vZGUgKnJuOworCisgIHJldCA9IHN0cjJwcmVmaXhfaXB2NiAoYXJndlswXSwgJnApOworICBpZiAocmV0IDw9IDApCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiTWFsZm9ybWVkIElQdjYgYWRkcmVzcyVzIiwgVlRZX05FV0xJTkUpOworICAgICAgcmV0dXJuIENNRF9XQVJOSU5HOworICAgIH0KKworICBybiA9IHJvdXRlX25vZGVfbWF0Y2ggKHJpYl90YWJsZV9pcHY2LCAoc3RydWN0IHByZWZpeCAqKSAmcCk7CisgIGlmICghIHJuKQorICAgIHsKKyAgICAgIHZ0eV9vdXQgKHZ0eSwgIiUlIE5ldHdvcmsgbm90IGluIHRhYmxlJXMiLCBWVFlfTkVXTElORSk7CisgICAgICByZXR1cm4gQ01EX1dBUk5JTkc7CisgICAgfQorCisgIHZ0eV9zaG93X2lwdjZfcm91dGVfZGV0YWlsICh2dHksIHJuKTsKKworICByb3V0ZV91bmxvY2tfbm9kZSAocm4pOworCisgIHJldHVybiBDTURfU1VDQ0VTUzsKK30KKworREVGVU4gKHNob3dfaXB2Nl9yb3V0ZV9wcmVmaXgsCisgICAgICAgc2hvd19pcHY2X3JvdXRlX3ByZWZpeF9jbWQsCisgICAgICAgInNob3cgaXB2NiByb3V0ZSBYOlg6Olg6WC9NIiwKKyAgICAgICBTSE9XX1NUUgorICAgICAgIElQX1NUUgorICAgICAgICJJUHY2IHJvdXRpbmcgdGFibGVcbiIKKyAgICAgICAiSVB2NiBwcmVmaXhcbiIpCit7CisgIGludCByZXQ7CisgIHN0cnVjdCBwcmVmaXhfaXB2NiBwOworICBzdHJ1Y3Qgcm91dGVfbm9kZSAqcm47CisKKyAgcmV0ID0gc3RyMnByZWZpeF9pcHY2IChhcmd2WzBdLCAmcCk7CisgIGlmIChyZXQgPD0gMCkKKyAgICB7CisgICAgICB2dHlfb3V0ICh2dHksICJNYWxmb3JtZWQgSVB2NiBwcmVmaXglcyIsIFZUWV9ORVdMSU5FKTsKKyAgICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgICB9CisKKyAgcm4gPSByb3V0ZV9ub2RlX21hdGNoIChyaWJfdGFibGVfaXB2NiwgKHN0cnVjdCBwcmVmaXggKikgJnApOworICBpZiAoISBybiB8fCBybi0+cC5wcmVmaXhsZW4gIT0gcC5wcmVmaXhsZW4pCisgICAgeworICAgICAgdnR5X291dCAodnR5LCAiJSUgTmV0d29yayBub3QgaW4gdGFibGUlcyIsIFZUWV9ORVdMSU5FKTsKKyAgICAgIHJldHVybiBDTURfV0FSTklORzsKKyAgICB9CisKKyAgdnR5X3Nob3dfaXB2Nl9yb3V0ZV9kZXRhaWwgKHZ0eSwgcm4pOworCisgIHJvdXRlX3VubG9ja19ub2RlIChybik7CisKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworDAorLyogUklCIHVwZGF0ZSBmdW5jdGlvbi4gKi8KK3ZvaWQKK3JpYl91cGRhdGUgKCkKK3sKKyAgc3RydWN0IHJvdXRlX25vZGUgKnJuOworCisgIGZvciAocm4gPSByb3V0ZV90b3AgKHJpYl90YWJsZV9pcHY0KTsgcm47IHJuID0gcm91dGVfbmV4dCAocm4pKQorICAgIC8qIFVwZGF0ZSByZWFjaGFiaWxpdHkuICovCisgICAgcmliX3Byb2Nlc3MgKHJuLCBOVUxMKTsKKworI2lmZGVmIEhBVkVfSVBWNgorICBmb3IgKHJuID0gcm91dGVfdG9wIChyaWJfdGFibGVfaXB2Nik7IHJuOyBybiA9IHJvdXRlX25leHQgKHJuKSkKKyAgICByaWJfcHJvY2VzcyAocm4sIE5VTEwpOworI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworfQorCisvKiBJbnRlcmZhY2UgZ29lcyB1cC4gKi8KK3ZvaWQKK3JpYl9pZl91cCAoc3RydWN0IGludGVyZmFjZSAqaWZwKQoreworICByaWJfdXBkYXRlICgpOworfQorCisvKiBJbnRlcmZhY2UgZ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nJuOworICBzdHJ1Y3QgcmliICpyaWI7CisgIHN0cnVjdCByaWIgKm5leHQ7CisgIGludCByZXQgPSAwOworCisgIGZvciAocm4gPSByb3V0ZV90b3AgKHJpYl90YWJsZSk7IHJuOyBybiA9IHJvdXRlX25leHQgKHJuKSkKKyAgICBmb3IgKHJpYiA9IHJuLT5pbmZvOyByaWI7IHJpYiA9IG5leHQpCisgICAgICB7CisJbmV4dCA9IHJpYi0+bmV4dDsKKworICAgICAgICBpZiAoKHJpYi0+dHlwZSA9PSBaRUJSQV9ST1VURV9LRVJORUwpICYmIAorCSAgICBDSEVDS19GTEFHIChyaWItPmZsYWdzLCBaRUJSQV9GTEFHX1NFTEZST1VURSkpCisgICAgICAgICAgeworCSAgICByZXQgPSByaWJfdW5pbnN0YWxsX2tlcm5lbCAocm4sIHJpYik7CisKKwkgICAgaWYgKCEgcmV0KQorCSAgICAgIHsKKwkJcmliX2RlbG5vZGUgKHJuLCByaWIpOworCQluZXdyaWJfZnJlZSAocmliKTsKKwkJcm91dGVfdW5sb2NrX25vZGUgKHJuKTsKKwkgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorfQorCit2b2lkCityaWJfc3dlZXBfcm91dGUgKCkKK3sKKyAgcmliX3N3ZWVwX3RhYmxlIChyaWJfdGFibGVfaXB2NCk7CisjaWZkZWYgSEFWRV9JUFY2ICAKKyAgcmliX3N3ZWVwX3RhYmxlIChyaWJfdGFibGVfaXB2Nik7CisjZW5kaWYgLyogSEFWRV9JUFY2ICovCit9CisKKy8qIENsb3NlIHJpYiB3aGVuIHplYnJhIHRlcm1pbmF0ZXMuICovCit2b2lkCityaWJfY2xvc2UgKCkKK3sKKyAgcmliX2Nsb3NlX2lwdjQgKCk7CisjaWZkZWYgSEFWRV9JUFY2CisgIHJpYl9jbG9zZV9pcHY2ICgpOworI2VuZGlmIC8qIEhBVkVfSVBWNiAqLworfQorDAorLyogU3RhdGljIGlwIHJvdXRlIGNvbmZpZ3VyYXRpb24gd3JpdGU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ovCisjZGVmaW5lIFRJTUVSX1NFQ09ORF9NSUNSTyAxMDAwMDAwTAorCitzdHJ1Y3QgdGltZXZhbAordGltZXZhbF9hZGp1c3QgKHN0cnVjdCB0aW1ldmFsIGEpCit7CisgIHdoaWxlIChhLnR2X3VzZWMgPj0gVElNRVJfU0VDT05EX01JQ1JPKQorICAgIHsKKyAgICAgIGEudHZfdXNlYyAtPSBUSU1FUl9TRUNPTkRfTUlDUk87CisgICAgICBhLnR2X3NlYysrOworICAgIH0KKworICB3aGlsZSAoYS50dl91c2VjIDwgMCkKKyAgICB7CisgICAgICBhLnR2X3VzZWMgKz0gVElNRVJfU0VDT05EX01JQ1JPOworICAgICAgYS50dl9zZWMtLTsKKyAgICB9CisKKyAgaWYgKGEudHZfc2VjIDwgMCkKKyAgICB7CisgICAgICBhLnR2X3NlYyA9IDA7CisgICAgICBhLnR2X3VzZWMgPSAxMDsKKyAgICB9CisKKyAgaWYgKGEudHZfc2VjID4gVElNRVJfU0VDT05EX01JQ1JPKQorICAgIGEudHZfc2VjID0gVElNRVJfU0VDT05EX01JQ1JPOyAgICAKKworICByZXR1cm4gYTsKK30KKworc3RhdGljIHN0cnVjdCB0aW1ldmFsCit0aW1ldmFsX3N1YnRyYWN0IChzdHJ1Y3QgdGltZXZhbCBhLCBzdHJ1Y3QgdGltZXZhbCBiKQoreworICBzdHJ1Y3QgdGltZXZhbCByZXQ7CisKKyAgcmV0LnR2X3VzZWMgPSBhLnR2X3VzZWMgLSBiLnR2X3VzZWM7CisgIHJldC50dl9zZWMgPSBhLnR2X3NlYyAtIGIudHZfc2VjOworCisgIHJldHVybiB0aW1ldmFsX2FkanVzdCAocmV0KTsKK30KKworc3RhdGljIGludAordGltZXZhbF9jbXAgKHN0cnVjdCB0aW1ldmFsIGEsIHN0cnVjdCB0aW1ldmFsIGIpCit7CisgIHJldHVybiAoYS50dl9zZWMgPT0gYi50dl9zZWMKKwkgID8gYS50dl91c2VjIC0gYi50dl91c2VjIDogYS50dl9zZ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pbWVyX3ZhbCkKK3sKKyAgc3RydWN0IHRpbWV2YWwgdGltZXJfbm93OworICBzdHJ1Y3QgdGltZXZhbCB0aW1lcl9taW47CisgIHN0cnVjdCB0aW1ldmFsICp0aW1lcl93YWl0OworCisgIGdldHRpbWVvZmRheSAoJnRpbWVyX25vdywgTlVMTCk7CisKKyAgdGltZXJfd2FpdCA9IE5VTEw7CisgIGZvciAodGhyZWFkID0gbS0+dGltZXIuaGVhZDsgdGhyZWFkOyB0aHJlYWQgPSB0aHJlYWQtPm5leHQpCisgICAgeworICAgICAgaWYgKCEgdGltZXJfd2FpdCkKKwl0aW1lcl93YWl0ID0gJnRocmVhZC0+dS5zYW5kczsKKyAgICAgIGVsc2UgaWYgKHRpbWV2YWxfY21wICh0aHJlYWQtPnUuc2FuZHMsICp0aW1lcl93YWl0KSA8IDApCisJdGltZXJfd2FpdCA9ICZ0aHJlYWQtPnUuc2FuZHM7CisgICAgfQorCisgIGlmIChtLT50aW1lci5oZWFkKQorICAgIHsKKyAgICAgIHRpbWVyX21pbiA9ICp0aW1lcl93YWl0OworICAgICAgdGltZXJfbWluID0gdGltZXZhbF9zdWJ0cmFjdCAodGltZXJfbWluLCB0aW1lcl9ub3cpOworICAgICAgaWYgKHRpbWVyX21pbi50dl9zZWMgPCAwKQorCXsKKwkgIHRpbWVyX21pbi50dl9zZWMgPSAwOworCSAgdGltZXJfbWluLnR2X3VzZWMgPSAxMDsKKwl9CisgICAgICB0aW1lcl93YWl0ID0gJnRpbWVyX21pbjsKKyAgICB9CisgIGVsc2UKKyAgICB0aW1lcl93YWl0ID0gTlVMTDsKKworICBpZiAodGltZXJfd2FpdCkKKyAgICB7CisgICAgICAqdGltZXJfdmFsID0gdGltZXJfd2FpdDsKKyAgICAgIHJldHVybiB0aW1lcl92YWw7CisgICAgfQorICByZXR1cm4gTlVMTDsKK30KKyNlbHNlIC8qICEgVElNRVJfTk9fU09SVCAqLworc3RydWN0IHRpbWV2YWwgKgordGhyZWFkX3RpbW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0aW1lci4gKi8KKyAgICAgIHRpbWVyX3dhaXQgPSB0aHJlYWRfdGltZXJfd2FpdCAobSwgJnRpbWVyX3ZhbCk7CisKKyAgICAgIG51bSA9IHNlbGVjdCAoRkRfU0VUU0laRSwgJnJlYWRmZCwgJndyaXRlZmQsICZleGNlcHRmZCwgdGltZXJfd2FpdCk7CisKKyAgICAgIGlmIChudW0gPT0gMCkKKwljb250aW51ZTsKKworICAgICAgaWYgKG51bSA8IDApCisJeworCSAgaWYgKGVycm5vID09IEVJTlRSKQorCSAgICBjb250aW51ZTsKKworCSAgemxvZ193YXJuICgic2VsZWN0KCkgZXJyb3I6ICVzIiwgc3RyZXJyb3IgKGVycm5vKSk7CisJICByZXR1cm4gTlVMTDsKKwl9CisKKyAgICAgIC8qIE5vcm1hbCBwcmlvcml0eSByZWFkIHRoZWFkLiAqLworICAgICAgcmVhZHkgPSB0aHJlYWRfcHJvY2Vzc19mZCAobSwgJm0tPnJlYWQsICZyZWFkZmQsICZtLT5yZWFkZmQpOworCisgICAgICAvKiBXcml0ZSB0aGVhZC4gKi8KKyAgICAgIHJlYWR5ID0gdGhyZWFkX3Byb2Nlc3NfZmQgKG0sICZtLT53cml0ZSwgJndyaXRlZmQsICZtLT53cml0ZWZkKTsKKworICAgICAgaWYgKCh0aHJlYWQgPSB0aHJlYWRfdHJpbV9oZWFkICgmbS0+cmVhZHkpKSAhPSBOVUxMKQorCXJldHVybiB0aHJlYWRfcnVuIChtLCB0aHJlYWQsIGZldGNoKTsKKyAgICB9Cit9CisKK3N0YXRpYyB1bnNpZ25lZCBsb25nCit0aHJlYWRfY29uc3VtZWRfdGltZSAoUlVTQUdFX1QgKm5vdywgUlVTQUdFX1QgKnN0YXJ0KQoreworICB1bnNpZ25lZCBsb25nIHRocmVhZF90aW1lOworCisjaWZkZWYgSEFWRV9SVVNBR0UKKyAgLyogVGhpcyBpcyAndXNlciArIHN5cycgdGltZS4gICovCisgIHRocmVhZF90aW1lID0gdGltZXZhbF9lbGF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0IGlzIGFsbG9jYXRlZCBidWZmZXIuICAqLworICAgICAgaWYgKHAgIT0gYnVmKQorCVhGUkVFIChNVFlQRV9WVFlfT1VUX0JVRiwgcCk7CisgICAgfQorCisgIHZhX2VuZCAoYXJncyk7CisKKyAgcmV0dXJuIGxlbjsKK30KKworaW50Cit2dHlfbG9nX291dCAoc3RydWN0IHZ0eSAqdnR5LCBjb25zdCBjaGFyICpwcm90b19zdHIsIGNvbnN0IGNoYXIgKmZvcm1hdCwKKwkgICAgIHZhX2xpc3QgdmEpCit7CisgIGludCBsZW47CisgIGNoYXIgYnVmWzEwMjRdOworCisgIHNucHJpbnRmIChidWYsIHNpemVvZiBidWYsICIlczogIiwgcHJvdG9fc3RyKTsKKyAgd3JpdGUgKHZ0eS0+ZmQsIGJ1Ziwgc3RybGVuIChwcm90b19zdHIpICsgMik7CisKKyAgbGVuID0gdnNucHJpbnRmIChidWYsIHNpemVvZiBidWYsIGZvcm1hdCwgdmEpOworICBpZiAobGVuIDwgMCkKKyAgICByZXR1cm4gLTE7CisgIHdyaXRlICh2dHktPmZkLCAodV9jaGFyICopYnVmLCBsZW4pOworCisgIHNucHJpbnRmIChidWYsIHNpemVvZiBidWYsICJcclxuIik7CisgIHdyaXRlICh2dHktPmZkLCBidWYsIDIpOworCisgIHJldHVybiBsZW47Cit9CisKKy8qIE91dHB1dCBjdXJyZW50IHRpbWUgdG8gdGhlIHZ0eS4gKi8KK3ZvaWQKK3Z0eV90aW1lX3ByaW50IChzdHJ1Y3QgdnR5ICp2dHksIGludCBjcikKK3sKKyAgdGltZV90IGNsb2NrOworICBzdHJ1Y3QgdG0gKnRtOworI2RlZmluZSBUSU1FX0JVRiAyNQorICBjaGFyIGJ1ZiBbVElNRV9CVUZdOworICBpbnQgcmV0OworICAKKyAgdGltZSAoJmNsb2NrKTsKKyAgdG0gPSBsb2NhbHRpbWUgKCZjbG9jayk7CisKKyAgcmV0ID0gc3RyZnRpbWUgKGJ1ZiwgVElNRV9CVUYsICIl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N1dGlvbiBvdmVyIHRoZSB2dHkgaW50ZXJmYWNlLiAqLworaW50Cit2dHlfY29tbWFuZCAoc3RydWN0IHZ0eSAqdnR5LCBjaGFyICpidWYpCit7CisgIGludCByZXQ7CisgIHZlY3RvciB2bGluZTsKKworICAvKiBTcGxpdCByZWFkbGluZSBzdHJpbmcgdXAgaW50byB0aGUgdmVjdG9yICovCisgIHZsaW5lID0gY21kX21ha2Vfc3RydmVjIChidWYpOworCisgIGlmICh2bGluZSA9PSBOVUxMKQorICAgIHJldHVybiBDTURfU1VDQ0VTUzsKKworICByZXQgPSBjbWRfZXhlY3V0ZV9jb21tYW5kICh2bGluZSwgdnR5LCBOVUxMKTsKKworICBpZiAocmV0ICE9IENNRF9TVUNDRVNTKQorICAgIHN3aXRjaCAocmV0KQorICAgICAgeworICAgICAgY2FzZSBDTURfV0FSTklORzoKKwlpZiAodnR5LT50eXBlID09IFZUWV9GSUxFKQorCSAgdnR5X291dCAodnR5LCAiV2FybmluZy4uLiVzIiwgVlRZX05FV0xJTkUpOworCWJyZWFrOworICAgICAgY2FzZSBDTURfRVJSX0FNQklHVU9VUzoKKwl2dHlfb3V0ICh2dHksICIlJSBBbWJpZ3VvdXMgY29tbWFuZC4lcyIsIFZUWV9ORVdMSU5FKTsKKwlicmVhazsKKyAgICAgIGNhc2UgQ01EX0VSUl9OT19NQVRDSDoKKwl2dHlfb3V0ICh2dHksICIlJSBVbmtub3duIGNvbW1hbmQuJXMiLCBWVFlfTkVXTElORSk7CisJYnJlYWs7CisgICAgICBjYXNlIENNRF9FUlJfSU5DT01QTEVURToKKwl2dHlfb3V0ICh2dHksICIlJSBDb21tYW5kIGluY29tcGxldGUuJXMiLCBWVFlfTkVXTElORSk7CisJYnJlYWs7CisgICAgICB9CisgIGNtZF9mcmVlX3N0cnZlYyAodmxpbmUpOworCisgIHJldHVybiByZXQ7Cit9CisMCitjaGFyIHRlbG5ldF9iYWNrd2FyZF9jaGFyID0gMHgwODsKK2NoYXIgdGVsb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3AgPSAwOworfQorCisvKiBXaGVuICdeWicgaXMgcmVjZWl2ZWQgZnJvbSB2dHksIG1vdmUgZG93biB0byB0aGUgZW5hYmxlIG1vZGUuICovCit2b2lkCit2dHlfZW5kX2NvbmZpZyAoc3RydWN0IHZ0eSAqdnR5KQoreworICB2dHlfb3V0ICh2dHksICIlcyIsIFZUWV9ORVdMSU5FKTsKKworICBzd2l0Y2ggKHZ0eS0+bm9kZSkKKyAgICB7CisgICAgY2FzZSBWSUVXX05PREU6CisgICAgY2FzZSBFTkFCTEVfTk9ERToKKyAgICAgIC8qIE5vdGhpbmcgdG8gZG8uICovCisgICAgICBicmVhazsKKyAgICBjYXNlIENPTkZJR19OT0RFOgorICAgIGNhc2UgSU5URVJGQUNFX05PREU6CisgICAgY2FzZSBaRUJSQV9OT0RFOgorICAgIGNhc2UgUklQX05PREU6CisgICAgY2FzZSBSSVBOR19OT0RFOgorICAgIGNhc2UgQkdQX05PREU6CisgICAgY2FzZSBCR1BfVlBOVjRfTk9ERToKKyAgICBjYXNlIEJHUF9JUFY0X05PREU6CisgICAgY2FzZSBCR1BfSVBWNE1fTk9ERToKKyAgICBjYXNlIEJHUF9JUFY2X05PREU6CisgICAgY2FzZSBSTUFQX05PREU6CisgICAgY2FzZSBPU1BGX05PREU6CisgICAgY2FzZSBPU1BGNl9OT0RFOgorICAgIGNhc2UgSVNJU19OT0RFOgorICAgIGNhc2UgS0VZQ0hBSU5fTk9ERToKKyAgICBjYXNlIEtFWUNIQUlOX0tFWV9OT0RFOgorICAgIGNhc2UgTUFTQ19OT0RFOgorICAgIGNhc2UgVlRZX05PREU6CisgICAgICB2dHlfY29uZmlnX3VubG9jayAodnR5KTsKKyAgICAgIHZ0eS0+bm9kZSA9IEVOQUJMRV9OT0RFOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIC8qIFVua25vd24gbm9kZSwgd2UgaGF2ZSB0byBpZ25vcmUgaXQuICovCisgICAgICBicmVhazsKKyAgICB9Cis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QgY21kX3dpZHRoLAorICAgICAgICAgICAgICAgICBpbnQgZGVzY193aWR0aCwgc3RydWN0IGRlc2MgKmRlc2MpCit7CisgIGNoYXIgKmJ1ZiwgKmNtZCwgKnA7CisgIGludCBwb3M7CisKKyAgY21kID0gZGVzYy0+Y21kWzBdID09ICcuJyA/IGRlc2MtPmNtZCArIDEgOiBkZXNjLT5jbWQ7CisKKyAgaWYgKGRlc2Nfd2lkdGggPD0gMCkKKyAgICB7CisgICAgICB2dHlfb3V0ICh2dHksICIgICUtKnMgICVzJXMiLCBjbWRfd2lkdGgsIGNtZCwgZGVzYy0+c3RyLCBWVFlfTkVXTElORSk7CisgICAgICByZXR1cm47CisgICAgfQorCisgIGJ1ZiA9IFhDQUxMT0MgKE1UWVBFX1RNUCwgc3RybGVuIChkZXNjLT5zdHIpICsgMSk7CisKKyAgZm9yIChwID0gZGVzYy0+c3RyOyBzdHJsZW4gKHApID4gZGVzY193aWR0aDsgcCArPSBwb3MgKyAxKQorICAgIHsKKyAgICAgIGZvciAocG9zID0gZGVzY193aWR0aDsgcG9zID4gMDsgcG9zLS0pCisgICAgICBpZiAoKihwICsgcG9zKSA9PSAnICcpCisgICAgICAgIGJyZWFrOworCisgICAgICBpZiAocG9zID09IDApCisgICAgICBicmVhazsKKworICAgICAgc3RybmNweSAoYnVmLCBwLCBwb3MpOworICAgICAgYnVmW3Bvc10gPSAnXDAnOworICAgICAgdnR5X291dCAodnR5LCAiICAlLSpzICAlcyVzIiwgY21kX3dpZHRoLCBjbWQsIGJ1ZiwgVlRZX05FV0xJTkUpOworCisgICAgICBjbWQgPSAiIjsKKyAgICB9CisKKyAgdnR5X291dCAodnR5LCAiICAlLSpzICAlcyVzIiwgY21kX3dpZHRoLCBjbWQsIHAsIFZUWV9ORVdMSU5FKTsKKworICBYRlJFRSAoTVRZUEVfVE1QLCBidWYpOworfQorCisvKiBEZXNjcmliZSBtYXRjaGVkIGNvbW1hbmQgZnVuY3Rpb24uICovCitzdGF0aWMgdm9pZAordnR5X2Rlc2NyaWJlX2NvbW1hbmQgKHN0cnVjdCB2dHkgKnZ0eSkKK3sKKyAgaW50IHJldDsKKyAgdmVjdG9yIHZsaW5lOworICB2ZWN0b3IgZGVzY3JpYmU7CisgIGludCBpLCB3aWR0aCwgZGVzY193aWR0aDsKKyAgc3RydWN0IGRlc2MgKmRlc2MsICpkZXNjX2NyID0gTlVMTDsKKworICB2bGluZSA9IGNtZF9tYWtlX3N0cnZlYyAodnR5LT5idWYpOworCisgIC8qIEluIGNhc2Ugb2YgJz4gPycuICovCisgIGlmICh2bGluZSA9PSBOVUxMKQorICAgIHsKKyAgICAgIHZsaW5lID0gdmVjdG9yX2luaXQgKDEpOworICAgICAgdmVjdG9yX3NldCAodmxpbmUsICdcMCcpOworICAgIH0KKyAgZWxzZSAKKyAgICBpZiAoaXNzcGFjZSAoKGludCkgdnR5LT5idWZbdnR5LT5sZW5ndGggLSAxXSkpCisgICAgICB2ZWN0b3Jfc2V0ICh2bGluZSwgJ1wwJyk7CisKKyAgZGVzY3JpYmUgPSBjbWRfZGVzY3JpYmVfY29tbWFuZCAodmxpbmUsIHZ0eSwgJnJldCk7CisKKyAgdnR5X291dCAodnR5LCAiJXMiLCBWVFlfTkVXTElORSk7CisKKyAgLyogQW1iaWd1b3VzIGVycm9yLiAqLworICBzd2l0Y2ggKHJldCkKKyAgICB7CisgICAgY2FzZSBDTURfRVJSX0FNQklHVU9VUzoKKyAgICAgIGNtZF9mcmVlX3N0cnZlYyAodmxpbmUpOworICAgICAgdnR5X291dCAodnR5LCAiJSUgQW1iaWd1b3VzIGNvbW1hbmQuJXMiLCBWVFlfTkVXTElORSk7CisgICAgICB2dHlfcHJvbXB0ICh2dHkpOworICAgICAgdnR5X3JlZHJhd19saW5lICh2dHkpOworICAgICAgcmV0dXJuOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDTURfRVJSX05PX01BVENIOgorICAgICAgY21kX2ZyZWVfc3RydmVjICh2bGluZSk7CisgICAgICB2dH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PmNtZCwKKwkJIGRlc2MtPnN0ciwgVlRZX05FV0xJTkUpOworICAgICAgZWxzZQorCXZ0eV9kZXNjcmliZV9mb2xkICh2dHksIHdpZHRoLCBkZXNjX3dpZHRoLCBkZXNjKTsKKyAgICB9CisKKyAgY21kX2ZyZWVfc3RydmVjICh2bGluZSk7CisgIHZlY3Rvcl9mcmVlIChkZXNjcmliZSk7CisKKyAgdnR5X3Byb21wdCAodnR5KTsKKyAgdnR5X3JlZHJhd19saW5lICh2dHkpOworfQorCit2b2lkCit2dHlfY2xlYXJfYnVmIChzdHJ1Y3QgdnR5ICp2dHkpCit7CisgIG1lbXNldCAodnR5LT5idWYsIDAsIHZ0eS0+bWF4KTsKK30KKworLyogXkMgc3RvcCBjdXJyZW50IGlucHV0IGFuZCBkbyBub3QgYWRkIGNvbW1hbmQgbGluZSB0byB0aGUgaGlzdG9yeS4gKi8KK3N0YXRpYyB2b2lkCit2dHlfc3RvcF9pbnB1dCAoc3RydWN0IHZ0eSAqdnR5KQoreworICB2dHktPmNwID0gdnR5LT5sZW5ndGggPSAwOworICB2dHlfY2xlYXJfYnVmICh2dHkpOworICB2dHlfb3V0ICh2dHksICIlcyIsIFZUWV9ORVdMSU5FKTsKKworICBzd2l0Y2ggKHZ0eS0+bm9kZSkKKyAgICB7CisgICAgY2FzZSBWSUVXX05PREU6CisgICAgY2FzZSBFTkFCTEVfTk9ERToKKyAgICAgIC8qIE5vdGhpbmcgdG8gZG8uICovCisgICAgICBicmVhazsKKyAgICBjYXNlIENPTkZJR19OT0RFOgorICAgIGNhc2UgSU5URVJGQUNFX05PREU6CisgICAgY2FzZSBaRUJSQV9OT0RFOgorICAgIGNhc2UgUklQX05PREU6CisgICAgY2FzZSBSSVBOR19OT0RFOgorICAgIGNhc2UgQkdQX05PREU6CisgICAgY2FzZSBSTUFQX05PREU6CisgICAgY2FzZSBPU1BGX05PREU6CisgICAgY2FzZSBPU1BGNl9OT0RFOgorICAgIGNhc2UgSVNJU19OT0RFOgor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SAoTVRZUEVfVlRZX0hJU1QsIHZ0eS0+aGlzdFt2dHktPmhpbmRleF0pOworICB2dHktPmhpc3RbdnR5LT5oaW5kZXhdID0gWFNUUkRVUCAoTVRZUEVfVlRZX0hJU1QsIHZ0eS0+YnVmKTsKKworICAvKiBIaXN0b3J5IGluZGV4IHJvdGF0aW9uLiAqLworICB2dHktPmhpbmRleCsrOworICBpZiAodnR5LT5oaW5kZXggPT0gVlRZX01BWEhJU1QpCisgICAgdnR5LT5oaW5kZXggPSAwOworCisgIHZ0eS0+aHAgPSB2dHktPmhpbmRleDsKK30KKworLyogI2RlZmluZSBURUxORVRfT1BUSU9OX0RFQlVHICovCisKKy8qIEdldCB0ZWxuZXQgd2luZG93IHNpemUuICovCitzdGF0aWMgaW50Cit2dHlfdGVsbmV0X29wdGlvbiAoc3RydWN0IHZ0eSAqdnR5LCB1bnNpZ25lZCBjaGFyICpidWYsIGludCBuYnl0ZXMpCit7CisjaWZkZWYgVEVMTkVUX09QVElPTl9ERUJVRworICBpbnQgaTsKKworICBmb3IgKGkgPSAwOyBpIDwgbmJ5dGVzOyBpKyspCisgICAgeworICAgICAgc3dpdGNoIChidWZbaV0pCisJeworCWNhc2UgSUFDOgorCSAgdnR5X291dCAodnR5LCAiSUFDICIpOworCSAgYnJlYWs7CisJY2FzZSBXSUxMOgorCSAgdnR5X291dCAodnR5LCAiV0lMTCAiKTsKKwkgIGJyZWFrOworCWNhc2UgV09OVDoKKwkgIHZ0eV9vdXQgKHZ0eSwgIldPTlQgIik7CisJICBicmVhazsKKwljYXNlIERPOgorCSAgdnR5X291dCAodnR5LCAiRE8gIik7CisJICBicmVhazsKKwljYXNlIERPTlQ6CisJICB2dHlfb3V0ICh2dHksICJET05UICIpOworCSAgYnJlYWs7CisJY2FzZSBTQjoKKwkgIHZ0eV9vdXQgKHZ0eSwgIlNCICIpOworCSAgYnJlYWs7CisJY2FzZSBTRToKKwkgIHZ0eV9vdXQgKHZ0eSwgIlNFICIpOworCSAgYnJ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gICAgICB2dHlfZm9yd2FyZF93b3JkICh2dHkpOworCSAgICAgIHZ0eS0+ZXNjYXBlID0gVlRZX05PUk1BTDsKKwkgICAgICBicmVhazsKKwkgICAgY2FzZSAnZCc6CisJICAgICAgdnR5X2ZvcndhcmRfa2lsbF93b3JkICh2dHkpOworCSAgICAgIHZ0eS0+ZXNjYXBlID0gVlRZX05PUk1BTDsKKwkgICAgICBicmVhazsKKwkgICAgY2FzZSBDT05UUk9MKCdIJyk6CisJICAgIGNhc2UgMHg3ZjoKKwkgICAgICB2dHlfYmFja3dhcmRfa2lsbF93b3JkICh2dHkpOworCSAgICAgIHZ0eS0+ZXNjYXBlID0gVlRZX05PUk1BTDsKKwkgICAgICBicmVhazsKKwkgICAgZGVmYXVsdDoKKwkgICAgICB2dHktPmVzY2FwZSA9IFZUWV9OT1JNQUw7CisJICAgICAgYnJlYWs7CisJICAgIH0KKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgc3dpdGNoIChidWZbaV0pCisJeworCWNhc2UgQ09OVFJPTCgnQScpOgorCSAgdnR5X2JlZ2lubmluZ19vZl9saW5lICh2dHkpOworCSAgYnJlYWs7CisJY2FzZSBDT05UUk9MKCdCJyk6CisJICB2dHlfYmFja3dhcmRfY2hhciAodnR5KTsKKwkgIGJyZWFrOworCWNhc2UgQ09OVFJPTCgnQycpOgorCSAgdnR5X3N0b3BfaW5wdXQgKHZ0eSk7CisJICBicmVhazsKKwljYXNlIENPTlRST0woJ0QnKToKKwkgIHZ0eV9kZWxldGVfY2hhciAodnR5KTsKKwkgIGJyZWFrOworCWNhc2UgQ09OVFJPTCgnRScpOgorCSAgdnR5X2VuZF9vZl9saW5lICh2dHkpOworCSAgYnJlYWs7CisJY2FzZSBDT05UUk9MKCdGJyk6CisJICB2dHlfZm9yd2FyZF9jaGFyICh2dHkpOworCSAgYnJlYWs7CisJY2FzZSBDT05UUk9MKCdIJyk6CisJY2FzZSAweDdmOgorCSAgdnR5X2RlbGV0ZV9iYWNrd2Fy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TT0NLX1NUUkVBTTsKKyAgc3ByaW50ZiAocG9ydF9zdHIsICIlZCIsIHBvcnQpOworICBwb3J0X3N0cltzaXplb2YgKHBvcnRfc3RyKSAtIDFdID0gJ1wwJzsKKworICByZXQgPSBnZXRhZGRyaW5mbyAoaG9zdG5hbWUsIHBvcnRfc3RyLCAmcmVxLCAmYWluZm8pOworCisgIGlmIChyZXQgIT0gMCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJnZXRhZGRyaW5mbyBmYWlsZWQ6ICVzXG4iLCBnYWlfc3RyZXJyb3IgKHJldCkpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFpbmZvX3NhdmUgPSBhaW5mbzsKKworICBkbworICAgIHsKKyAgICAgIGlmIChhaW5mby0+YWlfZmFtaWx5ICE9IEFGX0lORVQKKyNpZmRlZiBIQVZFX0lQVjYKKwkgICYmIGFpbmZvLT5haV9mYW1pbHkgIT0gQUZfSU5FVDYKKyNlbmRpZiAvKiBIQVZFX0lQVjYgKi8KKwkgICkKKwljb250aW51ZTsKKworICAgICAgc29jayA9IHNvY2tldCAoYWluZm8tPmFpX2ZhbWlseSwgYWluZm8tPmFpX3NvY2t0eXBlLCBhaW5mby0+YWlfcHJvdG9jb2wpOworICAgICAgaWYgKHNvY2sgPCAwKQorCWNvbnRpbnVlOworCisgICAgICBzb2Nrb3B0X3JldXNlYWRkciAoc29jayk7CisgICAgICBzb2Nrb3B0X3JldXNlcG9ydCAoc29jayk7CisKKyAgICAgIHJldCA9IGJpbmQgKHNvY2ssIGFpbmZvLT5haV9hZGRyLCBhaW5mby0+YWlfYWRkcmxlbik7CisgICAgICBpZiAocmV0IDwgMCkKKwl7CisJICBjbG9zZSAoc29jayk7CS8qIEF2b2lkIHNkIGxlYWsuICovCisJY29udGludWU7CisJfQorCisgICAgICByZXQgPSBsaXN0ZW4gKHNvY2ssIDMpOworICAgICAgaWYgKHJldCA8IDApIAorCXsKKwkgIGNsb3NlIChzb2NrKTs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BBdm9pZCBzZCBsZWFrLiAqLworICAgICAgcmV0dXJuOworICAgIH0KKworICAvKiBMaXN0ZW4gc29ja2V0IHVuZGVyIHF1ZXVlIDMuICovCisgIHJldCA9IGxpc3RlbiAoYWNjZXB0X3NvY2ssIDMpOworICBpZiAocmV0IDwgMCkgCisgICAgeworICAgICAgemxvZyAoTlVMTCwgTE9HX1dBUk5JTkcsICJjYW4ndCBsaXN0ZW4gc29ja2V0Iik7CisgICAgICBjbG9zZSAoYWNjZXB0X3NvY2spOwkvKiBBdm9pZCBzZCBsZWFrLiAqLworICAgICAgcmV0dXJuOworICAgIH0KKworICAvKiBBZGQgdnR5IHNlcnZlciBldmVudC4gKi8KKyAgdnR5X2V2ZW50IChWVFlfU0VSViwgYWNjZXB0X3NvY2ssIE5VTEwpOworfQorCisjaWZkZWYgVlRZU0gKKy8qIEZvciBzb2NrYWRkcl91bi4gKi8KKyNpbmNsdWRlIDxzeXMvdW4uaD4KKworLyogVlRZIHNoZWxsIFVOSVggZG9tYWluIHNvY2tldC4gKi8KK3ZvaWQKK3Z0eV9zZXJ2X3VuIChjaGFyICpwYXRoKQoreworICBpbnQgcmV0OworICBpbnQgc29jaywgbGVuOworICBzdHJ1Y3Qgc29ja2FkZHJfdW4gc2VydjsKKyAgbW9kZV90IG9sZF9tYXNrOworCisgIC8qIEZpcnN0IG9mIGFsbCwgdW5saW5rIGV4aXN0aW5nIHNvY2tldCAqLworICB1bmxpbmsgKHBhdGgpOworCisgIC8qIFNldCB1bWFzayAqLworICBvbGRfbWFzayA9IHVtYXNrICgwMDc3KTsKKworICAvKiBNYWtlIFVOSVggZG9tYWluIHNvY2tldC4gKi8KKyAgc29jayA9IHNvY2tldCAoQUZfVU5JWCwgU09DS19TVFJFQU0sIDApOworICBpZiAoc29jayA8IDApCisgICAgeworICAgICAgcGVycm9yICgic29jayIpOworICAgICAgcmV0dXJuOworICAgIH0KKworICAvKiBNYWtlIHNlcnZlciBzb2NrZXQuICovCisgIG1lbXNldCA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RUFEX0ZEICh0aHJlYWQpOworICB2dHkgPSBUSFJFQURfQVJHICh0aHJlYWQpOworICB2dHktPnRfcmVhZCA9IE5VTEw7CisKKyAgbmJ5dGVzID0gcmVhZCAoc29jaywgYnVmLCBWVFlfUkVBRF9CVUZTSVopOworICBpZiAobmJ5dGVzIDw9IDApCisgICAgeworICAgICAgdnR5X2Nsb3NlICh2dHkpOworI2lmZGVmIFZUWVNIX0RFQlVHCisgICAgICBwcmludGYgKCJjbG9zZSB2dHlzaFxuIik7CisjZW5kaWYgLyogVlRZU0hfREVCVUcgKi8KKyAgICAgIHJldHVybiAwOworICAgIH0KKworI2lmZGVmIFZUWVNIX0RFQlVHCisgIHByaW50ZiAoImxpbmU6ICVzXG4iLCBidWYpOworI2VuZGlmIC8qIFZUWVNIX0RFQlVHICovCisKKyAgdnR5X2Vuc3VyZSAodnR5LCBuYnl0ZXMpOworICBtZW1jcHkgKHZ0eS0+YnVmLCBidWYsIG5ieXRlcyk7CisgIAorICAvKiBQYXNzIHRoaXMgbGluZSB0byBwYXJzZXIuICovCisgIHJldCA9IHZ0eV9leGVjdXRlICh2dHkpOworCisgIHZ0eV9jbGVhcl9idWYgKHZ0eSk7CisKKyAgLyogUmV0dXJuIHJlc3VsdC4gKi8KKyNpZmRlZiBWVFlTSF9ERUJVRworICBwcmludGYgKCJyZXN1bHQ6ICVkXG4iLCByZXQpOworICBwcmludGYgKCJ2dHlzaCBub2RlOiAlZFxuIiwgdnR5LT5ub2RlKTsKKyNlbmRpZiAvKiBWVFlTSF9ERUJVRyAqLworCisgIGhlYWRlclszXSA9IHJldDsKKyAgd3JpdGUgKHZ0eS0+ZmQsIGhlYWRlciwgNCk7CisKKyAgdnR5X2V2ZW50IChWVFlTSF9SRUFELCBzb2NrLCB2dHkpOworCisgIHJldHVybiAwOworfQorI2VuZGlmIC8qIFZUWVNIICovCisKKy8qIERldGVybWluZSBhZGRyZXNzIGZhbWlseSB0byBiaW5kLiAqLwordm9pZAordnR5X3Nlcn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AqZnVsbHBhdGg7CisKKyAgLyogSWYgLWYgZmxhZyBzcGVjaWZpZWQuICovCisgIGlmIChjb25maWdfZmlsZSAhPSBOVUxMKQorICAgIHsKKyAgICAgIGlmICghIElTX0RJUkVDVE9SWV9TRVAgKGNvbmZpZ19maWxlWzBdKSkKKwl7CisJICBjd2QgPSBnZXRjd2QgKE5VTEwsIE1BWFBBVEhMRU4pOworCSAgZnVsbHBhdGggPSBYTUFMTE9DIChNVFlQRV9UTVAsIAorCQkJICAgICAgc3RybGVuIChjd2QpICsgc3RybGVuIChjb25maWdfZmlsZSkgKyAyKTsKKwkgIHNwcmludGYgKGZ1bGxwYXRoLCAiJXMvJXMiLCBjd2QsIGNvbmZpZ19maWxlKTsKKwl9CisgICAgICBlbHNlCisJZnVsbHBhdGggPSBjb25maWdfZmlsZTsKKworICAgICAgY29uZnAgPSBmb3BlbiAoZnVsbHBhdGgsICJyIik7CisKKyAgICAgIGlmIChjb25mcCA9PSBOVUxMKQorCXsKKwkgIGNvbmZwID0gdnR5X3VzZV9iYWNrdXBfY29uZmlnIChmdWxscGF0aCk7CisJICBpZiAoY29uZnApCisJICAgIGZwcmludGYgKHN0ZGVyciwgIldBUk5JTkc6IHVzaW5nIGJhY2t1cCBjb25maWd1cmF0aW9uIGZpbGUhXG4iKTsKKwkgIGVsc2UKKwkgICAgeworCSAgICAgIGZwcmludGYgKHN0ZGVyciwgImNhbid0IG9wZW4gY29uZmlndXJhdGlvbiBmaWxlIFslc11cbiIsIAorCQkgICAgICAgY29uZmlnX2ZpbGUpOworCSAgICAgIGV4aXQoMSk7CisJICAgIH0KKwl9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgLyogUmVsYXRpdmUgcGF0aCBjb25maWd1cmF0aW9uIGZpbGUgb3Blbi4gKi8KKyAgICAgIGlmIChjb25maWdfY3VycmVudF9kaXIpCisJeworCSAgY29uZnAgPSBmb3BlbiAoY29uZmlnX2N1cnJlbnRfZGlyLCAiciIpOworCSAgaWYgKGNv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ICBpZiAodnR5LT52X3RpbWVvdXQpCisJeworCSAgaWYgKHZ0eS0+dF90aW1lb3V0KQorCSAgICB0aHJlYWRfY2FuY2VsICh2dHktPnRfdGltZW91dCk7CisJICB2dHktPnRfdGltZW91dCA9IAorCSAgICB0aHJlYWRfYWRkX3RpbWVyIChtYXN0ZXIsIHZ0eV90aW1lb3V0LCB2dHksIHZ0eS0+dl90aW1lb3V0KTsKKwl9CisgICAgICBicmVhazsKKyAgICBjYXNlIFZUWV9XUklURToKKyAgICAgIGlmICghIHZ0eS0+dF93cml0ZSkKKwl2dHktPnRfd3JpdGUgPSB0aHJlYWRfYWRkX3dyaXRlIChtYXN0ZXIsIHZ0eV9mbHVzaCwgdnR5LCBzb2NrKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgVlRZX1RJTUVPVVRfUkVTRVQ6CisgICAgICBpZiAodnR5LT50X3RpbWVvdXQpCisJeworCSAgdGhyZWFkX2NhbmNlbCAodnR5LT50X3RpbWVvdXQpOworCSAgdnR5LT50X3RpbWVvdXQgPSBOVUxMOworCX0KKyAgICAgIGlmICh2dHktPnZfdGltZW91dCkKKwl7CisJICB2dHktPnRfdGltZW91dCA9IAorCSAgICB0aHJlYWRfYWRkX3RpbWVyIChtYXN0ZXIsIHZ0eV90aW1lb3V0LCB2dHksIHZ0eS0+dl90aW1lb3V0KTsKKwl9CisgICAgICBicmVhazsKKyAgICB9Cit9CisMCitERUZVTiAoY29uZmlnX3dobywKKyAgICAgICBjb25maWdfd2hvX2NtZCwKKyAgICAgICAid2hvIiwKKyAgICAgICAiRGlzcGxheSB3aG8gaXMgb24gdnR5XG4iKQoreworICBpbnQgaTsKKyAgc3RydWN0IHZ0eSAqdjsKKworICBmb3IgKGkgPSAwOyBpIDwgdmVjdG9yX21heCAodnR5dmVjKTsgaSsrKQorICAgIGlmICgodiA9IHZlY3Rvcl9zbG90ICh2dHl2ZWMsIGkpKSAhPSBOVUxMKQorICAgICAgdnR5X291dCAodnR5LCAiJXN2d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KyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoZXhlY190aW1lb3V0X21pbiwKKyAgICAgICBleGVjX3RpbWVvdXRfbWluX2NtZCwKKyAgICAgICAiZXhlYy10aW1lb3V0IDwwLTM1NzkxPiIsCisgICAgICAgIlNldCB0aW1lb3V0IHZhbHVlXG4iCisgICAgICAgIlRpbWVvdXQgdmFsdWUgaW4gbWludXRlc1xuIikKK3sKKyAgcmV0dXJuIGV4ZWNfdGltZW91dCAodnR5LCBhcmd2WzBdLCBOVUxMKTsKK30KKworREVGVU4gKGV4ZWNfdGltZW91dF9zZWMsCisgICAgICAgZXhlY190aW1lb3V0X3NlY19jbWQsCisgICAgICAgImV4ZWMtdGltZW91dCA8MC0zNTc5MT4gPDAtMjE0NzQ4Mz4iLAorICAgICAgICJTZXQgdGhlIEVYRUMgdGltZW91dFxuIgorICAgICAgICJUaW1lb3V0IGluIG1pbnV0ZXNcbiIKKyAgICAgICAiVGltZW91dCBpbiBzZWNvbmRzXG4iKQoreworICByZXR1cm4gZXhlY190aW1lb3V0ICh2dHksIGFyZ3ZbMF0sIGFyZ3ZbMV0pOworfQorCitERUZVTiAobm9fZXhlY190aW1lb3V0LAorICAgICAgIG5vX2V4ZWNfdGltZW91dF9jbWQsCisgICAgICAgIm5vIGV4ZWMtdGltZW91dCIsCisgICAgICAgTk9fU1RSCisgICAgICAgIlNldCB0aGUgRVhFQyB0aW1lb3V0XG4iKQoreworICByZXR1cm4gZXhlY190aW1lb3V0ICh2dHksIE5VTEwsIE5VTEwpOworfQorCisvKiBTZXQgdnR5IGFjY2VzcyBjbGFzcy4gKi8KK0RFRlVOICh2dHlfYWNjZXNzX2NsYXNzLAorICAgICAgIHZ0eV9hY2Nlc3NfY2xhc3NfY21kLAorICAgICAgICJhY2Nlc3MtY2xhc3MgV09SRCIsCisgICAgICAgIkZpbHRlciBjb25uZWN0aW9ucyBiYXNlZCBvbiBhbiBJUCBhY2Nlc3MgbGlzdFxuIgorICAg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5vIHNlcnZpY2UgYWR2YW5jZWQtdnR5IiwKKyAgICAgICBOT19TVFIKKyAgICAgICAiU2V0IHVwIG1pc2NlbGxhbmVvdXMgc2VydmljZVxuIgorICAgICAgICJFbmFibGUgYWR2YW5jZWQgbW9kZSB2dHkgaW50ZXJmYWNlXG4iKQoreworICBob3N0LmFkdmFuY2VkID0gMDsKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAodGVybWluYWxfbW9uaXRvciwKKyAgICAgICB0ZXJtaW5hbF9tb25pdG9yX2NtZCwKKyAgICAgICAidGVybWluYWwgbW9uaXRvciIsCisgICAgICAgIlNldCB0ZXJtaW5hbCBsaW5lIHBhcmFtZXRlcnNcbiIKKyAgICAgICAiQ29weSBkZWJ1ZyBvdXRwdXQgdG8gdGhlIGN1cnJlbnQgdGVybWluYWwgbGluZVxuIikKK3sKKyAgdnR5LT5tb25pdG9yID0gMTsKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAodGVybWluYWxfbm9fbW9uaXRvciwKKyAgICAgICB0ZXJtaW5hbF9ub19tb25pdG9yX2NtZCwKKyAgICAgICAidGVybWluYWwgbm8gbW9uaXRvciIsCisgICAgICAgIlNldCB0ZXJtaW5hbCBsaW5lIHBhcmFtZXRlcnNcbiIKKyAgICAgICBOT19TVFIKKyAgICAgICAiQ29weSBkZWJ1ZyBvdXRwdXQgdG8gdGhlIGN1cnJlbnQgdGVybWluYWwgbGluZVxuIikKK3sKKyAgdnR5LT5tb25pdG9yID0gMDsKKyAgcmV0dXJuIENNRF9TVUNDRVNTOworfQorCitERUZVTiAoc2hvd19oaXN0b3J5LAorICAgICAgIHNob3dfaGlzdG9yeV9jbWQsCisgICAgICAgInNob3cgaGlzdG9yeSIsCisgICAgICAgU0hPV19TVFIKKyAgICAgICAiRGlzcGxheSB0aGUgc2Vzc2lvbiBjb21tYW5kIGhpc3RvcnlcbiIpCit7CisgIGludCBpbmRleDsKKworICBmb3IgKGluZGV4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kFfTUVTU0FHRV9NQVggICAgICAgICAgICAgICAgIDE5CisKKy8qIFplYnJhIHJvdXRlJ3MgdHlwZXMuICovCisjZGVmaW5lIFpFQlJBX1JPVVRFX1NZU1RFTSAgICAgICAgICAgICAgIDAKKyNkZWZpbmUgWkVCUkFfUk9VVEVfS0VSTkVMICAgICAgICAgICAgICAgMQorI2RlZmluZSBaRUJSQV9ST1VURV9DT05ORUNUICAgICAgICAgICAgICAyCisjZGVmaW5lIFpFQlJBX1JPVVRFX1NUQVRJQyAgICAgICAgICAgICAgIDMKKyNkZWZpbmUgWkVCUkFfUk9VVEVfUklQICAgICAgICAgICAgICAgICAgNAorI2RlZmluZSBaRUJSQV9ST1VURV9SSVBORyAgICAgICAgICAgICAgICA1CisjZGVmaW5lIFpFQlJBX1JPVVRFX09TUEYgICAgICAgICAgICAgICAgIDYKKyNkZWZpbmUgWkVCUkFfUk9VVEVfT1NQRjYgICAgICAgICAgICAgICAgNworI2RlZmluZSBaRUJSQV9ST1VURV9JU0lTICAgICAgICAgICAgICAgICA4CisjZGVmaW5lIFpFQlJBX1JPVVRFX0JHUCAgICAgICAgICAgICAgICAgIDkKKyNkZWZpbmUgWkVCUkFfUk9VVEVfTUFYICAgICAgICAgICAgICAgICAgMTAKKworLyogWmVicmEncyBmYW1pbHkgdHlwZXMuICovCisjZGVmaW5lIFpFQlJBX0ZBTUlMWV9JUFY0ICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgWkVCUkFfRkFNSUxZX0lQVjYgICAgICAgICAgICAgICAgMgorI2RlZmluZSBaRUJSQV9GQU1JTFlfTUFYICAgICAgICAgICAgICAgICAzCisKKy8qIEVycm9yIGNvZGVzIG9mIHplYnJhLiAqLworI2RlZmluZSBaRUJSQV9FUlJfUlRFWElTVCAgICAgICAgICAgICAgIC0xCisjZGVmaW5lIFpFQlJBX0VSUl9SVFVOUkVBQ0ggICAgICAgICAgICAgLTIKKyNkZWZpbmUgWkVCUkFfRVJSX0VQRVJNICAgICAgIC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MDEJLyogSW50ZXJuZXQgYWRkcmVzcyAxMjcuMC4wLjEuICAqLworI2VuZGlmCisKKy8qIEFkZHJlc3MgZmFtaWx5IG51bWJlcnMgZnJvbSBSRkMxNzAwLiAqLworI2RlZmluZSBBRklfSVAgICAgICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgQUZJX0lQNiAgICAgICAgICAgICAgICAgICAyCisjZGVmaW5lIEFGSV9NQVggICAgICAgICAgICAgICAgICAgMworCisvKiBTdWJzZXF1ZW50IEFkZHJlc3MgRmFtaWx5IElkZW50aWZpZXIuICovCisjZGVmaW5lIFNBRklfVU5JQ0FTVCAgICAgICAgICAgICAgMQorI2RlZmluZSBTQUZJX01VTFRJQ0FTVCAgICAgICAgICAgIDIKKyNkZWZpbmUgU0FGSV9VTklDQVNUX01VTFRJQ0FTVCAgICAzCisjZGVmaW5lIFNBRklfTVBMU19WUE4gICAgICAgICAgICAgNAorI2RlZmluZSBTQUZJX01BWCAgICAgICAgICAgICAgICAgIDUKKworLyogRmlsdGVyIGRpcmVjdGlvbi4gICovCisjZGVmaW5lIEZJTFRFUl9JTiAgICAgICAgICAgICAgICAgMAorI2RlZmluZSBGSUxURVJfT1VUICAgICAgICAgICAgICAgIDEKKyNkZWZpbmUgRklMVEVSX01BWCAgICAgICAgICAgICAgICAyCisKKy8qIERlZmF1bHQgQWRtaW5pc3RyYXRpdmUgRGlzdGFuY2Ugb2YgZWFjaCBwcm90b2NvbC4gKi8KKyNkZWZpbmUgWkVCUkFfS0VSTkVMX0RJU1RBTkNFX0RFRkFVTFQgICAgICAwCisjZGVmaW5lIFpFQlJBX0NPTk5FQ1RfRElTVEFOQ0VfREVGQVVMVCAgICAgMAorI2RlZmluZSBaRUJSQV9TVEFUSUNfRElTVEFOQ0VfREVGQVVMVCAgICAgIDEKKyNkZWZpbmUgWkVCUkFfUklQX0RJU1RBTkNFX0RFRkFVTFQgICAgICAgMTIwCisjZGVmaW5lIFpFQlJBX1JJUE5HX0RJU1RBTkNF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oIGF1dG9tYWtlIHRvIHByb2R1Y2UgTWFrZWZpbGUuaW4uCisKK0lOQ0xVREVTID0gQElOQ0xVREVTQCAtSS4uIC1JJCh0b3Bfc3JjZGlyKSAtSSQodG9wX3NyY2RpcikvbGliCitERUZTID0gQERFRlNAIC1EU1lTQ09ORkRJUj1cIiQoc3lzY29uZmRpcikvXCIKKworbm9pbnN0X0xJQlJBUklFUyA9IGxpYnRvcG9sb2d5LmEKKworbGlidG9wb2xvZ3lfYV9TT1VSQ0VTID0gXAorCXNwZ3JpZC5jCisKK2xpYnRvcG9sb2d5X2FfREVQRU5ERU5DSUVTID0gQExJQl9SRUdFWEAKKworbGlidG9wb2xvZ3lfYV9MSUJBREQgPSBATElCX1JFR0VYQCAuLi8uLi9saWIvbGliemVicmEuYQorCitub2luc3RfSEVBREVSUyA9IFwKKwlzcGdyaWQuaAorCitFWFRSQV9ESVNUID0gcmVnZXguYyByZWdleC1nbnUuaAorCitkZXBlbmQ6CisJQCQoQ1BQKSAtTU0gJChJTkNMVURFUykgJChMREZMQUdTKSAqLmMKKworIyMgRmlsZSBkZXBlbmRlbmN5LgpkaWZmIC0tZ2l0IGEvaXNpc2QvdG9wb2xvZ3kvcmFuZG9tLmMgYi9pc2lzZC90b3BvbG9neS9yYW5kb20uYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kNGVmOTk1Ci0tLSAvZGV2L251bGwKKysrIGIvaXNpc2QvdG9wb2xvZ3kvcmFuZG9tLmMKQEAgLTAsMCArMSwxNTQgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogY3VycmVudCBwcm9jZXNzb3IgdGltZSBpbiBzZWNvbmRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIGRpZmZlcmVuY2UgYmV0d2VlbiB0d28gY2FsbHMgaXMgcHJvY2Vzc29yIHRpbWUgc3BlbnQgYnkgeW91ciBjb2RlICovCisvKiBuZWVkczogPHN5cy90eXBlcy5oPiwgPHN5cy90aW1lcy5oPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogZGVwZW5kcyBvbiBjb21waWxlciBhbmQgT1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaW5jbHVkZSA8c3lzL3R5cGVzLmg+CisjaW5jbHVkZSA8c3lzL3RpbWVzLmg+CisKK2Zsb2F0IHRpbWVyKCkKKyAgIHsgc3RydWN0IHRtcyBob2xkOworCisgICAgICAgIHRpbWVzKCZob2xkKTsKKyAgICAgICAgcmV0dXJuICAoZmxvYXQpKGhvbGQudG1zX3V0aW1lKSAvIDYwLjA7CisgICB9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgIEZhbWlseSBvZiByYW5kb20gbnVtYmVyIGdlbmVyYXRvcnMgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBJbml0aWFsaXNhdGlvbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgIHZvaWQgaW5pdF9yYW5kICggc2VlZCApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgIGxvbmcgc2VlZCAgICAgLSBhbnkgcG9zaXRpdmUgbnVtYmVyICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgc2VlZDw9MCBpbml0X3JhbmQgdGFrZXMgdGltZSAgICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gdGltZXIgaW5zdGVhZCBvZiBzZWVkICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICBXaG9sZSBudW1iZXIgdW5pZm9ybWx5IGRpc3RyaWJ1dGVkIG9uIFswLG4pOiAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgIGxvbmcgbnJhbmQgKG4pOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgIGxvbmcgbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgUmVhbCBudW1iZXIgdW5pZm9ybWx5IGRpc3RyaWJ1dGVkIG9uIFswLDFdICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICBkb3VibGUgcmFuZDAxKCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgUmVhbCBudW1iZXIgd2l0aCBHYXVzcygwLDEpIGRpc2l0cmlidXRpb246ICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICBkb3VibGUgcmFuZGcwMSgpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgQWxnb3JpdGhtOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICB4KG4rMSkgPSAoeChuKSAqIDVeMTMpIG1vZCAyXjMxICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit1bnNpZ25lZCBsb25nIGludGVybmFsX3NlZWQ7CisKK3ZvaWQgaW5pdF9yYW5kICggaW5pdF9zZWVkICkKKworbG9uZyBpbml0X3NlZWQ7CisKK3sgaW50ZXJuYWxfc2VlZCA9ICggaW5pdF9zZWVkID4gMCApCisgICAgICAgICAgICAgICAgID8gKHVuc2lnbmVkIGxvbmcpIGluaXRfc2VlZAorICAgICAgICAgICAgICAgICA6ICh1bnNpZ25lZCBsb25nKSB0aW1lcigpOyAKKyAgICAgICAgICAgICAgICAKKworICAvKiBvbmx5IG9kZCBudW1iZXJzIGFyZSBhY2NlcHRhYmxlICovCisgIGlmICggaW50ZXJuYWxfc2VlZCAlIDIgPT0gMCApIGludGVybmFsX3NlZWQgLS07Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogSW50ZXJuYWwgZnVuY3Rpb24gIGlyYW5kICBtYXkgZGVwZW5kIG9uIE9TIGFuZCBjb21waWxlciAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiBpcmFuZCBhc3N1bXB0aW9uOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogdW5zaWduZWQgbG9uZyBpLGo7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgaWYgaSpqID4gbWF4KHVuc2lnbmVkIGxvbmcpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgMS4gTm8gb3ZlcmZsb3cgaW50ZXJydXB0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgIDIuIGkqaiA9IGkqaiBtb2QgbWF4KHVuc2lnbmVkIGxvbmcpICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiBUaGlzIGFzc3VtcHRpb24gaXMgdHJ1ZSBmb3IgYSBsb3Qgb2YgY29tcHV0ZXJzLiAgICAgICAgICAgICAgICAgICAqLworLyogSWYgeW91ciBjb21wdXRlciBmYWlsczogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qICAgcmVuYW1lOiBpcmFuZCA8LS0tPiB4cmFuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyAKKyNkZWZpbmUgIEEgICAxMjIwNzAzMTI1CisjZGVmaW5lICBCICAgMjE0NzQ4MzY0NworI2RlZmluZSAgQkYgIDIxNDc0ODM2NDcuCisKK3N0YXRpYyBsb25nIGlyYW5kICgpCisKK3sgaW50ZXJuYWxfc2VlZCA9ICggaW50ZXJuYWxfc2VlZCAqIEEgKSAmIEI7CisgIHJldHVybiAobG9uZykgaW50ZXJuYWxfc2VlZCA7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogICAgICAgICAgICAgIGNvbXB1dGVyIGluZGVwZW5kZW50IHZhcmlhbnQgb2YgIGlyYW5kICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKyNkZWZpbmUgVDE1ICAzMjc2OCAKKyNkZWZpbmUgVDE2ICA2NTUzNgorI2RlZmluZSBBMSAgIDM3MjUyCisjZGVmaW5lIEEyICAgMjk1ODkKKworc3RhdGljIGxvbmcgeHJhbmQoKQorCit7IHVuc2lnbmVkIGxvbmcgaXMxLCBpczI7CisKKyAgaXMxID0gaW50ZXJuYWxfc2VlZCAvIFQxNTsKKyAgaXMyID0gaW50ZXJuYWxfc2VlZCAlIFQxNTsKKworICBpbnRlcm5hbF9zZWVkID0gKCAoKChpczIgKiBBMSkgKyAoaXMxICogQTIpKSUgVDE2ICkqIFQxNSArIChpczIgKiBBMikgKSAmIEI7CisgIHJldHVybiAobG9uZykgKCBpbnRlcm5hbF9zZWVkICkgOworfQorCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworZG91YmxlIHJhbmQwMSgpCisKK3sgcmV0dXJuICAoZG91YmxlKSBpcmFuZCgpIC8gQkYgOworfQorICAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgTksgIDEyCisKK2RvdWJsZSByYW5kZzAxKCkKKworeyBpbnQgaTsKKyAgZG91YmxlIHN1bSA9IDA7CisKKyAgZm9yICggaSA9IDA7IGkgPCBOSzsgaSsrICkgc3VtICs9IHJhbmQwMSgpOworICByZXR1cm4gc3VtIC0gNi47CisKKyAgLyogaWYgICBOSyAhPSAxMiAgdGhlbiB5b3UgbXVzdCByZXR1cm4gKDEyL05LKSpzdW0gLSAoTksvMikgKi8KK30KKworI3VuZGVmIE5LCisgICAgIAorICAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2xvbmcgbnJhbmQgKCBuICkKKworbG9uZyBuOworCit7IHJldHVybiAobG9uZykgKCByYW5kMDEoKSAqIChkb3VibGUpIG4gKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI3VuZGVmIEEKKyN1bmRlZiBBMQorI3VuZGVmIEEyCisjdW5kZWYgQgorI3VuZGVmIEJGCisjdW5kZWYgVDE1CisjdW5kZWYgVDE2CmRpZmYgLS1naXQgYS9pc2lzZC90b3BvbG9neS9zcGFjeWMuYyBiL2lzaXNkL3RvcG9sb2d5L3NwYWN5Yy5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjg1MzE0NDcKLS0tIC9kZXYvbnVsbAorKysgYi9pc2lzZC90b3BvbG9neS9zcGFjeWMuYwpAQCAtMCwwICsxLDQ4MyBAQAorI2luY2x1ZGUgPHN0ZGlvLmg+CisjaW5jbHVkZSA8c3RkbGliLmg+CisjaW5jbHVkZSA8c3RyaW5nLmg+CisjaW5jbHVkZSA8dmFsdWVzLmg+CisKKyNpbmNsdWRlICJyYW5kb20uYyIKKworI2RlZmluZSBEQVNIICctJworI2RlZmluZSBWRVJZX0ZBUiAxMDAwMDAwMDAKKworCisvKiBnZW5lcmF0b3Igb2YgYWN5Y2xpYyByYW5kb20gbmV0d29ya3MgZm9yIHRoZSBzaG9ydGVzdCBwYXRocyBwcm9ibGVtOworICAgZXh0ZW5kZWQgRElNQUNTIGZvcm1hdCBmb3Igb3V0cHV0ICovCisKK21haW4gKCBhcmdjLCBhcmd2ICkKKworaW50IGFyZ2M7CitjaGFyKiBhcmd2W107CisKK3sKKworY2hhciAgIGFyZ3NbMzBdOworCitsb25nICAgbiwKKyAgICAgICBuMCwKKyAgICAgICBzb3VyY2UsCisgICAgICAgaSwKKyAgICAgICBpMCwKKyAgICAgICBqLAorICAgICAgIGRpajsKKworbG9uZyAgIG0sCisgICAgICAgbTAsCisgICAgICAgbWMsCisgICAgICAgazsKKworbG9uZyAgICpwLAorICAgICAgIHBfdCwKKyAgICAgICBsLAorICAgICAgIGx4OworCitsb25nICAgc2VlZCwKKyAgICAgICBzZWVkMSwKKyAgICAgICBzZWVkMjsKKworaW50ICAgIGV4dD0wOworCitGSUxFICAgKmZvdXQ7CisKKy8qIHZhcmlhYmxlcyBmb3IgbGVuZ3RocyBnZW5lcmF0aW5nICovCisvKiBpbml0aWFsaXplZCBieSBkZWZhdWx0IHZhbHVlcyAqLworaW50ICAgIGxfZiA9IDAsIGxsX2YgPSAwLCBsbV9mID0gMCwgbG5fZiA9IDAsIGxzX2YgPSAwOworbG9uZyAgIGxsID0gMTAwMDAsICAgIC8qIHVwcGVyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworICAgICAgIGxtID0gMDsgICAgICAgIC8qIGxvd2VyIGJvdW5kIG9mIHRoZSBpbnR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AnYycgOiAvKiBjb25uZWN0aW5nIHBhdGgocykgKi8KKyAgICAgICAgY19mID0gMTsKKwlzd2l0Y2ggKCBhcmdzWzJdICkKKwkgIHsgCisJICBjYXNlICdsJzogLyogbGVuZ3RoIG9mIHBhdGggYXJjICovCisgICAgICAgICAgICBjX3JhbmQgPSAwOyAvKiBmaXhlZCBhcmMgbGVuZ3RoICovCisJICAgIGNsX2YgPSAxOworCSAgICBjbCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgYnJlYWs7CisJICBjYXNlICdoJzogLyogbnVtYmVyIG9mIGFyY3MgaW4gY29ubmVjdGluZyBwYXRoICovCisJICAgIGNoX2YgPSAxOworCSAgICBjaCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgaWYgKCBjaCA8IDEgfHwgY2ggPiBuICkgZ290byB1c2FnZTsKKwkgICAgYnJlYWs7CisJICBkZWZhdWx0OiAgLyogdW5rbm93biBzd2l0Y2ggIHZhbHVlICovCisJICAgIGdvdG8gdXNhZ2U7CisgICAgICAgICAgfQorCWJyZWFrOworCisgICAgICBjYXNlICdzJyA6IC8qIGFkZGl0aW9uYWwgc291cmNlICovCisgICAgICAgIHNfZiA9IDE7CisJaWYgKCBzdHJsZW4gKCBhcmdzICkgPiAyICkKKwl7ICAKKwlzd2l0Y2ggKCBhcmdzWzJdICkKKwkgIHsgCisJICBjYXNlICdsJzogLyogdXBwZXIgYm91bmQgb2YgYXJ0LiBhcmMgKi8KKwkgICAgc2xfZiA9IDE7CisJICAgIHNsICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKwkgIGNhc2UgJ20nOiAvKiBsb3dlciBib3VuZCBvZiBhcnQuIGFyYyAqLworCSAgICBzbV9mID0gMTsKKwkgICAgc20gID0gIChsb25nKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworCSAgZGVmYXVsdDogIC8qIHVua25vd24gc3dpdGNoICB2YWx1ZSAqLworCSAgICBnb3RvIHVzYWdlOworICAgICAgICAgIH0KKyAgICAgICAgIH0KKwlicmVhazsKKworICAgICAgY2FzZSAncCcgOiAvKiBwb3RlbnRpYWxzICovCisJcF9mID0gMTsKKwlpZiAoIHN0cmxlbiAoIGFyZ3MgKSA+IDIgKQorCXsgIAorCXN3aXRjaCAoIGFyZ3NbMl0gKQorCSAgeyAKKwkgIGNhc2UgJ2wnOiAvKiBsZW5ndGggb2YgdGhlIGludGVydmFsICovCisJICAgIHBsX2YgPSAxOworCSAgICBwbCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ20nOiAvKiBtaW5pbWFsIGJvdW5kICovCisJICAgIHBtX2YgPSAxOworCSAgICBwbSAgPSAobG9uZyApIGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ24nOiAvKiBhZGRpdGlvbmFsIGxlbmd0aDogbCp8aS1qfCAqLworCSAgICBwbl9mID0gMTsKKwkgICAgcG4gID0gYXRvZiAoICZhcmdzWzNdICk7CisJICAgIGJyZWFrOworCSAgY2FzZSAncyc6IC8qIGFkZGl0aW9uYWwgbGVuZ3RoOiBsKnxpLWp8XjIgKi8KKwkgICAgcHNfZiA9IDE7CisJICAgIHBzICA9IGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ2EnOiAvKiBiaXBvbGFyIGRpc3RyaWJ1dGlvbiAqLworCSAgICBwYV9mID0gMTsKKwkgICAgc3dpdGNoICggYXJnc1szXSApCisJICAgICAgeworCSAgICAgIGNhc2UgJ3AnOiAvKiAlIG9mIGFsdGVybmF0aXZlIHBvdGVudGlhbHMgKi8KKyAgICAgICAgICAgICAgICBwYXBfZiA9IDE7CisgICAgICAgICAgICAgICAgcGFwICA9IGF0b2YgKCAmYXJnc1s0XSApOworCQlpZiAoIHBhcCA8IDAgICApIHBhcCA9IDA7CisJCWlmICggcGFwID4gMTAwICkgcGFwID0gMTAwOworICAgICAgICAgICAgICAgIHBhcCAvPSAxMDA7CisJCWJyZWFrOworCSAgICAgIGNhc2UgJ2MnOiAvKiBtdWx0aXBsaWVyICovCisJCXBhY19mID0gMTsKKwkJcGFjID0gYXRvZiAoICZhcmdzWzRdICk7CisJCWJyZWFrOworCSAgICAgIGRlZmF1bHQ6IC8qIHVua25vd24gc3dpdGNoIHZhbHVlICovCisJCWdvdG8gdXNhZ2U7CisJICAgICAgfQorCSAgICBicmVhazsKKwkgIGRlZmF1bHQ6ICAvKiB1bmtub3duIHN3aXRjaCAgdmFsdWUgKi8KKwkgICAgZ290byB1c2FnZTsKKwkgIH0KKyAgICAgIH0KKwlicmVhazsKKworICAgICAgZGVmYXVsdCAgOiAvKiB1bmtub3VuIGNhc2UgKi8KKwlnb3RvIHVzYWdlOworICAgICAgfQorICB9CisgICAKKy8qIC0tLS0tIGFqdXN0aW5nIHBhcmFtZXRlcnMgLS0tLS0gKi8KKworbjAgPSBuOyBtMCA9IG07CisKKy8qIGxlbmd0aCBwYXJhbWV0ZXJzICovCitpZiAoIGxsIDwgbG0gKSB7IGx4ID0gbGw7IGxsID0gbG07IGxtID0gbHg7IH0KKworLyogcG90ZW50aWFsIHBhcmFtZXRlcnMgKi8KK2lmICggcF9mICkKKyAgeworICAgaWYgKCAhIHBsX2YgKSBwbCA9IGxsOworICAgaWYgKCAhIHBtX2YgKSBwbSA9IGxtOworICAgaWYgKCBwbCA8IHBtICkgeyBseCA9IHBsOyBwbCA9IHBtOyBwbSA9IGx4OyB9CisgIH0KKworLyogcGF0aChzKSBwYXJhbWV0ZXJzICovCitpZiAoICEgY2hfZiApIGNoID0gbiAtIDE7CittYyA9IG4gLSAxOworCisgLyogYXJ0aWZpY2FsIHNvdXJjZSBwYXJhbWV0ZXJzICovCitpZiAoIHNfZiApICAgICAgICAgIAorICAgeyBtMCArPSBuOyBuMCArKyA7IAorICAgICBpZiAoICEgc21fZiApIHNtID0gc2w7CisgICAgIGlmICggc2wgPCBzbSApIHsgbHggPSBzbDsgc2wgPSBzbTsgc20gPSBseDsgfQorICAgfQorCisvKi0tLS0tIHByaW50aW5nIHRpdGxlIC0tLS0tKi8KKworcHJpbnRmICgiYyBhY3ljbGljIG5ldHdvcmsgZm9yIHNob3J0ZXN0IHBhdGhzIHByb2JsZW1cbiIpOworcHJpbnRmICgiYyBleHRlbmRlZCBESU1BQ1MgZm9ybWF0XG5jXG4iICk7CisKKworLyogbmFtZSBvZiB0aGUgcHJvYmxlbSAqLworcHJpbnRmICgidCBhY18lbGRfJWxkXyVsZF8iLCBuLCBtLCBzZWVkICk7CitpZiAoIGxfZiApCisgIHByaW50ZiAoIiVjIiwgJ2wnKTsKK2lmICggY19mICkKKyAgcHJpbnRmICgiJWMiLCAnYycpOworaWYgKCBzX2YgKQorICBwcmludGYgKCIlYyIsICdzJyk7CitpZiAoIHBfZiApCisgIHByaW50ZiAoIiVjIiwgJ3AnKTsKK3ByaW50ZiAoIlxuY1xuIik7CisKKy8qIHByaW50aW5nIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gICovCitpZiAoIGxfZiApCisgIHByaW50ZiAoImMgbGVuZ3RoIC0+IG1pbjogJWxkIG1heDogJWxkIGsxOiAlLjJmIGsyOiAlLjJmXG4iLAorICAgICAgICAgICBsbSwgbGwsIGxuLCBscyApOworaWYgKCBjX2YgKQorICBwcmludGYgKCJjIHBhdGgocykgLT4gbnVtYmVyIG9mIGFyY3M6ICVsZCBhcmMgbGVuZ3RoOiAlbGRcbiIsCisgICAgICAgICAgIGNoLCBjbCApOworaWYgKCBzX2YgKQorICBwcmludGYgKCJjIGxlbmd0aCBvZiBhcmNzIGZyb20gYXJ0aWZpY2FsIHNvdXJjZSAtPiBtaW46ICVsZCBtYXg6ICVsZFxuIiwKKyAgICAgICAgICAgc20sIHNsICk7CitpZiAoIHBfZiApCisgIHsKKyAgcHJpbnRmICgiYyBwb3RlbnRpYWxzIC0+IG1pbjogJWxkIG1heDogJWxkIGsxOiAlLjJmIGsyOiAlLjJmXG4iLAorCSAgcG0sIHBsLCBwbiwgcHMgKTsKKyAgaWYgKCBwYV9mICkKKyAgcHJpbnRmICgiYyBwb3RlbnRpYWxzIC0+IHBhcnQgb2YgYWx0ZXJuYXRpdmUgZGlzdHJpYnV0aW9uOiAlLjJmIGs6ICUuMmZcbiIsCisgICAgICAgICAgcGFwLCBwYWMgKTsKKyAgfQorcHJpbnRmICgiY1xuIiApOworCitwcmludGYgKCJwIHNwICU4bGQgJThsZFxuY1xuIiwgbjAsIG0wICk7CisKK3NvdXJjZSA9ICggc19mICkgPyBuMCA6IDE7CitwcmludGYgKCJuICU4bGRcbmNcbiIsIHNvdXJjZSApOworCisKK2lmICggcF9mICkgLyogZ2VuZXJhdGluZyBwb3RlbnRpYWxzICovCisgIHsKKyAgICBzZWVkMSA9IDIqc2VlZCArIDE7CisgICAgcCA9IChsb25nKikgY2FsbG9jICggbisyLCBzaXplb2YgKGxvbmcpICk7CisgICAgaW5pdF9yYW5kICggc2VlZDEpOworICAgIHBsID0gcGwgLSBwbSArIDE7CisKKyAgICBmb3IgKCBpID0gMDsgaSA8PSBuOyBpICsrICkKKyAgICAgIHsKKwlwX3QgPSBwbSArIG5yYW5kICggcGwgKTsKKwlpZiAoIHBuX2YgKSBwX3QgKz0gKGxvbmcpICggaSAqIHBuICk7CisJaWYgKCBwc19mICkgcF90ICs9IChsb25nKSAoIGkgKiAoIGkgKiBwcyApKTsKKwlpZiAoIHBhcF9mICkKKwkgICAgaWYgKCByYW5kMDEoKSA8IHBhcCApCisJCXBfdCA9IChsb25nKSAoIHBfdCAqIHBhYyApOworICAgICAgICBwW2ldID0gcF90OworICAgICAgfQorICAgIHBbbisxXSA9IDA7CisgIH0KKworCitpZiAoIHNfZiApIC8qIGFkZGl0aW9uYWwgYXJjcyBmcm9tIGFydGlmaWNhbCBzb3VyY2UgKi8KKyAgeworICAgIHNlZWQyID0gMypzZWVkICsgMTsKKyAgICBpbml0X3JhbmQgKCBzZWVkMiApOworICAgIHNsID0gc2wgLSBzbSArIDE7CisKKyAgICBmb3IgKCBpID0gbjsgaSA+IDE7IGkgLS0gKQorICAgICAgeworCXMgPSBzbSArIG5yYW5kICggc2wgKTsKKwlQUklOVF9BUkMgKCBuMCwgaSwgcyApIAorICAgICAgfQorCisgICAgUFJJTlRfQVJDICggbjAsIDEsIDAgKQorICB9CisKKy8qIGluaXRpYWxpemUgcmFuZG9tIG51bWJlciBnZW5lcmF0b3IgKi8KK2luaXRfcmFuZCAoIHNlZWQgKTsKK2xsID0gbGwgLSBsbSArIDE7CisKKy8qIGdlbmVyYXRpbmcgY29ubmVjdGluZyBwYXRoKHMpICovCitmb3IgKCBpID0gMTsgaSA8IG47IGkgKysgKQorICB7CisgICAgaWYgKCAoIChpLTEpICUgY2ggKSAhPSAwICkKKyAgICAgIGkwID0gaTsKKyAgICBlbHNlCisgICAgICBpMCA9IDE7CisKKyAgICAgIGlmIChjX3JhbmQpCisgICAgICAgIGNsID0gbG0gKyBucmFuZChsbCk7CisgICAgICBQUklOVF9BUkMgKCBpMCwgaSsxLCBjbCApCisgIH0KKworLyogZ2VuZXJhdGluZyByYW5kb20gYXJjcyAqLworCisKK2ZvciAoIGsgPSAxOyBrIDw9IG0gLSBtYzsgayArKyApCisgIHsKKyAgICBpID0gMSArIG5yYW5kICggbiApOworCisgICAgZG8KKyAgICBqID0gMSArIG5yYW5kICggbiApOworICAgIHdoaWxlICggaiA9PSBpICk7CisKKyAgICBpZiAoIGkgPiBqICkKKyAgICAgIHsgaTAgPSBpOyBpID0gajsgaiA9IGkwOyB9CisKKyAgICBkaWogPSBqIC0gaTsKKyAgICBsID0gbG0gKyBucmFuZCAoIGxsICk7CisgICAgaWYgKCBsbl9mICkgbCArPSAobG9uZykgKCBkaWogKiBsbiApOworICAgIGlmICggbHNfZiApIGwgKz0gKGxvbmcpICggZGlqICogKCBkaWogKiBscyApICk7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tI2kgLXBuI2YgLXBzI2YgLXBhcCNpIC1wYWMjZlxuXAorICAgICAgICAgICAgICAgICAgICAgIC1jbCNpIC1jaCNpXG5cCisgICAgICAgICAgICAgICAgICAgICAgLXMgIC1zbCNpIC1zbSNpXG5cCisgICAgICAgICAgICAgICAgICAgIF1cblwKKyAgICVzIC1oaCBmaWxlX25hbWVcblwKK1xuXAorICAgICAgICAgICAgICAgICAgICAgICAgI2kgLSBpbnRlZ2VyIG51bWJlciAgICNmIC0gcmVhbCBudW1iZXJcblwKK1xuXAorICAgICAgQXJjIGxlbmd0aCBwYXJhbWV0ZXJzOlxuXAorLWxsI2kgIC0gI2kgaXMgdGhlIHVwcGVyIGJvdW5kIG9uIGFyYyBsZW5ndGhzICAgICAgICAgIChkZWZhdWx0IDEwMDAwKVxuXAorLWxtI2kgIC0gI2kgaXMgdGhlIGxvd2VyIGJvdW5kIG9uIGFyYyBsZW5ndGhzICAgICAgICAgIChkZWZhdWx0IDApXG5cCistbG4jZiAgLSBtdWx0aXBsaXkgbChpLCBqKSBieSAjZiAqIHxpLWp8ICAgICAgICAgICAgICAgKGRlZmF1bHQgMClcblwKKy1scyNmICAtIG11bHRpcGxpeSBsKGksIGopIGJ5ICNmICogfGktanxeMiAgICAgICAgICAgICAoZGVmYXVsdCAwKVxuXAorXG5cCisgICAgICBQb3RlbnRpYWwgcGFyYW1ldGVyczpcblwKKy1wICAgICAtIGdlbmVyYXRlIHBvdGVudGlhbHMgXG5cCistcGwjaSAgLSAjaSBpcyB0aGUgdXBwZXIgYm91bmQgb24gcG90ZW50aWFscyAgICAgICAgICAgKGRlZmF1bHQgbGwpXG5cCistcG0jaSAgLSAjaSBpcyB0aGUgbG93ZXIgYm91bmQgb24gcG90ZW50aWFscyAgICAgICAgICAgKGRlZmF1bHQgbG0pXG5cCistcG4jZiAgLSBtdWx0aXBseSBwKGkpIGJ5ICNmICogaSAgICAgICAgICAgICAgICAgICAgICAgKGRlZmF1bHQgMClcblwKKy1wcyNmICA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AgICAgICBkbCwgZHgsIHhuLCB5biwgY291bnQsCisgICAgICAgKm1lc3M7CisKK2RvdWJsZSBuOworbG9uZyAgIG4wLAorICAgICAgIHNvdXJjZSwKKyAgICAgICBpLAorICAgICAgIGkwLAorICAgICAgIGosCisgICAgICAgZGlqOworCitkb3VibGUgbTsKK2xvbmcgICBtMCwKKyAgICAgICBtYywKKyAgICAgICBrOworCitsb25nICAgKnAsCisgICAgICAgcF90LAorICAgICAgIGwsCisgICAgICAgbHg7CisKK2xvbmcgICBzZWVkLAorICAgICAgIHNlZWQxLAorICAgICAgIHNlZWQyOworCitpbnQgICAgZXh0PTA7CisKKy8qIGluaXRpYWxpemVkIGJ5IGRlZmF1bHQgdmFsdWVzICovCisKKy8qIHZhcmlhYmxlcyBmb3IgZ2VuZXJhdGluZyBvbmUgbGF5ZXIgKi8KKworLyogdmFyaWFibGVzIGZvciBnZW5lcmF0aW5nIHNwYW5uaW5nIGdyYXBoICovCitpbnQgICAgY19mID0gMCwgY3dfZiA9IDAsIGNtX2YgPSAwLCBjbF9mID0gMDsKKworaW50ICAgIGN3ID0gRE9VQkxFX0NZQ0xFOyAgLyogdHlwZSBvZiBzcGFubmluZyBncmFwaCAqLworbG9uZyAgIGNtID0gMCwgICAgICAgICAgICAgLyogbG93ZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisgICAgICAgY2wgPSAxMDA7ICAgICAgICAgICAvKiB1cHBlciBib3VuZCBvZiB0aGUgaW50ZXJ2YWwgKi8KKworLyogdmFyaWFibGVzIGZvciBnZW5lcmF0aW5nIGFkZGl0aW9uYWwgYXJjcyAqLworaW50ICAgIGFfZiA9IDAsIGF4X2YgPSAwLCBhbV9mID0gMCwgYWxfZiA9IDA7CisKK2xvbmcgICBheCA9IDAsICAgICAgICAgICAgIC8qIG51bWJlciBvZiBhZGRpdGlvbmFsIGFyY3MgKi8KKyAgICAgICBhbSA9IDAsICAgICAgICAgICAgIC8qIGxvd2VyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworICAgICAgIGFsID0gMTAwOyAgICAgICAgICAgLyogdXBwZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisKKy8qIHZhcmlhYmxlcyBmb3IgaW50ZXItbGF5ZXIgYXJjcyAqLworaW50ICAgIGlfZiA9IDAsIGlwX2YgPSAwLCBpeF9mID0gMCwgaWhfZiA9IDAsCisgICAgICAgaW1fZiA9IDAsIGlsX2YgPSAwLCBpbl9mID0gMCwgaXNfZiA9IDA7CisKK2ludCAgICBpcCA9IE5POyAgICAgICAvKiB0byBtZXNzIG9yIG5vdCB0byBtZXNzICovCitsb25nICAgaXggPSAxLCAgICAgICAgLyogbnVtYmVyIG9mIGludGVybGF5ZXJlZCBhcmNzIGluIGEgTk9ERSAqLworICAgICAgIGloID0gMSwgICAgICAgIC8qIHN0ZXAgYmV0d2VlbiB0d28gbGF5ZXJlcyAqLworICAgICAgIGlsID0gMTAwMDAsICAgIC8qIHVwcGVyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworICAgICAgIGltID0gMTAwMDsgICAgIC8qIGxvd2VyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworZG91YmxlIGluID0gMSwgICAgICAgIC8qIGwgKj0gIGluICogfHgxLXgyfCAqLworICAgICAgIGlzID0gMDsgICAgICAgIC8qIGwgKj0gIGlzICogfHgxLXgyfF4yICovCisKKy8qIHZhcmlhYmxlcyBmb3IgYXJ0aWZpY2FsIHNvdXJjZSAqLworaW50ICAgIHNfZiA9IDAsIHNsX2YgPSAwLCBzbV9mID0gMDsKK2xvbmcgICBzbCAgID0gVkVSWV9GQVIsIC8qIHVwcGVyIGJvdW5kIG9mIGFydGlmaWNhbCBhcmMgKi8KKyAgICAgICBzbSwgICAgICAgICAgICAgIC8qIGxvd2VyIGJvdW5kIG9mIGFydGlmaWNhbCBhcmMgKi8KKyAgICAgICBzOworCisvKiB2YXJpYWJsZXMgZm9yIHBvdGVudGlhbHMgKi8KK2ludCAgICBwX2Y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ybWF0LlxuXAorXG5cCisgICAlcyAgWCBZIHNlZWQgWyAtY2wjaSAtY20jaSAtY3tjfGR8cH1cblwKKyAgICAgICAgICAgICAgICAgICAgICAtYXgjaSAtYWwjaSAtYW0jaVxuXAorICAgICAgICAgICAgICAgICAgICAgIC1pcCAgIC1pbCNpIC1pbSNpIC1pbiNpIC1pcyNpIC1peCNpIC1paCNpXG5cCisgICAgICAgICAgICAgICAgICAgICAgLXAgICAgLXBsI2kgLXBtI2kgLXBuI2YgLXBzI2ZcblwKKyAgICAgICAgICAgICAgICAgICAgICAtcyAgICAtc2wjaSAtc20jaVxuXAorICAgICAgICAgICAgICAgICAgICBdXG5cCisgICAlcyAtaGggZmlsZV9uYW1lXG5cCitcblwKKyAgICAgICAgICAgICAgICAgICAgICAgICNpIC0gaW50ZWdlciBudW1iZXIgICAjZiAtIHJlYWwgbnVtYmVyXG5cCitcblwKKyAgICAgIFBhcmFtZXRlcnMgb2YgY29ubmVjdGluZyBhcmNzIHdpdGhpbiBvbmUgbGF5ZXI6XG5cCistY2wjaSAtICNpIGlzIHRoZSB1cHBlciBib3VuZCBvbiBhcmMgbGVuZ3RocyAgICAgICAgICAoZGVmYXVsdCAxMDApXG5cCistY20jaSAtICNpIGlzIHRoZSBsb3dlciBib3VuZCBvbiBhcmMgbGVuZ3RocyAgICAgICAgICAoZGVmYXVsdCAwKVxuXAorLWMjdCAgLSAjdCBpcyB0aGUgdHlwZSBvZiBjb25uZWN0aW5nIGdyYXBoOiB7IGMgfCBkIHwgcCB9XG5cCisgICAgICAgICAgIGMgLSBjeWNsZSwgZCAtIGRvdWJsZSBjeWNsZSwgcCAtIHBhdGggICAgICAoZGVmYXVsdCBkKVxuXAorXG5cCisgICAgICBQYXJhbWV0ZXJzIG9mIGFkZGl0aW9uYWwgYXJjcyB3aXRoaW4gb25lIGxheWVyOlxuXAorLWF4I2kgLSAjaSBpcyB0aGUgbnVtYmVyIG9mIGFkZGl0aW9uYWwgYXJjcyAgICAgICAgICA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CisKKworLyogcGFyc2luZyAgcGFyYW1ldGVycyAqLworLyogY2hlY2tzIHRoZSB2YWxpZGl0eSBvZiBpbmNvbWluZyBwYXJhbWV0ZXJzICovCitpbnQKK3NwZ3JpZF9jaGVja19wYXJhbXMgKCBzdHJ1Y3QgdnR5ICp2dHksIGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKy8qIGluaXRpYWxpemVkIGJ5IGRlZmF1bHQgdmFsdWVzICovCisgIGV4dD0wOworCisvKiB2YXJpYWJsZXMgZm9yIGdlbmVyYXRpbmcgb25lIGxheWVyICovCisKKy8qIHZhcmlhYmxlcyBmb3IgZ2VuZXJhdGluZyBzcGFubmluZyBncmFwaCAqLworICBjX2YgPSAwOworICBjd19mID0gMDsKKyAgY21fZiA9IDA7CisgIGNsX2YgPSAwOworCisgIGN3ID0gUEFUSDsgIC8qIHR5cGUgb2Ygc3Bhbm5pbmcgZ3JhcGggKi8KKyAgY20gPSAwOyAgICAgICAgICAgICAvKiBsb3dlciBib3VuZCBvZiB0aGUgaW50ZXJ2YWwgKi8KKyAgY2wgPSA2MzsgICAgICAgICAgIC8qIHVwcGVyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworCisvKiB2YXJpYWJsZXMgZm9yIGdlbmVyYXRpbmcgYWRkaXRpb25hbCBhcmNzICovCisgIGFfZiA9IDA7CisgIGF4X2YgPSAwOworICBhbV9mID0gMDsKKyAgYWxfZiA9IDA7CisKKyAgYXggPSAwOyAgICAgICAgICAgICAvKiBudW1iZXIgb2YgYWRkaXRpb25hbCBhcmNzICovCisgIGFtID0gMDsgICAgICAgICAgICAgLyogbG93ZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisgIGFsID0gNjM7ICAgICAgICAgICAvKiB1cHBlciBib3VuZCBvZiB0aGUgaW50ZXJ2YWwgKi8KKworLyogdmFyaWFibGVzIGZvciBpbnRlci1sYXllciBhcmNzICovCisgIGlfZiA9IDA7CisgIGlwX2YgPSAwOworICBpeF9mID0gMDsKKyAgaWhfZiA9IDA7CisgIGltX2YgPSAwOworICBpbF9mID0gMDsKKyAgaW5fZiA9IDA7CisgIGlzX2YgPSAwOworCisgIGlwID0gTk87ICAgICAgIC8qIHRvIG1lc3Mgb3Igbm90IHRvIG1lc3MgKi8KKyAgaXggPSAxOyAgICAgICAgLyogbnVtYmVyIG9mIGludGVybGF5ZXJlZCBhcmNzIGluIGEgTk9ERSAqLworICBpaCA9IDE7ICAgICAgICAvKiBzdGVwIGJldHdlZW4gdHdvIGxheWVyZXMgKi8KKyAgaWwgPSA2MzsgLy93YXMgMTAwMDA7ICAgIC8qIHVwcGVyIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworICBpbSA9IDA7ICAvL3dhcyAxMDAwOyAgICAgLyogbG93ZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisgIGluID0gMTsgICAgICAgIC8qIGwgKj0gIGluICogfHgxLXgyfCAqLworICBpcyA9IDA7ICAgICAgICAvKiBsICo9ICBpcyAqIHx4MS14MnxeMiAqLworCisvKiB2YXJpYWJsZXMgZm9yIGFydGlmaWNhbCBzb3VyY2UgKi8KKyAgc19mID0gMDsKKyAgc2xfZiA9IDA7CisgIHNtX2YgPSAwOworICBzbCAgID0gVkVSWV9GQVI7IC8qIHVwcGVyIGJvdW5kIG9mIGFydGlmaWNhbCBhcmMgKi8KKworLyogdmFyaWFibGVzIGZvciBwb3RlbnRpYWxzICovCisgIHBfZiA9IDA7CisgIHBsX2YgPSAwOworICBwbV9mID0gMDsKKyAgcG5fZiA9IDA7CisgIHBzX2YgPSAwOworCisgIHBuID0gMDsgICAgICAgIC8qIHAgKz0gIGxuICogKHgrMSkgKi8KKyAgcHMgPSAwOyAgICAgICAgLyogcCArPSAgbHMgKiAoeCsxKV4yICovCisKKworICBpZiAoIGFyZ2MgPCAxICkgeworICAgIHVzYWdlICh2dHkpOworICAgIHJldHVybiAxOworICB9CisKKyAgbnAgPSAwOworCisgIHN0cmNweSAoIGFyZ3MsIGF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HsKKyAgICAgICAgICBjYXNlICdsJzogLyogdXBwZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisgICAgICAgICAgICBjbF9mID0gMTsKKyAgICAgICAgICAgIGNsICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdtJzogLyogbG93ZXIgYm91bmQgKi8KKyAgICAgICAgICAgIGNtX2YgPSAxOworICAgICAgICAgICAgY20gID0gKGxvbmcgKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ2MnOiAvKiB0eXBlIC0gY3ljbGUgKi8KKyAgICAgICAgICAgIGN3X2YgPSAxOworICAgICAgICAgICAgY3cgICA9IENZQ0xFOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAnZCc6IC8qIHR5cGUgLSBkb3VibGUgY3ljbGUgKi8KKyAgICAgICAgICAgIGN3X2YgPSAxOworICAgICAgICAgICAgY3cgICA9IERPVUJMRV9DWUNMRTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ3AnOiAvKiB0eXBlIC0gcGF0aCAqLworICAgICAgICAgICAgY3dfZiA9IDE7CisgICAgICAgICAgICBjdyAgID0gUEFUSDsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgZGVmYXVsdDogIC8qIHVua25vd24gc3dpdGNoICB2YWx1ZSAqLworICAgICAgICAgICAgdXNhZ2UgKHZ0eSk7CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlICdhJyA6IC8qIGFkZGl0aW9uYWwgYXJjcyBpbiBvbmUgbGF5ZXIgKi8KKyAgICAgICAgIGFfZiA9IDE7CisgICAgICAgIHN3aXRjaCAoIGFyZ3NbMl0gKQorICAgICAgICAgIHsKKyAgICAgICAgICBjYXNlICdsJzogLyogdXBwZXIgYm91bmQgb2YgdGhlIGludGVydmFsICovCisgICAgICAgICAgICBhbF9mID0gMTsKKyAgICAgICAgICAgIGFsICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdtJzogLyogbG93ZXIgYm91bmQgKi8KKyAgICAgICAgICAgIGFtX2YgPSAxOworICAgICAgICAgICAgYW0gID0gKGxvbmcgKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ3gnOiAvKiBudW1iZXIgb2YgYWRkaXRpb25hbCBhcmNzICovCisgICAgICAgICAgICBheF9mID0gMTsKKyAgICAgICAgICAgIGF4ICAgPSAobG9uZyApIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgaWYgKCBheCA8IDAgKQorICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHVzYWdlICh2dHkpOworICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICBkZWZhdWx0OiAgLyogdW5rbm93biBzd2l0Y2ggIHZhbHVlICovCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVzYWdlICh2dHkpOworICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisKKyAgICAgIGNhc2UgJ2knIDogLyogaW50ZXJsYXllcmVkIGFyY3MgKi8KKyAgICAgICAgaV9mID0gMTsKKworICAgICAgICBzd2l0Y2ggKCBhcmdzWzJdICkKKyAgICAgICAgICB7CisgICAgICAgICAgY2FzZSAnbCc6IC8qIHVwcGVyIGJvdW5kICovCisgICAgICAgICAgICBpbF9mID0gMTsKKyAgICAgICAgICAgIGlsICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdtJzogLyogbG93ZXIgYm91bmQgKi8KKyAgICAgICAgICAgIGltX2YgPSAxOworICAgICAgICAgICAgaW0gID0gKGxvbmcgKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ24nOiAvKiBhZGRpdGlvbmFsIGxlbmd0aDogbCAqPSBpbip8aTEtaTJ8ICovCisgICAgICAgICAgICBpbl9mID0gMTsKKyAgICAgICAgICAgIGluICA9IGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAncyc6IC8qIGFkZGl0aW9uYWwgbGVuZ3RoOiBsICo9IGlzKnxpMS1pMnxeMiAqLworICAgICAgICAgICAgaXNfZiA9IDE7CisgICAgICAgICAgICBpcyAgPSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ3AnOiAvKiBtZXNzIGludGVybGF5ZXJlZCBhcmNzICovCisgICAgICAgICAgICBpcF9mID0gMTsKKyAgICAgICAgICAgIGlwID0gWUVTOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAneCc6IC8qIG51bWJlciBvZiBpbnRlcmxheWVyZWQgYXJjcyAqLworICAgICAgICAgICAgaXhfZiA9IDE7CisgICAgICAgICAgICBpeCAgPSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGlmICggaXggPCAxICkgeworICAgICAgICAgICAgICB1c2FnZSAodnR5KTsKKyAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdoJzogLyogc3RlcCBiZXR3ZWVuIHR3byBsYXllcmVzICovCisgICAgICAgICAgICBpaF9mID0gMTsKKyAgICAgICAgICAgIGloICA9IGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgaWYgKCBpaCA8IDEgKSB7CisgICAgICAgICAgICAgICB1c2FnZSAodnR5KTsKKyAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGRlZmF1bHQ6ICAvKiB1bmtub3duIHN3aXRjaCAgdmFsdWUgKi8KKyAgICAgICAgICAgIHVzYWdlICh2dHkpOworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgfQorICAgICAgICBicmVhazsKKworICAgICAgY2FzZSAncycgOiAvKiBhZGRpdGlvbmFsIHNvdXJjZSAqLworICAgICAgICBzX2YgPSAxOworICAgICAgICBpZiAoIHN0cmxlbiAoIGFyZ3MgKSA+IDIgKQorICAgICAgICB7CisgICAgICAgIHN3aXRjaCAoIGFyZ3NbMl0gKQorICAgICAgICAgIHsKKyAgICAgICAgICBjYXNlICdsJzogLyogdXBwZXIgYm91bmQgb2YgYXJ0LiBhcmMgKi8KKyAgICAgICAgICAgIHNsX2YgPSAxOworICAgICAgICAgICAgc2wgID0gIChsb25nKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ20nOiAvKiBsb3dlciBib3VuZCBvZiBhcnQuIGFyYyAqLworICAgICAgICAgICAgc21fZiA9IDE7CisgICAgICAgICAgICBzbSAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgZGVmYXVsdDogIC8qIHVua25vd24gc3dpdGNoICB2YWx1ZSAqLworICAgICAgICAgICAgdXNhZ2UgKHZ0eSk7CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlICdwJyA6IC8qIHBvdGVudGlhbHMgKi8KKyAgICAgICAgcF9mID0gMTsKKyAgICAgICAgaWYgKCBzdHJsZW4gKCBhcmdzICkgPiAyICkKKyAgICAgICAgeworICAgICAgICBzd2l0Y2ggKCBhcmdzWzJdICkKKyAgICAgICAgICB7CisgICAgICAgICAgY2FzZSAnbCc6IC8qIHVwcGVyIGJvdW5kICovCisgICAgICAgICAgICBwbF9mID0gMTsKKyAgICAgICAgICAgIHBsICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdtJzogLyogbG93ZXIgYm91bmQgKi8KKyAgICAgICAgICAgIHBtX2YgPSAxOworICAgICAgICAgICAgcG0gID0gKGxvbmcgKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ24nOiAvKiBhZGRpdGlvbmFsOiBwICo9IHBuKih4KzEpICovCisgICAgICAgICAgICBwbl9mID0gMTsKKyAgICAgICAgICAgIHBuICA9IGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAncyc6IC8qIGFkZGl0aW9uYWw6IHAgPSBwcyogKHgrMSleMiAqLworICAgICAgICAgICAgcHNfZiA9IDE7CisgICAgICAgICAgICBwcyAgPSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGRlZmF1bHQ6ICAvKiB1bmtub3duIHN3aXRjaCAgdmFsdWUgKi8KKyAgICAgICAgICAgIHVzYWdlICh2dHkpOworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGJyZWFrOworCisgICAgICBkZWZhdWx0OiAvKiB1bmtub3VuIGNhc2UgKi8KKyAgICAgICAgdXNhZ2UgKHZ0eSk7CisgICAgICAgIHJldHVybiAxOworICAgICAgfQorICB9CisKKworICByZXR1cm4gMDsKK30KKworCisvKiBnZW5lcmF0b3Igb2YgbGF5ZXJlZCBuZXR3b3JrcyBmb3IgdGhlIHNob3J0ZXN0IHBhdGhzIHByb2JsZW07CisgICBleHRlbmRlZCBESU1BQ1MgZm9ybWF0IGZvciBvdXRwdXQgKi8KK2ludAorZ2VuX3NwZ3JpZF90b3BvbG9neSAoc3RydWN0IHZ0eSAqdnR5LCBzdHJ1Y3QgbGlzdCAqdG9wb2xvZ3kpCit7CisgIC8qIC0tLS0tIGFqdXN0aW5nIHBhcmFtZXRlcnMgLS0tLS0gKi8KKworICAvKiBzcGFubmluZyAqLworICBpZiAoIGNsIDwgY20gKSB7IGx4ID0gY2w7IGNsID0gY207IGNtID0gbHg7IH0KKworICAvKiBhZGRpdGlvbmFsIGFyY3MgKi8KKyAgaWYgKCBhbCA8IGFtICkgeyBseCA9IGFsOyBhbCA9IGFtOyBhbSA9IGx4OyB9CisKKyAgLyogaW50ZXJsYXllcmVkIGFyY3MgKi8KKyAgaWYgKCBpbCA8IGltICkgeyBseCA9IGlsOyBpbCA9IGltOyBpbSA9IGx4OyB9CisKKyAgLyogcG90ZW50aWFsIHBhcmFtZXRlcnMgKi8KKyAgaWYgKCBwX2YgKQorICAgIHsKKyAgICAgaWYgKCAhIHBsX2YgKSBwbCA9IGlsOworICAgICBpZiAoICEgcG1fZiApIHBtID0gaW07CisgICAgIGlmICggcGwgPCBwbSApIHsgbHggPSBwbDsgcGwgPSBwbTsgcG0gPSBseDsgfQorICAgIH0KKworICAvKiBudW1iZXIgb2Ygbm9kZXMgYW5kIGFyY3MgKi8KKworICBuID0gKGRvdWJsZSlYICooZG91YmxlKVkgKyAxOworCisgIG0gID0gKGRvdWJsZSlZOyAvKiBhcmNzIGZyb20gc291cmNlICovCisKKyAgc3dpdGNoICggY3cgKQorICB7CisgICBjYXNlIFBBVEg6CisgICAgbWMgPSAoZG91YmxlKVkgLSAxOworICAgIGJyZWFrOworICAgY2FzZSBDWUNMRToKKyAgICBtYyA9IChkb3VibGUpWTsKKyAgICBicmVhazsKKyAgIGNhc2UgRE9VQkxFX0NZQ0xFOgorICAgIG1jID0gMiooZG91YmxlKVk7CisgIH0KKworICBtICs9IChkb3VibGUpWCAqIChkb3VibGUpbWM7ICAvKiBzcGFubmluZyBhcmNzICovCisgIG0gKz0gKGRvdWJsZSlYICogKGRvdWJsZSlheDsgIC8qIGFkZGl0aW9uYWwgYXJjcyAqLworCisgIC8qIGludGVybGF5ZXJlZCBhcmNzICovCisgIGZvciAoIHggPSAwOyB4IDwgWDsgeCArKyApCisgIHsKKyAgICBkbCA9ICggKCBYIC0geCAtIDEgKSArICggaWggLSAxICkgKSAvIGloOworICAgIGlmICggZGwgPiBpeCApIGRsID0gaXg7CisgICAgbSArPSAoZG91YmxlKVkgKiAoZG91YmxlKWRsOworICB9CisKKyAgIC8qIGFydGlmaWNhbCBzb3VyY2UgcGFyYW1ldGVycyAqLworICBpZiAoIHNfZiApIHsKKyAgICBtICs9IG47IG4gKysgOworICAgIGlmICggISBzbV9mICkgc20gPSBzbDsKKyAgICBpZiAoIHNsIDwgc20gKSB7IGx4ID0gc2w7IHNsID0gc207IHNtID0gbHg7IH0KKyAgfQorCisgIGlmICggbiA+PSAoZG91YmxlKU1BWExPTkcgfHwgbSA+PSAoZG91YmxlKU1BWExPTkcgKQorICB7CisgICAgemxvZ19lcnIgKCJUb28gbGFyZ2UgcHJvYmxlbS4gSXQgY2FuJ3QgYmUgZ2VuZXJhdGVkXG4iKTsKKyAgICBleGl0ICg0KTsKKyAgfQorICAgZWxzZQorICB7CisgICAgbjAgPSAobG9uZyluOyBtMCA9IChsb25nKW07CisgIH0KKworICBpZiAoIGlwX2YgKQorICAgICBtZXNzID0gKGxvbmcqKSBjYWxsb2MgKCBZLCBzaXplb2YgKCBsb25nICkgKTsKKworICAvKiBwcmludGluZyB0aXRsZSAqLworICB6bG9nX2luZm8gKCJHZW5lcmF0aW5nIHRvcG9sb2d5IGZvciBJU0lTIik7CisKKyAgc291cmNlID0gKCBzX2YgKSA/IG4wLTEgOiBuMDsKKworICBpZiAoIHBfZiApIC8qIGdlbmVyYXRpbmcgcG90ZW50aWFscyAqLyB7CisgICAgcCA9IChsb25nKikgY2FsbG9jICggbjArMSwgc2l6ZW9mIChsb25nKSApOworICAgIHNlZWQxID0gMipzZWVkICsgMTsKKyAgICBpbml0X3JhbmQgKCBzZWVkMSk7CisgICAgcGwgPSBwbCAtIHBtICsgMTsKKworICAgIGZvciAoIHggPSAwOyB4IDwgWDsgeCArKyApCisgICAgICBmb3IgKCB5ID0gMDsgeSA8IFk7IHkgKysgKSB7CisgICAgICAgIHBfdCA9IHBtICsgbnJhbmQgKCBwbCApOworICAgICAgICBpZiAoIHBuX2YgKSBwX3QgKj0gKGxvbmcpICggKDEgKyB4KSAqIHBuICk7CisgICAgICAgIGlmICggcHNfZiApIHBfdCAqPSAobG9uZykgKCAoMSArIHgpICogKCAoMSArIHgpICogcHMgKSk7CisKKyAgICAgICAgcFsgTk9ERSAoIHgsIHkgKSBdID0gcF90OworICAgICAgfQorICAgICAgcFtuMF0gPSAwOworICAgICAgaWYgKCBzX2YgKSBwW24wLTFdID0gMDsKKyAgICB9CisKKyAgaWYgKCBzX2YgKSAvKiBhZGRpdGlvbmFsIGFyY3MgZnJvbSBhcnRpZmljYWwgc291cmNlICovCisgICAgeworICAgICAgc2VlZDIgPSAzKnNlZWQgKyAxOworICAgICAgaW5pdF9yYW5kICggc2VlZDIgKTsKKyAgICAgIHNsID0gc2wgLSBzbSArIDE7CisKKyAgICAgIGZvciAoIHggPSBYIC0gMTsgeCA+PSAwOyB4IC0tICkKKyAgICAgICAgZm9yICggeSA9IFkgLSAxOyB5ID49IDA7IHkgLS0gKQorICAgICAgICB7CisgICAgICAgICAgaSA9IE5PREUgKCB4LCB5ICk7CisgICAgICAgICAgcyA9IHNtICsgbnJhbmQgKCBzbCApOworICAgICAgICAgIHByaW50X2FyYyAodnR5LCB0b3BvbG9neSwgIG4wLCBpLCBzICk7CisgICAgICAgIH0KKworICAgICAgcHJpbnRfYXJjICh2dHksIHRvcG9sb2d5LCAgbjAsIG4wLTEsIDAgKTsKKyAgICB9CisKKworICAvKiAtLS0tLSBnZW5lcmF0aW5nIGFyY3Mgd2l0aGluIGxheWVycyAtLS0tLSAqLworCisgIGluaXRfcmFuZCAoIHNlZWQgKTsKKyAgY2wgPSBjbCAtIGNtICsgMTsKKyAgYWwgPSBhbCAtIGFtICsgMTsKKworICBmb3IgKCB4ID0gMDsgeCA8IFg7IHggKysgKQorICAgeworICAvKiBnZW5lcmF0aW5nIGFyY3Mgd2l0aGluIG9uZSBsYXllciAqLworICAgIGZvciAoIHkgPSAwOyB5IDwgWS0xOyB5ICsrICkKKyAgICB7CisgICAgICAgLyogZ2VuZXJhdGluZyBzcGFubmluZyBncmFwaCAqLworICAgICAgIGkgPSBOT0RFICggeCwgeSApOworICAgICAgIGogPSBOT0RFICggeCwgeSsxICk7CisgICAgICAgbCA9IGNtICsgbnJhbmQgKCBjbCApOworICAgICAgIHByaW50X2FyYyAodnR5LCB0b3BvbG9neSwgIGksIGosIGwgKTsKKworICAgICAgIGlmICggY3cgPT0gRE9VQkxFX0NZQ0xFICkKKyAgICAgICAgIHsKKyAgICAgICAgICAgbCA9IGNtICsgbnJhbmQgKCBjbCApOworICAgICAgICAgICBwcmludF9hcmMgKHZ0eSwgdG9wb2xvZ3ksICBqLCBpLCBsICk7CisgICAgICAgICB9CisgICAgIH0KKworICAgIGlmICggY3cgPD0gQ1lDTEUgKQorICAgICAgeworICAgICAgICBpID0gTk9ERSAoIHgsIFktMSApOworICAgICAgICBqID0gTk9ERSAoIHgsIDAgKTsKKyAgICAgICAgbCA9IGNtICsgbnJhbmQgKCBjbCApOworICAgICAgICBwcmludF9hcmMgKHZ0eSwgdG9wb2xvZ3ksICBpLCBqLCBsICk7CisKKyAgICAgICAgaWYgKCBjdyA9PSBET1VCTEVfQ1lDTEUgKQorICAgICAgICAgIHsKKyAgCSAgbCA9IGNtICsgbnJhbmQgKCBjbCApOworICAgICAgICAgICAgcHJpbnRfYXJjICh2dHksIHRvcG9sb2d5LCAgaiwgaSwgbCApOworICAgICAgICAgIH0KKyAgICAgICB9CisKKyAgLyogZ2VuZXJhdGluZyBhZGRpdGlvbmFsIGFyY3MgKi8KKworICAgIGZvciAoIGsgPSBheDsgayA+IDA7IGsgLS0gKQorICAgICAgIHsKKyAgICAgICAgIHkxID0gbnJhbmQgKCBZICk7CisgICAgICAgICBkbworICAgICAgICAgICAgeTIgPSBucmFuZCAoIFkgKTsKKyAgICAgICAgIHdoaWxlICggeTIgPT0geTEgKTsKKyAgICAgICAgIGkgID0gTk9ERSAoIHgsIHkxICk7CisgICAgICAgICBqICA9IE5PREUgKCB4LCB5MiApOworICAgICAgICAgbCA9IGFtICsgbnJhbmQgKCBhbCApOworICAgICAgICAgcHJpbnRfYXJjICh2dHksIHRvcG9sb2d5LCAgaSwgaiwgbCApOworICAgICAgIH0KKyAgIH0KKworICAvKiAtLS0tLSBnZW5lcmF0aW5nIGludGVybGF5ZXJlZCBhcmNzIC0tLS0tLSAqLworCisgIGlsID0gaWwgLSBpbSArIDE7CisKKyAgLyogYXJjcyBmcm9tIHRoZSBzb3VyY2UgKi8KKworICAgIGZvciAoIHkgPSAwOyB5IDwgWTsgeSArKyApCisgICAgICB7CisgICAgICAgIGwgPSBpbSArIG5yYW5kICggaWwgKTsKKyAgICAgICAgaSA9IE5PREUgKCAwLCB5ICk7CisgICAgICAgIHByaW50X2FyYyAodnR5LCB0b3BvbG9neSwgIHNvdXJjZSwgaSwgbCApOworICAgICAgfQorCisgIGZvciAoIHggPSAwOyB4IDwgWC0xOyB4ICsrICkKKyAgIHsKKyAgLyogZ2VuZXJhdGluZyBhcmNzIGZyb20gb25lIGxheWVyICovCisgICAgIGZvciAoIGNvdW50ID0gMCwgeG4gPSB4ICsgMTsKKyAgICAgICAgICAgY291bnQgPCBpeCAmJiB4biA8IFg7CisgICAgICAgICAgIGNvdW50ICsrLCB4biArPSBpaCApCisgICAgICB7CisgICAgICAgIGlmICggaXBfZiApCisgICAgICAgIGZvciAoIHkgPSAwOyB5IDwgWTsgeSArKyApCisgIAltZXNzW3ldID0geTsKKworICAgICAgICBmb3IgKCB5ID0gMDsgeSA8IFk7IHkgKysgKQorICAgICAgICAgeworICAgICAgICAgICAgaSA9IE5PREUgKCB4LCB5ICk7CisgIAkgIGR4ID0geG4gLSB4OworICAJICBpZiAoIGlwX2YgKQorICAJICAgIHsKKyAgCSAgICAgIHlwID0gbnJhbmQoWS15KTsKKyAgCSAgICAgIHluID0gbWVzc1sgeXAgXTsKKyAgICAgICAgICAgICAgICBtZXNzWyB5cCBdID0gbWVzc1sgWSAtIHkgLSAxIF07CisgIAkgICAgfQorICAJICBlbHNlCisgICAgICAgICAgICAgICB5biA9ICB5OworICAJICBqID0gTk9ERSAoIHhuLCB5biApOworICAJICBsID0gaW0gKyBucmFuZCAoIGlsICk7CisgIAkgIGlmICggaW4gIT0gMCApCisgICAgICAgICAgICAgIGwgKj0gKGxvbmcpICggaW4gKiBkeCApOworICAgICAgICAgICAgaWYgKCBpc19mICkKKyAgICAgICAgICAgICAgbCAqPSAobG9uZykgKCAoIGlzICogZHggKSAqIGR4ICk7CisgICAgICAgICAgICBwcmludF9hcmMgKHZ0eSwgdG9wb2xvZ3ksICBpLCBqLCBsICk7CisgIAl9CisgICAgICB9CisgICB9CisgIC8qIGFsbCBpcyBkb25lICovCisgIHJldHVybiBleHQ7CisKK3JldHVybiAwOworfQorCisKKwpkaWZmIC0tZ2l0IGEvaXNpc2QvdG9wb2xvZ3kvc3BncmlkLmggYi9pc2lzZC90b3BvbG9neS9zcGdyaWQuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mOTZjMDBmCi0tLSAvZGV2L251bGwKKysrIGIvaXNpc2QvdG9wb2xvZ3kvc3BncmlkLmgKQEAgLTAsMCArMSw0NSBAQAorLyoKKyAqIElTLUlTIFJvdXQoZSlpbmcgcHJvdG9jb2wgLSB0b3BvbG9neS9zcGdyaWQuaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJvdXRpbmVzIGZvciBtYW5pcHVsYXRpb24gb2YgU1N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ya3MgZm9yIHRoZSBzaG9ydGVzdCBwYXRocyBwcm9ibGVtOworICAgZXh0ZW5kZWQgRElNQUNTIGZvcm1hdCBmb3Igb3V0cHV0ICovCisKK21haW4gKCBhcmdjLCBhcmd2ICkKKworaW50IGFyZ2M7CitjaGFyKiBhcmd2W107CisKK3sKKworY2hhciAgIGFyZ3NbMzBdOworCitsb25nICAgbiwKKyAgICAgICBuMCwKKyAgICAgICBzb3VyY2UsCisgICAgICAgaSwKKyAgICAgICBpMCwKKyAgICAgICBqLAorICAgICAgIGRpajsKKworbG9uZyAgIG0sCisgICAgICAgbTAsCisgICAgICAgbWMsCisgICAgICAgazsKKworbG9uZyAgICpwLAorICAgICAgIHBfdCwKKyAgICAgICBsLAorICAgICAgIGx4OworCitsb25nICAgc2VlZCwKKyAgICAgICBzZWVkMSwKKyAgICAgICBzZWVkMjsKKworaW50ICAgIGV4dD0wOworCitGSUxFICAgKmZvdXQ7CisKKy8qIHZhcmlhYmxlcyBmb3IgbGVuZ3RocyBnZW5lcmF0aW5nICovCisvKiBpbml0aWFsaXplZCBieSBkZWZhdWx0IHZhbHVlcyAqLworaW50ICAgIGxfZiA9IDAsIGxsX2YgPSAwLCBsbV9mID0gMCwgbG5fZiA9IDAsIGxzX2YgPSAwOworbG9uZyAgIGxsID0gMTAwMDAsICAgIC8qIGxlbmd0aCBvZiB0aGUgaW50ZXJ2YWwgKi8KKyAgICAgICBsbSA9IDA7ICAgICAgICAvKiBtaW5pbWFsIGJvdW5kIG9mIHRoZSBpbnRlcnZhbCAqLworZG91YmxlIGxuID0gMCwgICAgICAgIC8qIGwgKz0gbG4gKiB8aS1qfCAqLyAKKyAgICAgICBscyA9IDA7ICAgICAgICAvKiBsICs9IGxzICogfGktanxeMiAqLworCisvKiB2YXJpYWJsZXMgZm9yIGNvbm5lY3RpbmcgY3ljbGUocykgKi8KK2ludCAgICBjX2YgPSAwLCBjbF9mID0gMCwgY2hfZiA9IDAsIGNfcmFuZG9tID0gMTsKK2xvbmcgICBjbCA9IDE7ICAgICAgICAvKiBsZW5ndGggb2YgY3ljbGUgYXJjICovCitsb25nICAgY2g7ICAgICAgICAgICAgLyogbnVtYmVyIG9mIGFyY3MgaW4gdGhlIGN5Y2xlIAorICAgICAgICAgICAgICAgICAgICAgICAgIG4gLSBieSBkZWZhdWx0ICovCisKKy8qIHZhcmlhYmxlcyBmb3IgYXJ0aWZpY2FsIHNvdXJjZSAqLworaW50ICAgIHNfZiA9IDAsIHNsX2YgPSAwLCBzbV9mID0gMDsKK2xvbmcgICBzbCAgID0gVkVSWV9GQVIsIC8qIHVwcGVyIGJvdW5kIG9mIGFydGlmaWNhbCBhcmMgKi8KKyAgICAgICBzbSwgICAgICAgICAgICAgIC8qIGxvd2VyIGJvdW5kIG9mIGFydGlmaWNhbCBhcmMgKi8KKyAgICAgICBzOyAgCisKKy8qIHZhcmlhYmxlcyBmb3IgcG90ZW50aWFscyAqLworaW50ICAgIHBfZiA9IDAsIHBsX2YgPSAwLCBwbV9mID0gMCwgcG5fZiA9IDAsIHBzX2YgPSAwLAorICAgICAgIHBhX2YgPSAwLCBwYXBfZiA9IDAsIHBhY19mID0gMDsKK2xvbmcgICBwbCwgICAgICAgICAgICAvKiBsZW5ndGggb2YgdGhlIGludGVydmFsICovCisgICAgICAgcG07ICAgICAgICAgICAgLyogbWluaW1hbCBib3VuZCBvZiB0aGUgaW50ZXJ2YWwgKi8KK2RvdWJsZSBwbiA9IDAsICAgICAgICAvKiBsICs9IGxuICogfGktanwgKi8gCisgICAgICAgcHMgPSAwLCAgICAgICAgLyogbCArPSBscyAqIHxpLWp8XjIgKi8KKyAgICAgICBwYXAgPSAwLCAgICAgICAvKiBwYXJ0IG9mIG5vZGVzIHdpdGggYWx0ZXJuYXRpdmUgZHVzdHJpYnV0aW9uICovCisgICAgICAgcGFjID0gLTE7ICAgICAgLyogbXVsdGlwbGllciBmb3IgYWx0ZXJuYXRpdmUgZGlzdHJpYnV0aW9uICovCisKK2ludCBucDsgICAgIC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OworCisgICAgc3dpdGNoICggYXJnc1sxXSApCisgICAgICB7CisKKyAgICAgIGNhc2UgJ2wnIDogLyogYW4gaW50ZXJ2YWwgZm9yIGFyYyBsZW5ndGggKi8KKwlsX2YgPSAxOworCXN3aXRjaCAoIGFyZ3NbMl0gKQorCSAgeyAKKwkgIGNhc2UgJ2wnOiAvKiBsZW5ndGggb2YgdGhlIGludGVydmFsICovCisJICAgIGxsX2YgPSAxOworCSAgICBsbCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ20nOiAvKiBtaW5pbWFsIGJvdW5kICovCisJICAgIGxtX2YgPSAxOworCSAgICBsbSAgPSAobG9uZyApIGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ24nOiAvKiBhZGRpdGlvbmFsIGxlbmd0aDogbCp8aS1qfCAqLworCSAgICBsbl9mID0gMTsKKwkgICAgbG4gID0gYXRvZiAoICZhcmdzWzNdICk7CisJICAgIGJyZWFrOworCSAgY2FzZSAncyc6IC8qIGFkZGl0aW9uYWwgbGVuZ3RoOiBsKnxpLWp8XjIgKi8KKwkgICAgbHNfZiA9IDE7CisJICAgIGxzICA9IGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGRlZmF1bHQ6ICAvKiB1bmtub3duIHN3aXRjaCAgdmFsdWUgKi8KKwkgICAgZ290byB1c2FnZTsKKwkgIH0KKwlicmVhazsKKworICAgICAgY2FzZSAnYycgOiAvKiBjb25uZWN0aW5nIGN5Y2xlKHMpICovCisgICAgICAgIGNfZiA9IDE7CisJc3dpdGNoICggYXJnc1syXSApCisJICB7IAorCSAgY2FzZSAnbCc6CisgICAgICAgICAgICBjX3JhbmRvbSA9IDA7CisJICAgIGNsX2YgPSAxOworCSAgICBjbCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgaWYgKCBjbCA8IDAgKSBnb3RvIHVzYWdlOworCSAgICBicmVhazsKKwkgIGNhc2UgJ2gnOgorCSAgICBjaF9mID0gMTsKKwkgICAgY2ggID0gIChsb25nKSBhdG9mICggJmFyZ3NbM10gKTsKKyAgICAgICAgICAgIGlmICggY2ggPCAyIHx8IGNoID4gbiApIGdvdG8gdXNhZ2U7CisJICAgIGJyZWFrOworCSAgZGVmYXVsdDogIC8qIHVua25vd24gc3dpdGNoICB2YWx1ZSAqLworCSAgICBnb3RvIHVzYWdlOworICAgICAgICAgIH0KKwlicmVhazsKKworICAgICAgY2FzZSAncycgOiAvKiBhZGRpdGlvbmFsIHNvdXJjZSAqLworICAgICAgICBzX2YgPSAxOworCWlmICggc3RybGVuICggYXJncyApID4gMiApCisJeyAgCisJc3dpdGNoICggYXJnc1syXSApCisJICB7IAorCSAgY2FzZSAnbCc6IC8qIHVwcGVyIGJvdW5kIG9mIGFydC4gYXJjICovCisJICAgIHNsX2YgPSAxOworCSAgICBzbCAgPSAgKGxvbmcpIGF0b2YgKCAmYXJnc1szXSApOworICAgICAgICAgICAgYnJlYWs7CisJICBjYXNlICdtJzogLyogbG93ZXIgYm91bmQgb2YgYXJ0LiBhcmMgKi8KKwkgICAgc21fZiA9IDE7CisJICAgIHNtICA9ICAobG9uZykgYXRvZiAoICZhcmdzWzNdICk7CisgICAgICAgICAgICBicmVhazsKKwkgIGRlZmF1bHQ6ICAvKiB1bmtub3duIHN3aXRjaCAgdmFsdWUgKi8KKwkgICAgZ290byB1c2FnZTsKKyAgICAgICAgICB9CisgICAgICAgICB9CisJYnJlYWs7CisKKyAgICAgIGNhc2UgJ3AnIDogLyogcG90ZW50aWFscyAqLworCXBfZiA9IDE7CisJaWYgKCBzdHJsZW4gKCBhcmdzICkgPiAyICkKKwl7ICAKKwlzd2l0Y2ggKCBhcmdzWzJdICkKKwkgIHsgCisJICBjYXNlICdsJzogLyogbGVuZ3RoIG9mIHRoZSBpbnRlcnZhbCAqLworCSAgICBwbF9mID0gMTsKKwkgICAgcGwgID0gIChsb25nKSBhdG9mICggJmFyZ3NbM10gKTsKKwkgICAgYnJlYWs7CisJICBjYXNlICdtJzogLyogbWluaW1hbCBib3VuZCAqLworCSAgICBwbV9mID0gMTsKKwkgICAgcG0gID0gKGxvbmcgKSBhdG9mICggJmFyZ3NbM10gKTsKKwkgICAgYnJlYWs7CisJICBjYXNlICduJzogLyogYWRkaXRpb25hbCBsZW5ndGg6IGwqfGktanwgKi8KKwkgICAgcG5fZiA9IDE7CisJICAgIHBuICA9IGF0b2YgKCAmYXJnc1szXSApOworCSAgICBicmVhazsKKwkgIGNhc2UgJ3MnOiAvKiBhZGRpdGlvbmFsIGxlbmd0aDogbCp8aS1qfF4yICovCisJICAgIHBzX2YgPSAxOworCSAgICBwcyAgPSBhdG9mICggJmFyZ3NbM10gKTsKKwkgICAgYnJlYWs7CisJICBjYXNlICdhJzogLyogYmlwb2xhciBkaXN0cmlidXRpb24gKi8KKwkgICAgcGFfZiA9IDE7CisJICAgIHN3aXRjaCAoIGFyZ3NbM10gKQorCSAgICAgIHsKKwkgICAgICBjYXNlICdwJzogLyogJSBvZiBhbHRlcm5hdGl2ZSBwb3RlbnRpYWxzICovCisgICAgICAgICAgICAgICAgcGFwX2YgPSAxOworICAgICAgICAgICAgICAgIHBhcCAgPSBhdG9mICggJmFyZ3NbNF0gKTsKKwkJaWYgKCBwYXAgPCAwICAgKSBwYXAgPSAwOworCQlpZiAoIHBhcCA+IDEwMCApIHBhcCA9IDEwMDsKKyAgICAgICAgICAgICAgICBwYXAgLz0gMTAwOworCQlicmVhazsKKwkgICAgICBjYXNlICdjJzogLyogbXVsdGlwbGllciAqLworCQlwYWNfZiA9IDE7CisJCXBhYyA9IGF0b2YgKCAmYXJnc1s0XSApOworCQlicmVhazsKKwkgICAgICBkZWZhdWx0OiAvKiB1bmtub3duIHN3aXRjaCB2YWx1ZSAqLworCQlnb3RvIHVzYWdlOworCSAgICAgIH0KKwkgICAgYnJlYWs7CisJICBkZWZhdWx0OiAgLyogdW5rbm93biBzd2l0Y2ggIHZhbHVlICovCisJICAgIGdvdG8gdXNhZ2U7CisJICB9CisgICAgICB9CisJYnJlYWs7CisKKyAgICAgIGRlZmF1bHQgIDogLyogdW5rbm91biBjYXNlICovCisJZ290byB1c2FnZTsKKyAgICAgIH0KKyAgfQorICAgCisKKy8qIC0tLS0tIGFqdXN0aW5nIHBhcmFtZXRlcnMgLS0tLS0gKi8KKworbjAgPSBuOyBtMCA9IG07CisKKy8qIGxlbmd0aCBwYXJhbWV0ZXJzICovCitpZiAoIGxsIDwgbG0gKSB7IGx4ID0gbGw7IGxsID0gbG07IGxtID0gbHg7IH0KKworLyogcG90ZW50aWFsIHBhcmFtZXRlcnMgKi8KK2lmICggcF9mICkKKyAgeworICAgaWYgKCAhIHBsX2YgKSBwbCA9IGxsOworICAgaWYgKCAhIHBtX2YgKSBwbSA9IGxtOworICAgaWYgKCBwbCA8IHBtICkgeyBseCA9IHBsOyBwbCA9IHBtOyBwbSA9IGx4OyB9CisgIH0KKworLyogcGF0aChzKSBwYXJhbWV0ZXJzICovCitpZiAoICEgY2hfZiApIGNoID0gbjsKKworbWMgPSBuICsgKG4tMikgLyAoY2gtMSk7CitpZiAoIG1jID4gbSApIAorICB7IGZwcmludGYgKCBzdGRlcnIsCisgICAgICAgICAgICAgICJFcnJvcjogbm90IGVub3VnaCBhcmNzIGZvciBnZW5lcmF0aW5nIGNvbm5lY3RpbmcgY3ljbGUocylcbiIgKTsKKyAgICBleGl0ICg0KTsKKyAgfQorCisgLyogYXJ0aWZpY2FsIHNvdXJjZSBwYXJhbWV0ZXJzICovCitpZiAoIHNfZiApICAgICAgICAgIAorICAgeyBtMCArPSBuOyBuMCArKyA7IAorICAgICBpZiAoICEgc21fZiApIHNtID0gc2w7CisgICAgIGlmICggc2wgPCBzbSApIHsgbHggPSBzbDsgc2wgPSBzbTsgc20gPSBseDsgfQorICAgfQorCisvKiBwcmludGluZyB0aXRsZSAqLworcHJpbnRmICgiYyByYW5kb20gbmV0d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IG1heDogJWxkIGsxOiAlLjJmIGsyOiAlLjJmXG4iLAorCSAgcG0sIHBsLCBwbiwgcHMgKTsKKyAgaWYgKCBwYV9mICkKKyAgcHJpbnRmICgiYyBwb3RlbnRpYWxzIC0+IHBhcnQgb2YgYWx0ZXJuYXRpdmUgZGlzdHJpYnV0aW9uOiAlLjJmIGs6ICUuMmZcbiIsCisgICAgICAgICAgcGFwLCBwYWMgKTsKKyAgfQorcHJpbnRmICgiY1xuIiApOworCisKK3ByaW50ZiAoInAgc3AgJThsZCAlOGxkXG5jXG4iLCBuMCwgbTAgKTsKKworc291cmNlID0gKCBzX2YgKSA/IG4wIDogMTsKK3ByaW50ZiAoIm4gJThsZFxuY1xuIiwgc291cmNlICk7CisKK2lmICggcF9mICkgLyogZ2VuZXJhdGluZyBwb3RlbnRpYWxzICovCisgIHsKKyAgICBwID0gKGxvbmcqKSBjYWxsb2MgKCBuKzIsIHNpemVvZiAobG9uZykgKTsKKyAgICBzZWVkMSA9IDIqc2VlZCArIDE7CisgICAgaW5pdF9yYW5kICggc2VlZDEpOworICAgIHBsID0gcGwgLSBwbSArIDE7CisKKyAgICBmb3IgKCBpID0gMDsgaSA8PSBuOyBpICsrICkKKyAgICAgIHsKKwlwX3QgPSBwbSArIG5yYW5kICggcGwgKTsKKwlpZiAoIHBuX2YgKSBwX3QgKz0gKGxvbmcpICggaSAqIHBuICk7CisJaWYgKCBwc19mICkgcF90ICs9IChsb25nKSAoIGkgKiAoIGkgKiBwcyApKTsKKwlpZiAoIHBhcF9mICkKKwkgICAgaWYgKCByYW5kMDEoKSA8IHBhcCApCisJCXBfdCA9IChsb25nKSAoIHBfdCAqIHBhYyApOworICAgICAgICBwW2ldID0gcF90OworICAgICAgfQorICAgIHBbbisxXSA9IDA7CisgIH0KKworCitpZiAoIHNfZiApIC8qIGFkZGl0aW9uYWwgYXJjcyBmcm9tIGFydGlmaWNhbCBzb3VyY2UgKi8KKyAgeworICAgIHNlZWQyID0gMypzZWVkICsgMTsKKyAgICBpbml0X3JhbmQgKCBzZWVkMiApOworICAgIHNsID0gc2wgLSBzbSArIDE7CisKKyAgICBmb3IgKCBpID0gbjsgaSA+IDE7IGkgLS0gKQorICAgICAgeworCXMgPSBzbSArIG5yYW5kICggc2wgKTsKKwlQUklOVF9BUkMgKCBuMCwgaSwgcyApIAorICAgICAgfQorCisgICAgUFJJTlRfQVJDICggbjAsIDEsIDAgKQorICB9CisKKy8qIGluaXRpYWxpemUgcmFuZG9tIG51bWJlciBnZW5lcmF0b3IgKi8KK2luaXRfcmFuZCAoIHNlZWQgKTsKK2xsID0gbGwgLSBsbSArIDE7CisKKy8qIGdlbmVyYXRpbmcgY29ubmVjdGluZyBjeWNsZShzKSAqLworaWYgKGNfcmFuZG9tKQorICBjbCA9IGxtICsgbnJhbmQgKCBsbCApOworUFJJTlRfQVJDICggMSwgMiwgY2wgKQoraWYgKGNfcmFuZG9tKQorICBjbCA9IGxtICsgbnJhbmQgKCBsbCApOworUFJJTlRfQVJDICggbiwgMSwgY2wgKQorCitmb3IgKCBpID0gMjsgaSA8IG47IGkgKysgKQorICB7CisgICAgaWYgKGNfcmFuZG9tKQorICAgICAgY2wgPSBsbSArIG5yYW5kICggbGwgKTsKKworICAgIGlmICggKCAoaS0xKSAlIChjaC0xKSApICE9IDAgKQorICAgICAgICBQUklOVF9BUkMgKCBpLCBpKzEsIGNsICkKKyAgICBlbHNlCisgICAgICB7IFBSSU5UX0FSQyAoIGksICAgMSwgY2wgKQorICAgICAgICBpZiAoY19yYW5kb20pCisgICAgICAgICAgY2wgPSBsbSArIG5yYW5kICggbGwgKTsKKwlQUklOVF9BUkMgKCAxLCBpKzEsIGNsICkKKyAgICAgIH0KKyAgfQorCisvKiBnZW5lcmF0aW5nIHJhbmRvbSBhcmNzICovCisKK2ZvciAoIGsgPSAxOyBrIDw9IG0gLSBtYzsgayArKyApCisgIHsKKyAgICBpID0gMSArIG5yYW5kICggbiApOworCisgICAgZG8KKyAgICBqID0gMSArIG5yYW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zJyAtIHJhbmRvbSBuZXR3b3JrIGdlbmVyYXRvciBmb3Igc2hvcnRlc3QgcGF0aHMgcHJvYmxlbS5cblwKK0dlbmVyYXRlcyBwcm9ibGVtcyBpbiBleHRlbmRlZCBESU1BQ1MgZm9ybWF0LlxuXAorXG5cCisgICAlcyAgbiBtIHNlZWQgWyAtbGwjaSAtbG0jaSAtbG4jZiAtbHMjZlxuXAorICAgICAgICAgICAgICAgICAgICAgIC1wICAtcGwjaSAtcG0jaSAtcG4jZiAtcHMjZiAtcGFwI2kgLXBhYyNmXG5cCisgICAgICAgICAgICAgICAgICAgICAgLWNsI2kgLWNoI2lcblwKKyAgICAgICAgICAgICAgICAgICAgICAtcyAtc2wjaSAtc20jaVxuXAorICAgICAgICAgICAgICAgICAgICBdXG5cCisgICAlcyAtaGggZmlsZV9uYW1lXG5cCitcblwKKyAgICAgICAgICAgICAgICAgICAgICAgICNpIC0gaW50ZWdlciBudW1iZXIgICAjZiAtIHJlYWwgbnVtYmVyXG5cCitcblwKKyAgICAgIEFyYyBsZW5ndGggcGFyYW1ldGVyczpcblwKKy1sbCNpICAtICNpIGlzIHRoZSB1cHBlciBib3VuZCBvbiBhcmMgbGVuZ3RocyAgICAgICAgICAoZGVmYXVsdCAxMDAwMClcblwKKy1sbSNpICAtICNpIGlzIHRoZSBsb3dlciBib3VuZCBvbiBhcmMgbGVuZ3RocyAgICAgICAgICAoZGVmYXVsdCAwKVxuXAorLWxuI2YgIC0gbXVsdGlwbGl5IGwoaSwgaikgYnkgI2YgKiB8aS1qfCAgICAgICAgICAgICAgIChkZWZhdWx0IDApXG5cCistbHMjZiAgLSBtdWx0aXBsaXkgbChpLCBqKSBieSAjZiAqIHxpLWp8XjIgICAgICAgICAgICAgKGRlZmF1bHQgMClcblwKK1xuXAorICAgICAgUG90ZW50aWFsIHBhcmFtZXRlcnM6XG5cCistcCAgICAgLSBnZW5lcmF0ZSBwb3RlbnRpYWxzIFxuXAorLXBsI2kgIC0gI2kgaXMgdG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