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gdGhlIHBoeXNpY2FsIHBvcnQKKyAgICAgL3N5cy9jbGFzcy9mY19yZW1vdGVfcG9ydHMvcnBvcnQtMTg6MC0wICAgIHJwb3J0IG9uIHRoZSB2cG9ydAorCisKK1Zwb3J0IEF0dHJpYnV0ZXM6CistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgVGhlIG5ldyBmY192cG9ydCBjbGFzcyBvYmplY3QgaGFzIHRoZSBmb2xsb3dpbmcgYXR0cmlidXRlcworCisgICAgIG5vZGVfbmFtZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Pbmx5CisgICAgICAgVGhlIFdXTk4gb2YgdGhlIHZwb3J0CisKKyAgICAgcG9ydF9uYW1lOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWFkX09ubHkKKyAgICAgICBUaGUgV1dQTiBvZiB0aGUgdnBvcnQKKworICAgICByb2xlczogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyB0aGUgRkM0IHJvbGVzIGVuYWJsZWQgb24gdGhlIHZwb3J0LgorCisgICAgIHN5bWJvbGljX25hbWU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Xcml0ZQorICAgICAgIEEgc3RyaW5nLCBhcHBlbmRlZCB0byB0aGUgZHJpdmVyJ3Mgc3ltYm9saWMgcG9ydCBuYW1lIHN0cmluZywgd2hpY2gKKyAgICAgICBpcyByZWdpc3RlcmVkIHdpdGggdGhlIHN3aXRjaCB0byBpZGVudGlmeSB0aGUgdnBvcnQuIEZvciBleGFtcGxlLAorICAgICAgIGEgaHlwZXJ2aXNvciBjb3VsZCBzZXQgdGhpcyBzdHJpbmcgdG8gIlhlbiBEb21haW4gMiBWTSA1IFZwb3J0IDIiLAorICAgICAgIGFuZCB0aGlzIHNldCBvZiBpZGVudGlmaWVycyBjYW4gYmUgc2VlbiBvbiBzd2l0Y2ggbWFuYWdlbWVudCBzY3JlZW5zCisgICAgICAgdG8gaWRlbnRpZnkgdGhlIHBvcnQuCisKKyAgICAgdnBvcnRfZGVsZXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXcml0ZV9Pbmx5CisgICAgICAgV2hlbiB3cml0dGVuIHdpdGggYSAiMSIsIHdpbGwgdGVhciBkb3duIHRoZSB2cG9ydC4KKworICAgICB2cG9ydF9kaXNhYmxlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdyaXRlX09ubHkKKyAgICAgICBXaGVuIHdyaXR0ZW4gd2l0aCBhICIxIiwgd2lsbCB0cmFuc2l0aW9uIHRoZSB2cG9ydCB0byBhIGRpc2FibGVkLgorICAgICAgIHN0YXRlLiAgVGhlIHZwb3J0IHdpbGwgc3RpbGwgYmUgaW5zdGFudGlhdGVkIHdpdGggdGhlIExpbnV4IGtlcm5lbCwKKyAgICAgICBidXQgaXQgd2lsbCBub3QgYmUgYWN0aXZlIG9uIHRoZSBGQyBsaW5rLgorICAgICAgIFdoZW4gd3JpdHRlbiB3aXRoIGEgIjAiLCB3aWxsIGVuYWJsZSB0aGUgdnBvcnQuCisKKyAgICAgdnBvcnRfbGFzdF9zdGF0ZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWFkX09ubHkKKyAgICAgICBJbmRpY2F0ZXMgdGhlIHByZXZpb3VzIHN0YXRlIG9mIHRoZSB2cG9ydC4gIFNlZSB0aGUgc2VjdGlvbiBiZWxvdyBvbgorICAgICAgICJWcG9ydCBTdGF0ZXMiLgorCisgICAgIHZwb3J0X3N0YXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Pbmx5CisgICAgICAgSW5kaWNhdGVzIHRoZSBzdGF0ZSBvZiB0aGUgdnBvcnQuICBTZWUgdGhlIHNlY3Rpb24gYmVsb3cgb24KKyAgICAgICAiVnBvcnQgU3RhdGVzIi4KKworICAgICB2cG9ydF90eXBlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIFJlZmxlY3RzIHRoZSBGQyBtZWNoYW5pc20gdXNlZCB0byBjcmVhdGUgdGhlIHZpcnR1YWwgcG9ydC4KKyAgICAgICBPbmx5IE5QSVYgaXMgc3VwcG9ydGVkIGN1cnJlbnRseS4KKworCisgIEZvciB0aGUgZmNfaG9zdCBjbGFzcyBvYmplY3QsIHRoZSBmb2xsb3dpbmcgYXR0cmlidXRlcyBhcmUgYWRkZWQgZm9yIHZwb3J0czoKKworICAgICBtYXhfbnBpdl92cG9ydHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyB0aGUgbWF4aW11bSBudW1iZXIgb2YgTlBJVi1iYXNlZCB2cG9ydHMgdGhhdCB0aGUKKyAgICAgICBkcml2ZXIvYWRhcHRlciBjYW4gc3VwcG9ydCBvbiB0aGUgZmNfaG9zdC4KKworICAgICBucGl2X3Zwb3J0c19pbnVzZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyBob3cgbWFueSBOUElWLWJhc2VkIHZwb3J0cyBoYXZlIGJlZW4gaW5zdGFudGlhdGVkIG9uIHRoZQorICAgICAgIGZjX2hvc3QuCisKKyAgICAgdnBvcnRfY3JlYXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXcml0ZV9Pbmx5CisgICAgICAgQSAic2ltcGxlIiBjcmVhdGUgaW50ZXJmYWNlIHRvIGluc3RhbnRpYXRlIGEgdnBvcnQgb24gYW4gZmNfaG9zdC4KKyAgICAgIC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QUJSSUNfUkVKX1dXTiAgICAgLSBGYWJyaWMgUmVqZWN0ZWQgV1dOCisgICAgICBUaGUgdnBvcnQgaXMgbm90IG9wZXJhdGlvbmFsLiBUaGUgRmFicmljIGZhaWxlZCBGRElTQyB3aXRoIGEgc3RhdHVzCisgICAgICBpbmRpY2F0aW5nIHRoYXQgdGhlIFdXTidzIGFyZSBub3QgdmFsaWQuCisKKyAgICBGQ19WUE9SVF9GQUlMRUQgICAgICAgICAgICAgLSBWUG9ydCBGYWlsZWQKKyAgICAgIFRoZSB2cG9ydCBpcyBub3Qgb3BlcmF0aW9uYWwuIFRoaXMgaXMgYSBjYXRjaGFsbCBmb3IgYWxsIG90aGVyCisgICAgICBlcnJvciBjb25kaXRpb25zLgorCisKKyAgVGhlIGZvbGxvd2luZyBzdGF0ZSB0YWJsZSBpbmRpY2F0ZXMgdGhlIGRpZmZlcmVudCBzdGF0ZSB0cmFuc2l0aW9uczoKKworICAgIFN0YXRlICAgICAgICAgICAgICBFdmVudCAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXcgU3RhdGUKKyAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICBuL2EgICAgICAgICAgICAgICAgSW5pdGlhbGl6YXRpb24gICAgICAgICAgICAgICAgICBVbmtub3duCisgICAgVW5rbm93bjogICAgICAgICAgICBMaW5rIERvd24gICAgICAgICAgICAgICAgICAgICAgIExpbmtkb3duCisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgTG9vcCAgICAgICAgICAgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgbm8gRmFicmljICAgICAgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgRkxPR0kgcmVzcG9uc2UgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGljYXRlcyBubyBOUElWIHN1cHBvcnQKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgVXAgJiBGRElTQyBiZWluZyBzZW50ICAgICAgSW5pdGlhbGl6aW5nCisgICAgICAgICAgICAgICAgICAgICAgICBEaXNhYmxlIHJlcXVlc3QgICAgICAgICAgICAgICAgIERpc2FibGUKKyAgICBMaW5rZG93bjogICAgICAgICAgIExpbmsgVXAgICAgICAgICAgICAgICAgICAgICAgICAgVW5rbm93bgorICAgIEluaXRpYWxpemluZzogICAgICAgRkRJU0MgQUNDICAgICAgICAgICAgICAgICAgICAgICBBY3RpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgIEZESVNDIExTX1JKVCB3LyBubyByZXNvdXJjZXMgICAgTm8gRmFicmljIFJlc291cmNlcworICAgICAgICAgICAgICAgICAgICAgICAgRkRJU0MgTFNfUkpUIHcvIGludmFsaWQgICAgICAgICBGYWJyaWMgUmVqZWN0ZWQgV1dOCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBuYW1lIG9yIGludmFsaWQgbnBvcnRfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgIEZESVNDIExTX1JKVCBmYWlsZWQgZm9yICAgICAgICAgVnBvcnQgRmFpbGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyIHJlYXNvbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgRG93biAgICAgICAgICAgICAgICAgICAgICAgTGlua2Rvd24KKyAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgcmVxdWVzdCAgICAgICAgICAgICAgICAgRGlzYWJsZQorICAgIERpc2FibGU6ICAgICAgICAgICAgRW5hYmxlIHJlcXVlc3QgICAgICAgICAgICAgICAgICBVbmtub3duCisgICAgQWN0aXZlOiAgICAgICAgICAgICBMT0dPIHJlY2VpdmVkIGZyb20gZmFicmljICAgICAgIEZhYnJpYyBMb2dvdXQKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgRG93biAgICAgICAgICAgICAgICAgICAgICAgTGlua2Rvd24KKyAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgcmVxdWVzdCAgICAgICAgICAgICAgICAgRGlzYWJsZQorICAgIEZhYnJpYyBMb2dvdXQ6ICAgICAgTGluayBzdGlsbCB1cCAgICAgICAgICAgICAgICAgICBVbmtub3duCisKKyAgICAgICAgIFRoZSBmb2xsb3dpbmcgNCBlcnJvciBzdGF0ZXMgYWxsIGhhdmUgdGhlIHNhbWUgdHJhbnNpdGlvbnM6CisgICAgTm8gRmFicmljIFN1cHBvcnQ6CisgICAgTm8gRmFicmljIFJlc291cmNlczoKKyAgICBGYWJyaWMgUmVqZWN0ZWQgV1dOOgorICAgIFZwb3J0IEZhaWxlZDoKKyAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgcmVxdWVzdCAgICAgICAgICAgICAgICAgRGlzYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgTGluayBnb2VzIGRvd24gICAgICAgICAgICAgICAgICBMaW5rZG93bgorCisKK1RyYW5zcG9ydCA8LT4gTExERCBJbnRlcmZhY2VzIDoKKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworVnBvcnQgc3VwcG9ydCBieSBMTEREOgorCisgIFRoZSBMTEREIGluZGljYXRlcyBzdXBwb3J0IGZvciB2cG9ydHMgYnkgc3VwcGx5aW5nIGEgdnBvcnRfY3JlYXRlKCkKKyAgZnVuY3Rpb24gaW4gdGhlIHRyYW5zcG9ydCB0ZW1wbGF0ZS4gIFRoZSBwcmVzZW5zZSBvZiB0aGlzIGZ1bmN0aW9uIHdpbGwKKyAgY2F1c2UgdGhlIGNyZWF0aW9uIG9mIHRoZSBuZXcgYXR0cmlidXRlcyBvbiB0aGUgZmNfaG9zdC4gIEFzIHBhcnQgb2YKKyAgdGhlIHBoeXNpY2FsIHBvcnQgY29tcGxldG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ibW1jYV9wcm9jX2luZm8sCisgICAgICAgICAgLm5hbWUgICAgICAgICAgID0gIklCTSBTQ1NJLVN1YnN5c3RlbSIsCisgICAgICAgICAgLnF1ZXVlY29tbWFuZCAgID0gaWJtbWNhX3F1ZXVlY29tbWFuZCwKKwkgIC5laF9hYm9ydF9oYW5kbGVyID0gaWJtbWNhX2Fib3J0LAorCSAgLmVoX2hvc3RfcmVzZXRfaGFuZGxlciA9IGlibW1jYV9ob3N0X3Jlc2V0LAorICAgICAgICAgIC5iaW9zX3BhcmFtICAgICA9IGlibW1jYV9iaW9zcGFyYW0sCisgICAgICAgICAgLmNhbl9xdWV1ZSAgICAgID0gMTYsCisgICAgICAgICAgLnRoaXNfaWQgICAgICAgID0gNywKKyAgICAgICAgICAuc2dfdGFibGVzaXplICAgPSAxNiwKKyAgICAgICAgICAuY21kX3Blcl9sdW4gICAgPSAxLAorICAgICAgICAgIC51c2VfY2x1c3RlcmluZyA9IEVOQUJMRV9DTFVTVEVSSU5HLAorfTsKKworc3RhdGljIGludCBpYm1tY2FfcHJvYmUoc3RydWN0IGRldmljZSAqZGV2KQogewogCXN0cnVjdCBTY3NpX0hvc3QgKnNocG50OwotCWludCBwb3J0LCBpZCwgaSwgaiwgaywgc2xvdDsKLQlpbnQgZGV2aWNlc19vbl9pcnFfMTEgPSAwOwotCWludCBkZXZpY2VzX29uX2lycV8xNCA9IDA7Ci0JaW50IElSUTE0X3JlZ2lzdGVyZWQgPSAwOwotCWludCBJUlExMV9yZWdpc3RlcmVkID0gMDsKLQotCWZvdW5kID0gMDsJCS8qIG1ha2UgYWJzb2x1dGVseSBzdXJlLCB0aGF0IGZvdW5kIGlzIHNldCB0byAwICovCisJaW50IHBvcnQsIGlkLCBpLCBqLCBrLCBpcnEsIGVuYWJsZWQsIHJldCA9IC1FSU5WQUw7CisJc3RydWN0IG1jYV9kZXZpY2UgKm1jYV9kZXYgPSB0b19tY2FfZGV2aWNlKGRldik7CisJY29uc3QgY2hhciAqZGVzY3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wogCiAKLXN0YXRpYyBVQ0hBUiB0dWxfcmF0ZV90YmxbOF0gPQkvKiBmYXN0IDIwICAgICAgKi8KK3N0YXRpYyB1OCBpbml0aW9fcmF0ZV90YmxbOF0gPQkvKiBmYXN0IDIwICAgICAgKi8KIHsKIAkJCQkvKiBuYW5vc2Vjb25kIGRldmlkZSBieSA0ICovCiAJMTIsCQkJLyogNTBucywgIDIwTSAgICovCkBAIC0zMDIsNTMgKzI1MywxNyBAQAogCTYyCQkJLyogMjUwbnMsIDRNICAgICovCiB9OwogCi1zdGF0aWMgdm9pZCB0dWxfZG9fcGF1c2UodW5zaWduZWQgYW1vdW50KQotewkJCQkvKiBQYXVzZSBmb3IgYW1vdW50IGppZmZpZXMgKi8KK3N0YXRpYyB2b2lkIGluaXRpb19kb19wYXVzZSh1bnNpZ25lZCBhbW91bnQpCit7CisJLyogUGF1c2UgZm9yIGFtb3VudCBqaWZmaWVzICovCiAJdW5zaWduZWQgbG9uZyB0aGVfdGltZSA9IGppZmZpZXMgKyBhbW91bnQ7CiAKLQl3aGlsZSAodGltZV9iZWZvcmVfZXEoamlmZmllcywgdGhlX3RpbWUpKTsKKwl3aGlsZSAodGltZV9iZWZvcmVfZXEoamlmZmllcywgdGhlX3RpbWUpKQorCQljcHVfcmVsYXgoKTsKIH0KIAogLyotLSBmb3J3YXJkIHJlZmVyZW5jZSAtLSovCiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JVXNlIG1lbWVvcnkgcmVmcmVzaCB0aW1lICAgICAgICB+IDE1dXMgKiAyCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgdHVsX3NlMl93YWl0KHZvaWQpCi17Ci0jaWYgMQotCXVkZWxheSgzMCk7Ci0jZWxzZQotCVVDSEFSIHJlYWRCeXRlOwotCi0JcmVhZEJ5dG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S8qIC1DUyAgKi8KLQl0dWxfc2UyX3dhaXQoKTsKLQlyZXR1cm47CisJaW5pdGlvX3NlMl9pbnN0cihiYXNlLCAweDMwKTsJLyogRVdFTiAqLworCW91dGIoMCwgYmFzZSArIFRVTF9OVlJBTSk7CS8qIC1DUyAgKi8KKwl1ZGVsYXkoMzApOwogfQogCiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSBEaXNhYmxlIGVyYXNlL3dyaXRlIHN0YXRlIG9mIHNlcmlhbCBFRVBST00KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHR1bF9zZTJfZXdfZHMoV09SRCBDdXJCYXNlKQorLyoqCisgKglpbml0aW9fc2UyX2V3X2RzCS0JRGlzYWJsZSBlcmFzZS93cml0ZQorICoJQGJhc2U6IEJhc2UgYWRkcmVzcyBvZiBJbml0SU8gY29udHJvbGxlcgorICoKKyAqCURpc2FibGUgZXJhc2Uvd3JpdGUgc3RhdGUgb2Ygc2VyaWFsIEVFUFJPTQorICovCit2b2lkIGluaXRpb19zZTJfZXdfZHModW5zaWduZWQgbG9uZyBiYXNlKQogewotCXR1bF9zZTJfaW5zdHIoQ3VyQmFzZSwgMCk7CS8qIEVXRFMgKi8KLQlUVUxfV1IoQ3VyQmFzZSArIFRVTF9OVlJBTSwgMCk7CQkvKiAtQ1MgICovCi0JdHVsX3NlMl93YWl0KCk7Ci0JcmV0dXJuOworCWluaXRpb19zZTJfaW5zdHIoYmFzZSwgMCk7CS8qIEVXRFMgKi8KKwlvdXRiKDAsIGJhc2UgKyBUVUxfTlZSQU0pOwkvKiAtQ1MgICovCisJdWRlbGF5KDMwKTsKIH0KIAogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JS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WZvciAoaSA9IDA7IGkgPCAzMTsgaSsrKQogCQljaGtzdW0gKz0gKm5wKys7Ci0JKm5wID0gKFVTSE9SVCkgY2hrc3VtOwotCXR1bF9zZTJfZXdfZW4oQ3VyQmFzZSk7CS8qIEVuYWJsZSB3cml0ZSAgKi8KKwkqbnAgPSBjaGtzdW07CisJaW5pdGlvX3NlMl9ld19lbihiYXNlKTsJLyogRW5hYmxlIHdyaXRlICAqLwogCi0JbnAgPSAoVVNIT1JUICopIGk5MXVkZnROdlJhbTsKLQlucDEgPSAoVVNIT1JUICopIGk5MXVudnJhbXA7CisJbnAgPSAodTE2ICopIGk5MXVkZnROdlJhbTsKKwlucDEgPSAodTE2ICopIGk5MXVudnJhbXA7CiAJZm9yIChpID0gMDsgaSA8IDMyOyBpKyssIG5wKyssIG5wMSsrKSB7Ci0JCWlmICgqbnAgIT0gKm5wMSkgewotCQkJdHVsX3NlMl93cihDdXJCYXNlLCBpLCAqbnApOwotCQl9CisJCWlmICgqbnAgIT0gKm5wMSkKKwkJCWluaXRpb19zZTJfd3IoYmFzZSwgaSwgKm5wKTsKIAl9Ci0KLQl0dWxfc2UyX2V3X2RzKEN1ckJhc2UpOwkvKiBEaXNhYmxlIHdyaXRlICAgKi8KLQlyZXR1cm47CisJaW5pdGlvX3NlMl9ld19kcyhiYXNlKTsJLyogRGlzYWJsZSB3cml0ZSAgICovCiB9CiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gRnVuY3Rpb24gbmFtZSAgOiByZWFkX2VlcHJvbQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHR1bF9yZWFkX2VlcHJvbShXT1JEIEN1ckJhc2UpCisvKioKKyAqCWluaXRpb19yZWFkX2VlcHJvbQkJLQlSZXRyaWV2ZSBjb25maWd1cmF0aW9uC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isJCWlmIChpbmIoaG9zdC0+YWRkciArIFRVTF9TU3RhdHVzMCkgJiBUU1NfSU5UX1BFTkRJTkcpCiAJCQljb250aW51ZTsKLQotCQlpZiAocEN1ckhjYi0+SENTX0FjdFNjYikgewkvKiByZXR1cm4gdG8gT1MgYW5kIHdhaXQgZm9yIHhmZXJfZG9uZV9JU1IvU2VsZWN0ZWRfSVNSICovCisJCWlmIChob3N0LT5hY3RpdmUpCS8qIHJldHVybiB0byBPUyBhbmQgd2FpdCBmb3IgeGZlcl9kb25lX0lTUi9TZWxlY3RlZF9JU1IgKi8KIAkJCXJldHVybiAxOwkvKiByZXR1cm4gdG8gT1MsIGVuYWJsZSBpbnRlcnJ1cHQgKi8KLQkJfQogCQkvKiBDaGVjayBwZW5kaW5nIFNDQiAgICAgICAgICAgICovCi0JCWlmICh0dWxfZmluZF9maXJzdF9wZW5kX3NjYihwQ3VySGNiKSA9PSBOVUxMKSB7CisJCWlmIChpbml0aW9fZmluZF9maXJzdF9wZW5kX3NjYihob3N0KSA9PSBOVUxMKQogCQkJcmV0dXJuIDE7CS8qIHJldHVybiB0byBPUywgZW5hYmxlIGludGVycnVwdCAqLwotCQl9CiAJfQkJCS8qIEVuZCBvZiBmb3IgbG9vcCAqLwogCS8qIHN0YXRlbWVudCB3b24ndCByZWFjaCBoZXJlICovCiB9CiAKLQotCi0KLS8qKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLy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Ci0jZGVmaW5lIFVCWVRFICAgdW5zaWduZWQgY2hhcgotI2RlZmluZSBVV09SRCAgIHVuc2lnbmVkIHNob3J0Ci0jZGVmaW5lIFVEV09SRCAgdW5zaWduZWQgbG9uZwotI2RlZmluZSBVMzIgICAgIHUzMgotCiAjZGVmaW5lIFRPVEFMX1NHX0VOVFJZCQkzMgogI2RlZmluZSBNQVhfU1VQUE9SVEVEX0FEQVBURVJTICA4CiAjZGVmaW5lIE1BWF9PRkZTRVQJCTE1CkBAIC0zNjgsNTUgKzMzOCw1NSBAQAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICBTY2F0dGVyLUdhdGhlciBFbGVtZW50IFN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdHlwZWRlZiBzdHJ1Y3QgU0dfU3RydWMgewotCVUzMiBTR19QdHI7CQkvKiBEYXRhIFBvaW50ZXIgKi8KLQlVMzIgU0dfTGVuOwkJLyogRGF0YSBMZW5ndGggKi8KLX0gU0c7CitzdHJ1Y3Qgc2dfZW50cnkgeworCXUzMiBkYXRhOwkJLyogRGF0YSBQb2ludGVyICovCisJdTMyIGxlbjsJCS8qIERhdGEgTGVuZ3RoICovCit9OwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJU0NTSSBDb250cm9sIEJsb2NrCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIHN0cnVjdCBTY3NpX0N0cmxfQmxrIHsKLQlzdHJ1Y3QgU2NzaV9DdHJsX0JsayAqU0NCX054dF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CX1N0YXR1cyAqLworLyogQml0IERlZmluaXRpb24gZm9yIHN0YXR1cyAqLwogI2RlZmluZSBTQ0JfUkVOVCAgICAgICAgMHgwMQogI2RlZmluZSBTQ0JfUEVORCAgICAgICAgMHgwMgogI2RlZmluZSBTQ0JfQ09OVElHICAgICAgMHgwNAkvKiBDb250aWdlbnQgQWxsZWdpYW5jZSAqLwpAQCAtNDI1LDE3ICszOTUsMTcgQEAKICNkZWZpbmUgU0NCX0RPTkUgICAgICAgIDB4MjAKIAogCi0vKiBPcGNvZGVzIG9mIFNDQl9PcGNvZGUgKi8KKy8qIE9wY29kZXMgZm9yIG9wY29kZSAqLwogI2RlZmluZSBFeGVjU0NTSSAgICAgICAgMHgxCiAjZGVmaW5lIEJ1c0RldlJzdCAgICAgICAweDIKICNkZWZpbmUgQWJvcnRDbWQgICAgICAgIDB4MwogCiAKLS8qIEJpdCBEZWZpbml0aW9uIGZvciBTQ0JfTW9kZSAqLworLyogQml0IERlZmluaXRpb24gZm9yIG1vZGUgKi8KICNkZWZpbmUgU0NNX1JTRU5TICAgICAgIDB4MDEJLyogcmVxdWVzdCBzZW5zZSBtb2RlICovCiAKIAotLyogQml0IERlZmluaXRpb24gZm9yIFNDQl9GbGFncyAqLworLyogQml0IERlZmluaXRpb24gZm9yIGZsYWdzICovCiAjZGVmaW5lIFNDRl9ET05FICAgICAgICAweDAxCiAjZGVmaW5lIFNDRl9QT1NUICAgICAgICAweDAyCiAjZGVmaW5lIFNDRl9TRU5TRSAgICAgICAweDA0CkBAIC00OTIsMTUgKzQ2MiwxNCBAQAogCQlUYXJnZXQgRGV2aWNlIENvbnRyb2wgU3RydWN0dXJlCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi10eXBlZGVmIHN0cnVjdCBUYXJfQ3RybF9TdHJ1YyB7Ci0JVVdPUkQgVENTX0ZsYWdzOwkvKiAwICovCi0JVUJZVEUgVENTX0pTX1BlcmlvZDsJLyogMiAqLwotCVVCWVRFIFRDU19TQ29uZmlnMDsJLyogMyAqLwotCi0JVVdPUkQgVENTX0RydkZsYWdzOwkvKiA0ICovCi0JVUJZVEUgVENTX0RydkhlYWQ7CS8qIDYgKi8KLQlVQllURSBUQ1NfRHJ2U2VjdG9yOwkvKiA3ICovCi19IFRDUzsKK3N0cnVjdCB0YXJnZXRfY29udHJvbCB7CisJdTE2IGZsYWdzOworCXU4IGpzX3BlcmlvZDsKKwl1OCBzY29uZmlnMDsKKwl1MTYgZHJ2X2ZsYWdzOworCXU4IGhlYWRzOworCXU4IHNlY3RvcnM7Cit9OwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJVGFyZ2V0IERldmljZSBDb250cm9sIFN0cnVjdHVyZQpAQCAtNTIzLDYyICs0OTIsNTMgQEAKICNkZWZpbmUgVENGX0RSVl9FTl9UQUcgICAgICAgICAgMHgwODAwCiAjZGVmaW5lIFRDRl9EUlZfMjU1XzYzICAgICAgICAgIDB4MDQwMAogCi10eXBlZGVmIHN0cnVjdCBJOTF1X0FkcHRfU3RydWMgewotCVVXT1JEIEFEUFRfQklPUzsJLyogMCAqLwotCVVXT1JEIEFEUFRfQkFTRTsJLyogMSAqLwotCVVCWVRFIEFEUFRfQnVzOwkJLyogMiAqLwotCVVCWVRFIEFEUFRfRGV2aWNlOwkvKiAzICovCi0JVUJZVEUgQURQVF9JTlRSOwkvKiA0ICovCi19IElOSV9BRFBUX1NUUlVDVDsKLQotCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkgICAgICBIb3N0IEFkYXB0ZXIgQ29udHJvbCBTdHJ1Y3R1cmUKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ipzdGFydCwgb2ZmX3Qgb2Zmc2V0LCBpbnQgbGVuZ3RoLAotCQkgICAgICAgICAgICAgIGludCBob3N0bm8sIGludCBmdW5jKQotewotCWludCBpOwotCi0JZm9yIChpID0gMDsgaSA8IGlwc19uZXh0X2NvbnRyb2xsZXI7IGkrKykgewotCQlpZiAoaXBzX3NoW2ldICYmIGlwc19zaFtpXS0+aG9zdF9ubyA9PSBob3N0bm8pIHsKLQkJCXJldHVybiBpcHNfcHJvY19pbmZvKGlwc19zaFtpXSwgYnVmZmVyLCBzdGFydCwKLQkJCQkJICAgICBvZmZzZXQsIGxlbmd0aCwgZnVuYyk7Ci0JCX0KLQl9Ci0JcmV0dXJuIC1FSU5WQUw7CQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUm91dGluZSBOYW1lOiBpcHNfc2VsZWN0X3F1ZXVlX2RlcHRoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJvdXRpbmUgRGVzY3JpcHRpb246ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFNlbGVjdCBxdWV1ZSBkZXB0aHMgZm9yIHRoZSBkZXZpY2VzIG9uIHRoZSBjb250b2xsZXIgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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X2RlcHRoID0gMjsKLQkJCX0KLQotCQkJaWYgKGRldmljZS0+cXVldWVfZGVwdGggPCAyKQotCQkJCWRldmljZS0+cXVldWVfZGVwdGggPSAyOwotCQl9Ci0JfQotfQotCi0jZWxzZQogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIFJvdXRpbmUgTmFtZTogaXBzX3NsYXZlX2NvbmZpZ3VyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTMxNiw3ICsxMjE5LDYgQEAKIAlTRHB0ci0+c2tpcF9tc19wYWdlXzNmID0gMTsKIAlyZXR1cm4gMDsKIH0KLSNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTMzMSw3ICsxMjMzLDYgQEAKIGRvX2lwc2ludHIoaW50IGlycSwgdm9pZCAqZGV2X2lkKQogewogCWlwc19oYV90ICpoYTsKLQl1bnNpZ25lZCBsb25nIGNwdV9mbGFnczsKIAlzdHJ1Y3QgU2NzaV9Ib3N0ICpob3N0OwogCWludCBpcnFzdGF0dXM7CiAKQEAgLTEzNDcsMTYgKzEyNDgsMTYgQEAKIAkJcmV0dXJuIElSUV9IQU5ETEVEOwogCX0KIAotCUlQU19MT0NLX1NBVkUoaG9zdC0+aG9zdF9sb2NrLCBjcHVfZmxhZ3MpOworCXNwaW5fbG9jayhob3N0LT5ob3N0X2xvY2spOwogCiAJaWYgKCFoYS0+YWN0aXZlKSB7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