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ysgYi9Eb2N1bWVudGF0aW9uL3Njc2kvc2NzaV9mY190cmFuc3BvcnQudHh0CkBAIC0wLDAgKzEsNDUwIEBACisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNDU0kgRkMgVGFuc3BvcnQKKyAgICAgICAgICAgICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK0RhdGU6ICA0LzEyLzIwMDcKK0tlcm5lbCBSZXZpc2lvbnMgZm9yIGZlYXR1cmVzOgorICBycG9ydHMgOiA8PFRCUz4+CisgIHZwb3J0cyA6IDIuNi4yMiAoPyBUQkQpCisKKworSW50cm9kdWN0aW9uCis9PT09PT09PT09PT0KK1RoaXMgZmlsZSBkb2N1bWVudHMgdGhlIGZlYXR1cmVzIGFuZCBjb21wb25lbnRzIG9mIHRoZSBTQ1NJIEZDIFRyYW5zcG9ydC4KK0l0IGFsc28gcHJvdmlkZXMgZG9jdW1lbnRzIHRoZSBBUEkgYmV0d2VlbiB0aGUgdHJhbnNwb3J0IGFuZCBGQyBMTEREcy4KK1RoZSBGQyB0cmFuc3BvcnQgY2FuIGJlIGZvdW5kIGF0OgorICBkcml2ZXJzL3Njc2kvc2NzaV90cmFuc3BvcnRfZmMuYworICBpbmNsdWRlL3Njc2kvc2NzaV90cmFuc3BvcnRfZmMuaAorICBpbmNsdWRlL3Njc2kvc2NzaV9uZXRsaW5rX2ZjLmgKKworVGhpcyBmaWxlIGlzIGZvdW5kIGF0IERvY3VtZW50YXRpb24vc2NzaS9zY3NpX2ZjX3RyYW5zcG9ydC50eHQKKworCitGQyBSZW1vdGUgUG9ydHMgKHJwb3J0cykKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorPDwgVG8gQmUgU3VwcGxpZWQgPj4KKworCitGQyBWaXJ0dWFsIFBvcnRzICh2cG9ydHMpCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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G9ydCBjbGFzcyBvYmplY3QgaGFzIHRoZSBmb2xsb3dpbmcgYXR0cmlidXRlcworCisgICAgIG5vZGVfbmFtZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Pbmx5CisgICAgICAgVGhlIFdXTk4gb2YgdGhlIHZwb3J0CisKKyAgICAgcG9ydF9uYW1lOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWFkX09ubHkKKyAgICAgICBUaGUgV1dQTiBvZiB0aGUgdnBvcnQKKworICAgICByb2xlczogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyB0aGUgRkM0IHJvbGVzIGVuYWJsZWQgb24gdGhlIHZwb3J0LgorCisgICAgIHN5bWJvbGljX25hbWU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Xcml0ZQorICAgICAgIEEgc3RyaW5nLCBhcHBlbmRlZCB0byB0aGUgZHJpdmVyJ3Mgc3ltYm9saWMgcG9ydCBuYW1lIHN0cmluZywgd2hpY2gKKyAgICAgICBpcyByZWdpc3RlcmVkIHdpdGggdGhlIHN3aXRjaCB0byBpZGVudGlmeSB0aGUgdnBvcnQuIEZvciBleGFtcGxlLAorICAgICAgIGEgaHlwZXJ2aXNvciBjb3VsZCBzZXQgdGhpcyBzdHJpbmcgdG8gIlhlbiBEb21haW4gMiBWTSA1IFZwb3J0IDIiLAorICAgICAgIGFuZCB0aGlzIHNldCBvZiBpZGVudGlmaWVycyBjYW4gYmUgc2VlbiBvbiBzd2l0Y2ggbWFuYWdlbWVudCBzY3JlZW5zCisgICAgICAgdG8gaWRlbnRpZnkgdGhlIHBvcnQuCisKKyAgICAgdnBvcnRfZGVsZXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXcml0ZV9Pbmx5CisgICAgICAgV2hlbiB3cml0dGVuIHdpdGggYSAiMSIsIHdpbGwgdGVhciBkb3duIHRoZSB2cG9ydC4KKworICAgICB2cG9ydF9kaXNhYmxlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdyaXRlX09ubHkKKyAgICAgICBXaGVuIHdyaXR0ZW4gd2l0aCBhICIxIiwgd2lsbCB0cmFuc2l0aW9uIHRoZSB2cG9ydCB0byBhIGRpc2FibGVkLgorICAgICAgIHN0YXRlLiAgVGhlIHZwb3J0IHdpbGwgc3RpbGwgYmUgaW5zdGFudGlhdGVkIHdpdGggdGhlIExpbnV4IGtlcm5lbCwKKyAgICAgICBidXQgaXQgd2lsbCBub3QgYmUgYWN0aXZlIG9uIHRoZSBGQyBsaW5rLgorICAgICAgIFdoZW4gd3JpdHRlbiB3aXRoIGEgIjAiLCB3aWxsIGVuYWJsZSB0aGUgdnBvcnQuCisKKyAgICAgdnBvcnRfbGFzdF9zdGF0ZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWFkX09ubHkKKyAgICAgICBJbmRpY2F0ZXMgdGhlIHByZXZpb3VzIHN0YXRlIG9mIHRoZSB2cG9ydC4gIFNlZSB0aGUgc2VjdGlvbiBiZWxvdyBvbgorICAgICAgICJWcG9ydCBTdGF0ZXMiLgorCisgICAgIHZwb3J0X3N0YXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVhZF9Pbmx5CisgICAgICAgSW5kaWNhdGVzIHRoZSBzdGF0ZSBvZiB0aGUgdnBvcnQuICBTZWUgdGhlIHNlY3Rpb24gYmVsb3cgb24KKyAgICAgICAiVnBvcnQgU3RhdGVzIi4KKworICAgICB2cG9ydF90eXBlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIFJlZmxlY3RzIHRoZSBGQyBtZWNoYW5pc20gdXNlZCB0byBjcmVhdGUgdGhlIHZpcnR1YWwgcG9ydC4KKyAgICAgICBPbmx5IE5QSVYgaXMgc3VwcG9ydGVkIGN1cnJlbnRseS4KKworCisgIEZvciB0aGUgZmNfaG9zdCBjbGFzcyBvYmplY3QsIHRoZSBmb2xsb3dpbmcgYXR0cmlidXRlcyBhcmUgYWRkZWQgZm9yIHZwb3J0czoKKworICAgICBtYXhfbnBpdl92cG9ydHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyB0aGUgbWF4aW11bSBudW1iZXIgb2YgTlBJVi1iYXNlZCB2cG9ydHMgdGhhdCB0aGUKKyAgICAgICBkcml2ZXIvYWRhcHRlciBjYW4gc3VwcG9ydCBvbiB0aGUgZmNfaG9zdC4KKworICAgICBucGl2X3Zwb3J0c19pbnVzZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWRfT25seQorICAgICAgIEluZGljYXRlcyBob3cgbWFueSBOUElWLWJhc2VkIHZwb3J0cyBoYXZlIGJlZW4gaW5zdGFudGlhdGVkIG9uIHRoZQorICAgICAgIGZjX2hvc3QuCisKKyAgICAgdnBvcnRfY3JlYXRlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXcml0ZV9Pbmx5CisgICAgICAgQSAic2ltcGxlIiBjcmVhdGUgaW50ZXJmYWNlIHRvIGluc3RhbnRpYXRlIGEgdnBvcnQgb24gYW4gZmNfaG9zdC4KKyAgICAgICBBICI8V1dQTj46PFdXTk4+IiBzdHJpbmcgaXMgd3JpdHRlbiB0byB0aGUgYXR0cmlidXRlLiBUaGUgdHJhbnNwb3J0CisgICAgICAgdGhlbiBpbnN0YW50aWF0ZXMgdGhlIHZwb3J0IG9iamVjdCBhbmQgY2FsbHMgdGhlIExMREQgdG8gY3JlYXRlIHRoZQorICAgICAgIHZwb3J0IHdpdGggdG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KKyAgICBGQ19WUE9SVF9GQUlMRUQgICAgICAgICAgICAgLSBWUG9ydCBGYWlsZWQKKyAgICAgIFRoZSB2cG9ydCBpcyBub3Qgb3BlcmF0aW9uYWwuIFRoaXMgaXMgYSBjYXRjaGFsbCBmb3IgYWxsIG90aGVyCisgICAgICBlcnJvciBjb25kaXRpb25zLgorCisKKyAgVGhlIGZvbGxvd2luZyBzdGF0ZSB0YWJsZSBpbmRpY2F0ZXMgdGhlIGRpZmZlcmVudCBzdGF0ZSB0cmFuc2l0aW9uczoKKworICAgIFN0YXRlICAgICAgICAgICAgICBFdmVudCAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXcgU3RhdGUKKyAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICBuL2EgICAgICAgICAgICAgICAgSW5pdGlhbGl6YXRpb24gICAgICAgICAgICAgICAgICBVbmtub3duCisgICAgVW5rbm93bjogICAgICAgICAgICBMaW5rIERvd24gICAgICAgICAgICAgICAgICAgICAgIExpbmtkb3duCisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgTG9vcCAgICAgICAgICAgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgbm8gRmFicmljICAgICAgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICBMaW5rIFVwICYgRkxPR0kgcmVzcG9uc2UgICAgICAgIE5vIEZhYnJpYyBTdXBwb3J0CisgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGljYXRlcyBubyBOUElWIHN1cHBvcnQKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgVXAgJiBGRElTQyBiZWluZyBzZW50ICAgICAgSW5pdGlhbGl6aW5nCisgICAgICAgICAgICAgICAgICAgICAgICBEaXNhYmxlIHJlcXVlc3QgICAgICAgICAgICAgICAgIERpc2FibGUKKyAgICBMaW5rZG93bjogICAgICAgICAgIExpbmsgVXAgICAgICAgICAgICAgICAgICAgICAgICAgVW5rbm93bgorICAgIEluaXRpYWxpemluZzogICAgICAgRkRJU0MgQUNDICAgICAgICAgICAgICAgICAgICAgICBBY3RpdmUKKyAgICAgICAgICAgICAgICAgICAgICAgIEZESVNDIExTX1JKVCB3LyBubyByZXNvdXJjZXMgICAgTm8gRmFicmljIFJlc291cmNlcworICAgICAgICAgICAgICAgICAgICAgICAgRkRJU0MgTFNfUkpUIHcvIGludmFsaWQgICAgICAgICBGYWJyaWMgUmVqZWN0ZWQgV1dOCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBuYW1lIG9yIGludmFsaWQgbnBvcnRfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgIEZESVNDIExTX1JKVCBmYWlsZWQgZm9yICAgICAgICAgVnBvcnQgRmFpbGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyIHJlYXNvbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgRG93biAgICAgICAgICAgICAgICAgICAgICAgTGlua2Rvd24KKyAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgcmVxdWVzdCAgICAgICAgICAgICAgICAgRGlzYWJsZQorICAgIERpc2FibGU6ICAgICAgICAgICAgRW5hYmxlIHJlcXVlc3QgICAgICAgICAgICAgICAgICBVbmtub3duCisgICAgQWN0aXZlOiAgICAgICAgICAgICBMT0dPIHJlY2VpdmVkIGZyb20gZmFicmljICAgICAgIEZhYnJpYyBMb2dvdXQKKyAgICAgICAgICAgICAgICAgICAgICAgIExpbmsgRG93biAgICAgICAgICAgICAgICAgICAgICAgTGlua2Rvd24KKyAgICAgICAgICAgICAgICAgICAgICAgIERpc2FibGUgcmVxdWVzdCAgICAgICAgICAgICAgICAgRGlzYWJsZQorICAgIEZhYnJpYyBMb2dvdXQ6ICAgICAgTGluayBzdGlsbCB1cCAgICA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aW5nIGZvciBDYXBhYmlsaXRpZXNGbGFncyBvZgorICogICAgICAgICAgICAgICAgICAgICAgSU9DIFBhZ2UgNi4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIERpc2FibGUgU01BUlQgUG9sbGluZyB0byBEZXZpY2VTZXR0aW5ncyBvZiBCSU9TCisgKiAgICAgICAgICAgICAgICAgICAgICBQYWdlIDEuCisgKiAgICAgICAgICAgICAgICAgICAgICBBZGRlZCBNdWx0aS1Qb3J0IERvbWFpbiBiaXQgZm9yIERpc2NvdmVyeVN0YXR1cyBmaWVsZAorICogICAgICAgICAgICAgICAgICAgICAgb2YgU0FTIElPIFVuaXQgUGFnZS4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIE11bHRpLVBvcnQgRG9tYWluIElsbGVnYWwgZmxhZyBmb3IgU0FTIElPIFVuaXQKKyAqICAgICAgICAgICAgICAgICAgICAgIFBhZ2UgMSBBZGRpdGlvbmFsQ29udHJvbEZsYWdzIGZpZWxkLgorICogIDA1LTI0LTA3ICAwMS4wNS4xNSAgQWRkZWQgSGlkZSBQaHlzaWNhbCBEaXNrcyB3aXRoIE5vbi1JbnRlZ3JhdGVkIFJBSUQKKyAqICAgICAgICAgICAgICAgICAgICAgIE1ldGFkYXRhIGJpdCB0byBNYW51ZmFjdHVyaW5nIFBhZ2UgNCBFeHRGbGFncyBmaWVsZC4KKyAqICAgICAgICAgICAgICAgICAgICAgIEFkZGVkIEludGVybmFsIENvbm5lY3RvciB0byBFbmQgRGV2aWNlIFByZXNlbnQgYml0IHRvCisgKiAgICAgICAgICAgICAgICAgICAgICBFeHBhbmRlciBQYWdlIDAgRmxhZ3MgZmllbGQuCisgKiAgICAgICAgICAgICAgICAgICAgICBGaXhlZCBkZWZpbmUgZm9yCisgKiAgICAgICAgICAgICAgICAgICAgICBNUElfU0FTX0VYUEFOREVSMV9ESVNDSU5GT19CQURfUEhZX0RJU0FCTEVELgogICogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgKi8KIApAQCAtNjM5LDcgKzY1NCw3IEBACiAgICAgVTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmZvU2l6ZTE7ICAgICAgICAgIC8qIDBCaCAqLwogICAgIFU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5xdWlyeVNpemU7ICAgICAgICAvKiAwQ2ggKi8KICAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWdzOyAgICAgICAgICAgICAgLyogMERoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDBFaCAqLworICAgIFUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0RmxhZ3M7ICAgICAgICAgICAvKiAwRWggKi8KICAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucXVpcnlEYXRhWzU2XTsgICAgLyogMTBoICovCiAgICAgVTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJU1ZvbHVtZVNldHRpbmdzOyAgIC8qIDQ4aCAqLwogICAgIFUzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSU1FVm9sdW1lU2V0dGluZ3M7ICAvKiA0Q2ggKi8KQEAgLTY1OCw3ICs2NzMsNyBAQAogfSBDT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzQsIE1QSV9QT0lOVEVSIFBUUl9DT05GSUdfUEFHRV9NQU5VRkFDVFVSSU5HXzQsCiAgIE1hbnVmYWN0dXJpbmdQYWdlNF90LCBNUElfUE9JTlRFUiBwTWFudWZhY3R1cmluZ1BhZ2U0X3Q7CiAKLSNkZWZpbmUgTVBJX01BTlVGQUNUVVJJTkc0X1BBR0VWRVJTSU9OICAgICAgICAgICAgICAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9NQU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DgpCiAjZGVmaW5lIE1QSV9CSU9TUEFHRTFfREVWU0VUX0RJU0FCTEVfUk1fTFVOICAgICAgICAgICAgICgweDAwMDAwMDA0KQogI2RlZmluZSBNUElfQklPU1BBR0UxX0RFVlNFVF9ESVNBQkxFX05PTl9STV9MVU4gICAgICAgICAoMHgwMDAwMDAwMikKQEAgLTIyODEsMTEgKzIzMDUsMTEgQEAKIHR5cGVkZWYgc3RydWN0IF9DT05GSUdfUEFHRV9SQUlEX1ZPTF8xCiB7CiAgICAgQ09ORklHX1BBR0VfSEVBREVSICAgICAgSGVhZGVyOyAgICAgICAgIC8qIDAwaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZUlEOyAgICAgICAvKiAwMWggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVCdXM7ICAgICAgLyogMDJoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lSU9DOyAgICAgIC8qIDAzaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMDsgICAgICAvKiAwNGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBHVUlEWzI0XTsgICAgICAgLyogMDVoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgVm9sdW1lSUQ7ICAgICAgIC8qIDA0aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFZvbHVtZUJ1czsgICAgICAvKiAwNWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICBWb2x1bWVJT0M7ICAgICAgLyogMDZoICovCisgICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQwOyAgICAgIC8qIDA3aCAqLworICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEdVSURbMjRdOyAgICAgICAvKiAwOGggKi8KICAgICBVOCAgICAgICAgICAgICAgICAgICAgICBOYW1lWzMyXTsgICAgICAgLyogMjBoICovCiAgICAgVTY0ICAgICAgIC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NyBAQAogLyogc2VlIG1waV9zYXMuaCBmb3IgdmFsdWVzIGZvciBTQVMgRXhwYW5kZXIgUGFnZSAxIEF0dGFjaGVkRGV2aWNlSW5mbyB2YWx1ZXMgKi8KIAogLyogdmFsdWVzIGZvciBTQVMgRXhwYW5kZXIgUGFnZSAxIERpc2NvdmVyeUluZm8gZmllbGQgKi8KLSNkZWZpbmUgTVBJX1NBU19FWFBBTkRFUjFfRElTQ0lORk9fQkFEX1BIWSBESVNBQkxFRCAgICAgKDB4MDQpCisjZGVmaW5lIE1QSV9TQVNfRVhQQU5ERVIxX0RJU0NJTkZPX0JBRF9QSFlfRElTQUJMRUQgICAgICgweDA0KQogI2RlZmluZSBNUElfU0FTX0VYUEFOREVSMV9ESVNDSU5GT19MSU5LX1NUQVRVU19DSEFOR0UgICAoMHgwMikKICNkZWZpbmUgTVBJX1NBU19FWFBBTkRFUjFfRElTQ0lORk9fTk9fUk9VVElOR19FTlRSSUVTICAgKDB4MDEpCiAKQEAgLTI4OTUsMTEgKzI5MjIsMTEgQEAKICAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdHRhY2hlZFBoeUlkZW50aWZpZXI7ICAvKiAxNmggKi8KICAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgICAgICAvKiAxN2ggKi8KICAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdHRhY2hlZERldmljZUluZm87ICAgICAvKiAxOGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9ncmFtbWVkTGlua1JhdGU7ICAgICAvKiAyMGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBId0xpbmtSYXRlOyAgICAgICAgICAgICAvKiAyMWggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFuZ2VDb3VudDsgICAgICAgICAgICAvKiAyMmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAvKiAyM2ggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlJbmZvOyAgICAgICAgICAgICAgICAvKiAyNGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQcm9ncmFtbWVkTGlua1JhdGU7ICAgICAvKiAxQ2ggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBId0xpbmtSYXRlOyAgICAgICAgICAgICAvKiAxRGggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFuZ2VDb3VudDsgICAgICAgICAgICAvKiAxRWggKi8KKyAgICBVOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnczsgICAgICAgICAgICAgICAgICAvKiAxRmggKi8KKyAgICBVMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaHlJbmZvOyAgICAgICAgICAgICAgICAvKiAyMGggKi8KIH0gQ09ORklHX1BBR0VfU0FTX1BIWV8wLCBNUElfUE9JTlRFUiBQVFJfQ09ORklHX1BBR0VfU0FTX1BIWV8wLAogICBTYXNQaHlQYWdlMF90LCBNUElfUE9JTlRFUiBwU2FzUGh5UGFnZTBfdDsKIApkaWZmIC0tZ2l0IGEvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX2hpc3RvcnkudHh0IGIvZHJpdmVycy9tZXNzYWdlL2Z1c2lvbi9sc2kvbXBpX2hpc3RvcnkudHh0CmluZGV4IGRkYzdhZTAuLmExZjQ3OTAgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvbWVzc2FnZS9mdXNpb24vbHNpL21waV9oaXN0b3J5LnR4dAorKysgYi9kcml2ZXJzL21lc3NhZ2UvZnVzaW9uL2xzaS9tcGlfaGlzdG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uMTIKKyBtcGlfaW9jLmggICAgICAgICAgICAgIDAxLjA1LjE0ICAgICAgICAgICAgMDEuMDUuMTMKKyBtcGlfY25mZy5oICAgICAgICAgICAgIDAxLjA1LjE1ICAgICAgICAgICAgMDEuMDUuMTQKKyBtcGlfaW5pdC5oICAgICAgICAgICAgIDAxLjA1LjA5ICAgICAgICAgICAgMDEuMDUuMDkKICBtcGlfdGFyZy5oICAgICAgICAgICAgIDAxLjA1LjA2ICAgICAgICAgICAgMDEuMDUuMDYKICBtcGlfZmMuaCAgICAgICAgICAgICAgIDAxLjA1LjAxICAgICAgICAgICAgMDEuMDUuMDEKICBtcGlfbGFuLmggICAgICAgICAgICAgIDAxLjA1LjAxICAgICAgICAgICAgMDEuMDUuMDEKLSBtcGlfcmFpZC5oICAgICAgICAgICAgIDAxLjA1LjAyICAgICAgICAgICAgMDEuMDUuMDIKKyBtcGlfcmFpZC5oICAgICAgICAgICAgIDAxLjA1LjAzICAgICAgICAgICAgMDEuMDUuMDMKICBtcGlfdG9vbC5oICAgICAgICAgICAgIDAxLjA1LjAzICAgICAgICAgICAgMDEuMDUuMDMKICBtcGlfaW5iLmggICAgICAgICAgICAgIDAxLjA1LjAxICAgICAgICAgICAgMDEuMDUuMDEKLSBtcGlfc2FzLmggICAgICAgICAgICAgIDAxLjA1LjA0ICAgICAgICAgICAgMDEuMDUuMDMKKyBtcGlfc2FzLmggICAgICAgICAgICAgIDAxLjA1LjA0ICAgICAgICAgICAgMDEuMDUuMDQKICBtcGlfdHlwZS5oICAgICAgICAgICAgIDAxLjA1LjAyICAgICAgICAgICAgMDEuMDUuMDIKLSBtcGlfaGlzdG9yeS50eHQgICAgICAgIDAxLjA1LjE0ICAgICAgICAgICAgMDEuMDUuMTMKKyBtcGlfaGlzdG9yeS50eHQgICAgICAgIDAxLjA1LjE0ICAgICAgICAgICAgMDEuMDUuMTQKIAogCiAgKiAgRGF0ZSAgICAgIFZlcnNpb24gICBEZXNjcmlwdGlvbgpAQCAtOTUs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KioqKioqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogSW5iYW5kIEJ1ZmZlciBQb3N0IFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfQlVGRkVSX1BPU1RfUkVRVUVTVAotewotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDBoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgQnVmZmVyQ291bnQ7ICAgICAgICAvKiAwMWggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBDaGFpbk9mZnNldDsgICAgICAgIC8qIDAyaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLwotICAgIFNHRV9UUkFOU19TSU1QTEVfVU5JT04gIFNHTDsgICAgICAgICAgICAgICAgLyogMTBoICovCi19IE1TR19JTkJBTkRfQlVG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QT0lOVEVSIFBUUl9XV05fSU5CQU5EX0ZPUk1BVCwKLSAgV3duSW5iYW5kRm9ybWF0LCBNUElfUE9JTlRFUiBwV3duSW5iYW5kRm9ybWF0OwotCi0KLS8qIEluYmFuZCBCdWZmZXIgUG9zdCByZXBseSBtZXNzYWdlICovCi0KLXR5cGVkZWYgc3RydWN0IF9NU0dfSU5CQU5EX0JVRkZFUl9QT1NUX1JFUExZCi17Ci0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLwotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBUcmFuc2Zlckxlbmd0aDsgICAgIC8qIDE0aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFRyYW5zYWN0aW9uQ29udGV4dDsgLyogMThoICovCi0gICAgV1dOX0lOQkFORF9GT1JNQVQgICAgICAgV3duOyAgICAgICAgICAgICAgICAvKiAxQ2ggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NJZGVudGlmaWVyWzRdOyAgIC8qIDJDaCAqLwotfSBNU0dfSU5CQU5EX0JVRkZFUl9QT1NUX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0lOQkFORF9CVUZGRVJfUE9TVF9SRVBMWSwKLSAgTXBpSW5iYW5kQnVmZmVyUG9zdFJlcGx5X3QsIE1QSV9QT0lOVEVSIHBNcGlJbmJhbmRCdWZmZXJQb3N0UmVwbHlfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEluYmFuZCBTZW5kIFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXR5cGVkZWYgc3RydWN0IF9NU0dfSU5CQU5EX1NFTkRfUkVRVUVTVAotewotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDBoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgQ2hhaW5PZmZzZXQ7ICAgICAgICAvKiAwMmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLwotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwNmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAvKiAwQ2ggKi8KLSAgICBXV05fSU5CQU5EX0ZPUk1BVCAgICAgICBXd247ICAgICAgICAgICAgICAgIC8qIDEwaCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNTsgICAgICAgICAgLyogMjBoICovCi0gICAgU0dFX0lPX1VOSU9OICAgICAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiAyNGggKi8KLX0gTVNHX0lOQkFORF9TRU5EX1JFUVVFU1QsIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX1NFTkRfUkVRVUVTVCwKLSAgTXBpSW5iYW5kU2VuZFJlcXVlc3RfdCAsIE1QSV9QT0lOVEVSIHBNcGlJbmJhbmRTZW5kUmVxdWVzdF90OwotCi0KLS8qIEluYmFuZCBTZW5kIHJlcGx5IG1lc3NhZ2UgKi8KLQotdHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfU0VORF9SRVBMWQotewotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMTsgICAgICAgICAgLyogMDBoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAvKiAwMmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLwotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwNmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAvKiAwQ2ggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgIC8qIDBFaCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgLyogMTBoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgUmVzcG9uc2VMZW5ndGg7ICAgICAvKiAxNGggKi8KLX0gTVNHX0lOQkFORF9TRU5EX1JFUExZLCBNUElfUE9JTlRFUiBQVFJfTVNHX0lOQkFORF9TRU5EX1JFUExZLAotICBNcGlJbmJhbmRTZW5kUmVwbHlfdCwgTVBJX1BPSU5URVIgcE1waUluYmFuZFNlbmRSZXBseV90OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogSW5iYW5kIFJlc3BvbnNlIFJlcXVlc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfUlNQX1JFUVVFU1QKLXsKLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCi0gICAgV1dOX0lOQkFORF9GT1JNQVQgICAgICAgV3duOyAgICAgICAgICAgICAgICAvKiAxMGggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBJT0NJZGVudGlmaWVyWzRdOyAgIC8qIDIwaCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc3BvbnNlTGVuZ3RoOyAgICAgLyogMzBoICovCi0gICAgU0dFX0lPX1VOSU9OICAgICAgICAgICAgU0dMOyAgICAgICAgICAgICAgICAvKiAzNGggKi8KLX0gTVNHX0lOQkFORF9SU1BfUkVRVUVTVCwgTVBJX1BPSU5URVIgUFRSX01TR19JTkJBTkRfUlNQX1JFUVVFU1QsCi0gIE1waUluYmFuZFJzcFJlcXVlc3RfdCAsIE1QSV9QT0lOVEVSIHBNcGlJbmJhbmRSc3BSZXF1ZXN0X3Q7Ci0KLQotLyogSW5iYW5kIFJlc3BvbnNlIHJlcGx5IG1lc3NhZ2UgKi8KLQotdHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfUlNQX1JFUExZCi17Ci0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dMZW5ndGg7ICAgICAgICAgIC8qIDAyaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEZ1bmN0aW9uOyAgICAgICAgICAgLyogMDNoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQyOyAgICAgICAgICAvKiAwNGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDM7ICAgICAgICAgIC8qIDA2aCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIE1zZ0ZsYWdzOyAgICAgICAgICAgLyogMDdoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgTXNnQ29udGV4dDsgICAgICAgICAvKiAwOGggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDQ7ICAgICAgICAgIC8qIDBDaCAqLwotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIElPQ1N0YXR1czsgICAgICAgICAgLyogMEVoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgSU9DTG9nSW5mbzsgICAgICAgICAvKiAxMGggKi8KLX0gTVNHX0lOQkFORF9SU1BfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX1JTUF9SRVBMWSwKLSAgTXBpSW5iYW5kUnNwUmVwbHlfdCwgTVBJX1BPSU5URVIgcE1waUluYmFuZFJzcFJlcGx5X3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBJbmJhbmQgQWJvcnQgUmVxdWVzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdCBfTVNHX0lOQkFORF9BQk9SVF9SRVFVRVNUCi17Ci0gICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQxOyAgICAgICAgICAvKiAwMGggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBBYm9ydFR5cGU7ICAgICAgICAgIC8qIDAxaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIENoYWluT2Zmc2V0OyAgICAgICAgLyogMDJoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgRnVuY3Rpb247ICAgICAgICAgICAvKiAwM2ggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDI7ICAgICAgICAgIC8qIDA0aCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMzsgICAgICAgICAgLyogMDZoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnRmxhZ3M7ICAgICAgICAgICAvKiAwN2ggKi8KLSAgICBVMzIgICAgICAgICAgICAgICAgICAgICBNc2dDb250ZXh0OyAgICAgICAgIC8qIDA4aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkNDsgICAgICAgICAgLyogMENoICovCi0gICAgVTMyICAgICAgICAgICAgICAgICAgICAgQ29udGV4dFRvQWJvcnQ7ICAgICAvKiAxMGggKi8KLX0gTVNHX0lOQkFORF9BQk9SVF9SRVFVRVNULCBNUElfUE9JTlRFUiBQVFJfTVNHX0lOQkFORF9BQk9SVF9SRVFVRVNULAotICBNcGlJbmJhbmRBYm9ydFJlcXVlc3RfdCAsIE1QSV9QT0lOVEVSIHBNcGlJbmJhbmRBYm9ydFJlcXVlc3RfdDsKLQotI2RlZmluZSBNUElfSU5CQU5EX0FCT1JUX1RZUEVfQUxMX0JVRkZFUlMgICAgICAgKDB4MDApCi0jZGVmaW5lIE1QSV9JTkJBTkRfQUJPUlRfVFlQRV9FWEFDVF9CVUZGRVIgICAgICAoMHgwMSkKLSNkZWZpbmUgTVBJX0lOQkFORF9BQk9SVF9UWVBFX1NFTkRfUkVRVUVTVCAgICAgICgweDAyKQotI2RlZmluZSBNUElfSU5CQU5EX0FCT1JUX1RZUEVfUkVTUE9OU0VfUkVRVUVTVCAgKDB4MDMpCi0KLQotLyogSW5iYW5kIEFib3J0IHJlcGx5IG1lc3NhZ2UgKi8KLQotdHlwZWRlZiBzdHJ1Y3QgX01TR19JTkJBTkRfQUJPUlRfUkVQTFkKLXsKLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBSZXNlcnZlZDE7ICAgICAgICAgIC8qIDAwaCAqLwotICAgIFU4ICAgICAgICAgICAgICAgICAgICAgIEFib3J0VHlwZTsgICAgICAgICAgLyogMDFoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgTXNnTGVuZ3RoOyAgICAgICAgICAvKiAwMmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBGdW5jdGlvbjsgICAgICAgICAgIC8qIDAzaCAqLwotICAgIFUxNiAgICAgICAgICAgICAgICAgICAgIFJlc2VydmVkMjsgICAgICAgICAgLyogMDRoICovCi0gICAgVTggICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQzOyAgICAgICAgICAvKiAwNmggKi8KLSAgICBVOCAgICAgICAgICAgICAgICAgICAgICBNc2dGbGFnczsgICAgICAgICAgIC8qIDA3aCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIE1zZ0NvbnRleHQ7ICAgICAgICAgLyogMDhoICovCi0gICAgVTE2ICAgICAgICAgICAgICAgICAgICAgUmVzZXJ2ZWQ0OyAgICAgICAgICAvKiAwQ2ggKi8KLSAgICBVMTYgICAgICAgICAgICAgICAgICAgICBJT0NTdGF0dXM7ICAgICAgICAgIC8qIDBFaCAqLwotICAgIFUzMiAgICAgICAgICAgICAgICAgICAgIElPQ0xvZ0luZm87ICAgICAgICAgLyogMTBoICovCi19IE1TR19JTkJBTkRfQUJPUlRfUkVQTFksIE1QSV9QT0lOVEVSIFBUUl9NU0dfSU5CQU5EX0FCT1JUX1JFUEx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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotIEZ1bmN0aW9uIG5hbWUgIDogYWJvcnRfU0NCCi0gRGVzY3JpcHRpb24gICAgOiBBYm9ydCBhIHF1ZXVlZCBjb21tYW5kLgotCSAgICAgICAgICAgICAgICAgKGNvbW1hbmRzIHRoYXQgYXJlIG9uIHRoZSBidXMgY2FuJ3QgYmUgYWJvcnRlZCBlYXNpbHkpCi0gSW5wdXQgICAgICAgICAgOiBwSENCICAtICAgICAgIFBvaW50ZXIgdG8gaG9zdCBhZGFwdGVyIHN0cnVjdHVyZQotIE91dHB1dCAgICAgICAgIDogTm9uZS4KLSBSZXR1cm4gICAgICAgICA6IHBTUkIgIC0gICAgICAgUG9pbnRlciB0byBTQ1NJIHJlcXVlc3QgYmxvY2suCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBpbnQgYWJvcnRfU0NCKE9SQ19IQ1MgKiBoY3NwLCBPUkNfU0NCICogcFNjYikKKy8qKgorICoJb3JjaGlkX2Fib3J0X3NjYgktCWFib3J0IGEgY29tbWFuZAorICoKKyAqCUFib3J0IGEgcXVldWVkIGNvbW1hbmQgdGhhdCBoYXMgYmVlbiBwYXNzZWQgdG8gdGhlIGZpcm13YXJlIGxheWVyCisgKglpZiBwb3NzaWJsZS4gVGhpcyBpcyBhbGwgaGFuZGxlZCBieSB0aGUgZmlybXdhcmUuIFdlIGFrcyB0aGUgZmlybXdhcmUKKyAqCWFuZCBpdCBlaXRoZXIgYWJvcnRzIHRoZSBjb21tYW5kIG9yIGZhaWxzCisgKi8KKworc3RhdGljIGludCBvcmNoaWRfYWJvcnRfc2NiKHN0cnVjdCBvcmNfaG9zdCAqIGhvc3QsIHN0cnVjdCBvcmNfc2NiICogc2NiKQogewotCXVuc2lnbmVkIGNoYX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kYXRhKSA9PSAwKQkvKiBXYWl0IEhESSBzZXQgICAqLwogCQlyZXR1cm4gMDsKLQliU3RhdHVzID0gT1JDX1JEKGhjc3AtPkhDU19CYXNlLCBPUkNfSERBVEEpOwotCU9SQ19XUihoY3NwLT5IQ1NfQmFzZSArIE9SQ19IU1RVUywgYkRhdGEpOwkvKiBDbGVhciBIREkgICAgKi8KKwlzdGF0dXMgPSBpbmIoaG9zdC0+YmFzZSArIE9SQ19IREFUQSk7CisJb3V0YihkYXRhLCBob3N0LT5iYXNlICsgT1JDX0hTVFVTKTsJLyogQ2xlYXIgSERJICAgICovCiAKLQlpZiAoYlN0YXR1cyA9PSAxKQkvKiAwIC0gU3VjY2Vzc2Z1bGx5ICAgICAgICAgICAgICAgKi8KKwlpZiAoc3RhdHVzID09IDEpCS8qIDAgLSBTdWNjZXNzZnVsbHkgICAgICAgICAgICAgICAqLwogCQlyZXR1cm4gMDsJLyogMSAtIEZhaWwgICAgICAgICAgICAgICAgICAgICAqLwogCXJldHVybiAxOwogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSBGdW5jdGlvbiBuYW1lICA6IGluaWExMDBfYWJvcnQKLSBEZXNjcmlwdGlvbiAgICA6IEFib3J0IGEgcXVldWVkIGNvbW1hbmQuCi0JICAgICAgICAgICAgICAgICAoY29tbWFuZHMgdGhhdCBhcmUgb24gdGhlIGJ1cyBjYW4ndCBiZSBhYm9ydGVkIGVhc2lseSkKLSBJbnB1dCAgICAgICAgICA6IHBIQ0IgIC0gICAgICAgUG9pbnRlciB0byBob3N0IGFkYXB0ZXIgc3RydWN0dXJlCi0gT3V0cHV0ICAgICAgICAgOiBOb25lLgotIFJldHVybiAgICAgICAgIDogcFNSQiAgLSAgICAgICBQb2ludGVyIHRvIFNDU0kgcmVxdWVzdCBibG9jay4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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2ItPmNkYlswXSwgJmNtZC0+Y21uZCwgc2NiLT5jZGJfbGVuKTsKIH0KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gRnVuY3Rpb24gbmFtZSAgOiBpbmlhMTAwX3F1ZXVlCi0gRGVzY3JpcHRpb24gICAgOiBRdWV1ZSBhIGNvbW1hbmQgYW5kIHNldHVwIGludGVycnVwdHMgZm9yIGEgZnJlZSBidXMuCi0gSW5wdXQgICAgICAgICAgOiBwSENCICAtICAgICAgIFBvaW50ZXIgdG8gaG9zdCBhZGFwdGVyIHN0cnVjdHVyZQotIE91dHB1dCAgICAgICAgIDogTm9uZS4KLSBSZXR1cm4gICAgICAgICA6IHBTUkIgIC0gICAgICAgUG9pbnRlciB0byBTQ1NJIHJlcXVlc3QgYmxvY2suCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBpbnQgaW5pYTEwMF9xdWV1ZShzdHJ1Y3Qgc2NzaV9jbW5kICogU0NwbnQsIHZvaWQgKCpkb25lKSAoc3RydWN0IHNjc2lfY21uZCAqKSkKLXsKLQlyZWdpc3RlciBPUkNfU0NCICpwU0NCOwotCU9SQ19IQ1MgKnBIQ0I7CQkvKiBQb2ludCB0byBIb3N0IGFkYXB0ZXIgY29udHJvbCBibG9jayAqLworLyoqCisgKglpbmlhMTAwX3F1ZXVlCQktCXF1ZXVlIGNvbW1hbmQgd2l0aCBob3N0CisgKglAY21kOiBDb21tYW5kIGJsb2NrCisgKglAZG9uZTogQ29tcGxldGlvbiBmdW5jdGlvbgorICoKKyAqCUNhbGxlZCBieSB0aGUgbWlkIGxheWVyIHRvIHF1ZXVlIGEgY29tbWFuZC4gUHJvY2VzcyB0aGUgY29tbWFuZAorICoJYmxvY2ssIGJ1aWxkIHRoZSBob3N0IHNw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gICAgICovCisJcmV0dXJuIDA7CiB9CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogIEZ1bmN0aW9uIG5hbWUgIDogaW5pYTEwMF9hYm9ydAogIERlc2NyaXB0aW9uICAgIDogQWJvcnQgYSBxdWV1ZWQgY29tbWFuZC4KIAkgICAgICAgICAgICAgICAgIChjb21tYW5kcyB0aGF0IGFyZSBvbiB0aGUgYnVzIGNhbid0IGJlIGFib3J0ZWQgZWFzaWx5KQotIElucHV0ICAgICAgICAgIDogcEhDQiAgLSAgICAgICBQb2ludGVyIHRvIGhvc3QgYWRhcHRlciBzdHJ1Y3R1cmUKKyBJbnB1dCAgICAgICAgICA6IGhvc3QgIC0gICAgICAgUG9pbnRlciB0byBob3N0IGFkYXB0ZXIgc3RydWN0dXJlCiAgT3V0cHV0ICAgICAgICAgOiBOb25lLgogIFJldHVybiAgICAgICAgIDogcFNSQiAgLSAgICAgICBQb2ludGVyIHRvIFNDU0kgcmVxdWVzdCBibG9jay4KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludCBpbmlhMTAwX2Fib3J0KHN0cnVjdCBzY3NpX2NtbmQgKiBTQ3BudCkKK3N0YXRpYyBpbnQgaW5pYTEwMF9hYm9ydChzdHJ1Y3Qgc2NzaV9jbW5kICogY21kKQogewotCU9SQ19IQ1MgKmhjc3A7CisJc3RydWN0IG9yY19ob3N0ICpob3N0OwogCi0JaGNzcCA9IChPUkNfSENTICopIFNDcG50LT5kZXZpY2UtPmhvc3QtPmhvc3RkYXRhOwotCXJldHVybiBvcmNfYWJvcnRfc3JiKGhjc3AsIFNDcG50KTsKKwlob3N0ID0gKHN0cnVjdCBvcmNfaG9zdCAqKSBjbWQtPmRldmljZS0+aG9zdC0+aG9zdGRhdGE7CisJcmV0dXJuIGluaWExMDBfYWJvcnRfY21kKGhvc3QsIGNtZCk7CiB9CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogIEZ1bmN0aW9uIG5hbWUgIDogaW5pYTEwMF9yZXNldAogIERlc2NyaXB0aW9uICAgIDogUmVzZXQgcmVnaXN0ZXJzLCByZXNldCBhIGhhbmdpbmcgYnVzIGFuZAogICAgICAgICAgICAgICAgICAga2lsbCBhY3RpdmUgYW5kIGRpc2Nvbm5lY3RlZCBjb21tYW5kcyBmb3IgdGFyZ2V0IHcvbyBzb2Z0IHJlc2V0Ci0gSW5wdXQgICAgICAgICAgOiBwSENCICAtICAgICAgIFBvaW50ZXIgdG8gaG9zdCBhZGFwdGVyIHN0cnVjdHVyZQorIElucHV0ICAgICAgICAgIDogaG9zdCAgLSAgICAgICBQb2ludGVyIHRvIGhvc3QgYWRhcHRlciBzdHJ1Y3R1cmUKICBPdXRwdXQgICAgICAgICA6IE5vbmUuCiAgUmV0dXJuICAgICAgICAgOiBwU1JCICAtICAgICAgIFBvaW50ZXIgdG8gU0NTSSByZXF1ZXN0IGJsb2NrLgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgaW50IGluaWExMDBfYnVzX3Jlc2V0KHN0cnVjdCBzY3NpX2NtbmQgKiBTQ3BudCkKK3N0YXRpYyBpbnQgaW5pYTEwMF9idXNfcmVzZXQoc3RydWN0IHNjc2lfY21uZCAqIGNtZCkKIHsJCQkJLyogSSBuZWVkIEhvc3QgQ29udHJvbCBCbG9jayBJbmZvcm1hdGlvbiAqLwotCU9SQ19IQ1MgKnBIQ0I7Ci0JcEhDQiA9IChPUkNfSENTICopIFNDcG50LT5kZXZpY2UtPmhvc3QtPmhvc3RkYXRhOwotCXJldHVybiBvcmNfcmVzZXRfc2NzaV9idXMocEhDQik7CisJc3RydWN0IG9yY19ob3N0ICpob3N0OworCWhvc3QgPSAoc3RydWN0IG9yY19ob3N0ICopIGNtZC0+ZGV2aWNlLT5ob3N0LT5ob3N0ZGF0YTsKKwlyZXR1cm4gb3JjX3Jlc2V0X3Njc2lfYnVzKGhvc3QpOwogfQogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICBGdW5jdGlvbiBuYW1lICA6IGluaWExMDBfZGV2aWNlX3Jlc2V0CiAgRGVzY3JpcHRpb24gICAgOiBSZXNldCB0aGUgZGV2aWNlCi0gSW5wdXQgICAgICAgICAgOiBwSENCICAtICAgICAgIFBvaW50ZXIgdG8gaG9zdCBhZGFwdGVyIHN0cnVjdHVyZQorIElucHV0ICAgICAgICAgIDogaG9zdCAgLSAgICAgICBQb2ludGVyIHRvIGhvc3QgYWRhcHRlciBzdHJ1Y3R1cmUKICBPdXRwdXQgICAgICAgICA6IE5vbmUuCiAgUmV0dXJuICAgICAgICAgOiBwU1JCICAtICAgICAgIFBvaW50ZXIgdG8gU0NTSSByZXF1ZXN0IGJsb2NrLgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgaW50IGluaWExMDBfZGV2aWNlX3Jlc2V0KHN0cnVjdCBzY3NpX2NtbmQgKiBTQ3BudCkKK3N0YXRpYyBpbnQgaW5pYTEwMF9kZXZpY2VfcmVzZXQoc3RydWN0IHNjc2lfY21uZCAqIGNtZCkKIHsJCQkJLyogSSBuZWVkIEhvc3QgQ29udHJvbCBCbG9jayBJbmZvcm1hdGlvbiAqLwotCU9SQ19IQ1MgKnBIQ0I7Ci0JcEhDQiA9IChPUkNfSENTICopIFNDcG50LT5kZXZpY2UtPmhvc3QtPmhvc3RkYXRhOwotCXJldHVybiBvcmNfZGV2aWNlX3Jlc2V0KHBIQ0IsIFNDcG50LCBzY21kX2lkKFNDcG50KSk7CisJc3RydWN0IG9yY19ob3N0ICpob3N0OworCWhvc3QgPSAoc3RydWN0IG9yY19ob3N0ICopIGNtZC0+ZGV2aWNlLT5ob3N0LT5ob3N0ZGF0YTsKKwlyZXR1cm4gb3JjX2RldmljZV9yZXNldChob3N0LCBjbWQsIHNjbWRfaWQoY21kKSk7CiAKIH0KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gRnVuY3Rpb24gbmFtZSAgOiBpbmlhMTAwU0NCUG9zdAotIERlc2NyaXB0aW9uICAgIDogVGhpcyBpcyBjYWxsYmFjayByb3V0aW5lIGJlIGNhbGxlZCB3aGVuIG9yYyBmaW5pc2ggb25lCi0JCQlTQ1NJIGNvbW1hbmQuCi0gSW5wdXQgICAgICAgICAgOiBwSENCICAtICAgICAgIFBvaW50ZXIgdG8gaG9zdCBhZGFwdGVyIGNvbnRyb2wgYmxvY2suCi0JCSAgcFNDQiAgLSAgICAgICBQb2ludGVyIHRvIFNDU0kgY29udHJvbCBibG9jay4KLSBPdXRwdXQgICAgICAgICA6IE5vbmUuCi0gUmV0dXJuICAgICAgICAgOiBOb25lLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCBpbmlhMTAwU0NCUG9zdChCWVRFICogcEhjYiwgQllURSAqIHBTY2IpCi17Ci0Jc3RydWN0IHNjc2lfY21uZCAqcFNSQjsJLyogUG9pbnRlciB0byBTQ1NJIHJlcXVlc3QgYmxvY2sgKi8KLQlPUkNfSENTICpwSENCOwotCU9SQ19TQ0IgKnBTQ0I7Ci0JRVNDQiAqcEVTY2I7CisvKioKKyAqCWluaWExMDBfc2NiX2hhbmRsZXIJLQlpbnRlcnJ1cHQgY2F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TR19FTlRSWV07CS8qMCBTdGFydCBvZiBTRyBsaXN0ICAgICAgICAgICAgICAqLworCXN0cnVjdCBzY3NpX2NtbmQgKnNyYjsJLyo1MCBTUkIgUG9pbnRlciAqLworfTsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCVNDU0kgQ29udHJvbCBCbG9jawotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdHlwZWRlZiBzdHJ1Y3Qgb3JjX3NjYiB7CS8qIFNjc2lfQ3RybF9CbGsgICAgICAgICAgICAgICAgKi8KLQlVQllURSBTQ0JfT3Bjb2RlOwkvKjAwIFNDQiBjb21tYW5kIGNvZGUmcmVzaWR1YWwgICovCi0JVUJZVEUgU0NCX0ZsYWdzOwkvKjAxIFNDQiBGbGFncyAgICAgICAgICAgICAgICAgICovCi0JVUJZVEUgU0NCX1RhcmdldDsJLyowMiBUYXJnZXQgSWQgICAgICAgICAgICAgICAgICAqLwotCVVCWVRFIFNDQl9MdW47CQkvKjAzIEx1biAgICAgICAgICAgICAgICAgICAgICAgICovCi0JVTMyIFNDQl9SZXNlcnZlZDA7CS8qMDQgUmVzZXJ2ZWQgZm9yIE9SQ0hJRCBtdXN0IDAgKi8KLQlVMzIgU0NCX1hmZXJMZW47CS8qMDggRGF0YSBUcmFuc2ZlciBMZW5ndGggICAgICAgKi8KLQlVMzIgU0NCX1Jlc2VydmVkMTsJLyowQyBSZXNlcnZlZCBmb3IgT1JDSElEIG11c3QgMCAqLwotCVUzMiBTQ0JfU0dMZW47CQkvKjEwIFNHIGxpc3QgIyAqIDggICAgICAgICAgICAgICovCi0JVTMyIFNDQl9TR1BBZGRyOwkvKjE0IFNHIExpc3QgQnVmIHBoeXNpY2FsIEFkZHIgICovCi0JVTMyIFNDQl9TR1BBZGRySGlnaDsJLyoxOCBTRyBC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5dGVzCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3Qgb3JjX3NjYiB7CS8qIFNjc2lfQ3RybF9CbGsgICAgICAgICAgICAgICAgKi8KKwl1OCBvcGNvZGU7CS8qMDAgU0NCIGNvbW1hbmQgY29kZSZyZXNpZHVhbCAgKi8KKwl1OCBmbGFnczsJLyowMSBTQ0IgRmxhZ3MgICAgICAgICAgICAgICAgICAqLworCXU4IHRhcmdldDsJLyowMiBUYXJnZXQgSWQgICAgICAgICAgICAgICAgICAqLworCXU4IGx1bjsJCS8qMDMgTHVuICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1MzIgcmVzZXJ2ZWQwOwkvKjA0IFJlc2VydmVkIGZvciBPUkNISUQgbXVzdCAwICovCisJdTMyIHhmZXJsZW47CS8qMDggRGF0YSBUcmFuc2ZlciBMZW5ndGggICAgICAgKi8KKwl1MzIgcmVzZXJ2ZWQxOwkvKjBDIFJlc2VydmVkIGZvciBPUkNISUQgbXVzdCAwICovCisJdTMyIHNnX2xlbjsJCS8qMTAgU0cgbGlzdCAjICogOCAgICAgICAgICAgICAgKi8KKwl1MzIgc2dfYWRkcjsJLyoxNCBTRyBMaXN0IEJ1ZiBwaHlzaWNhbCBBZGRyICAqLworCXUzMiBzZ19hZGRyaGlnaDsJLyoxOCBTRyBCdWZmZXIgaGlnaCBwaHlzaWNhbCBBZGRyICovCisJdTggaGFzdGF0OwkvKjFDIEhvc3QgU3RhdHVzICAgICAgICAgICAgICAgICovCisJdTggdGFzdGF0OwkvKjFEIFRhcmdldCBTdGF0dXMgICAgICAgICAgICAgICovCisJdTggc3RhdHVzOwkvKjFFIFNDQiBzdGF0dXMgICAgICAgICAgICAgICAgICovCisJdTggbGluazsJCS8qMUYgTGluayBwb2ludGVyLCBkZWZhdWx0IDB4RkYgKi8KKwl1OCBzZW5zZV9sZW47CS8qMjAgU2Vuc2UgQW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QVNEOwkvKiA2ICovCi0JVUJZVEUgVENTX0RydlNDU0k7CS8qIDcgKi8KLQlVQllURSBUQ1NfRHJ2SGVhZDsJLyogOCAqLwotCVVXT1JEIFRDU19EcnZGbGFnczsJLyogNCAqLwotCVVCWVRFIFRDU19EcnZTZWN0b3I7CS8qIDcgKi8KLX0gT1JDX1RDUzsKK3N0cnVjdCBvcmNfdGFyZ2V0IHsKKwl1OCBUQ1NfRHJ2REFTRDsJLyogNiAqLworCXU4IFRDU19EcnZTQ1NJOwkvKiA3ICovCisJdTggVENTX0RydkhlYWQ7CS8qIDggKi8KKwl1MTYgVENTX0RydkZsYWdzOwkvKiA0ICovCisJdTggVENTX0RydlNlY3RvcjsJLyogNyAqLworfTsKIAogLyogQml0IERlZmluaXRpb24gZm9yIFRDRl9EcnZGbGFncyAqLwogI2RlZmluZQlUQ1NfREZfTk9EQVNEX1NVUFQJMHgyMAkvKiBTdXBwcmVzcyBPUy8yIERBU0QgTWdyIHN1cHBvcnQgKi8KQEAgLTI1NSwzMiArMjI2LDIzIEBACiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAgICAgICAgICAgICAgSG9zdCBBZGFwdGVyIENvbnRyb2wgU3RydWN0dXJlCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIHN0cnVjdCBPUkNfSGFfQ3RybF9TdHJ1YyB7Ci0JVVNIT1JUIEhDU19CYXNlOwkvKiAwMCAqLwotCVVCWVRFIEhDU19JbmRleDsJLyogMDIgKi8KLQlVQllURSBIQ1NfSW50cjsJCS8qIDA0ICovCi0JVUJZVEUgSENTX1NDU0lfSUQ7CS8qIDA2ICAgIEgvQSBTQ1NJIElEICovCi0JVUJZVEUgSENTX0JJT1M7CQkvKiAwNyAgICBCSU9TIGNvbmZpZ3VyYXRpb24gKi8K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SArMjYzLDc5IEBACiAjZGVmaW5lCUhDU19BRl9ESVNBQkxFX1JFU0VUCTB4MTAJLyogQWRhcHRlciBkaXNhYmxlIHJlc2V0ICAqLwogI2RlZmluZQlIQ1NfQUZfRElTQUJMRV9BRFBUCTB4ODAJLyogQWRhcHRlciBkaXNhYmxlICAgICAgICAgICAgICAgICovCiAKLXR5cGVkZWYgc3RydWN0IF9OVlJBTSB7CitzdHJ1Y3Qgb3JjX252cmFtIHsKIC8qLS0tLS0tLS0tLWhlYWRlciAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBVQ0hBUiBTdWJWZW5kb3JJRDA7ICAgICAvKiAwMCAtIFN1YiBWZW5kb3IgSUQgICAgICAgICAgICovCi0gICAgICAgIFVDSEFSIFN1YlZlbmRvcklEMTsgICAgIC8qIDAwIC0gU3ViIFZlbmRvciBJRCAgICAgICAgICAgKi8KLSAgICAgICAgVUNIQVIgU3ViU3lzSUQwOyAgICAgICAgLyogMDIgLSBTdWIgU3lzdGVtIElEICAgICAgICAgICAqLwotICAgICAgICBVQ0hBUiBTdWJTeXNJRDE7ICAgICAgICAvKiAwMiAtIFN1YiBTeXN0ZW0gSUQgICAgICAgICAgICovCi0gICAgICAgIFVDSEFSIFN1YkNsYXNzOyAgICAgICAgIC8qIDA0IC0gU3ViIENsYXNzICAgICAgICAgICAgICAgKi8KLSAgICAgICAgVUNIQVIgVmVuZG9ySUQwOyAgICAgICAgLyogMDUgLSBWZW5kb3IgSUQgICAgICAgICAgICAgICAqLwotICAgICAgICBVQ0hBUiBWZW5kb3JJRDE7ICAgICAgICAvKiAwNSAtIFZlbmRvciBJRCAgICAgICAgICAgICAgICovCi0gICAgICAgIFVDSEFSIERldmljZUlEMDsgICAgICAgIC8qIDA3IC0gRGV2aWNlIElEICAgICAgICAgICAgICAgKi8KLSAgICAgICAgVUNIQVIgRGV2aWNlSUQxOyAgICAgICAgLyogMDcgLSBEZXZpY2UgSUQgICAgICAgICAgICAgICAqLwotICAgICAgICBVQ0hBUiBSZXNlcnZlZDBbMl07ICAgICAvKiAwOSAtIFJlc2VydmVkICAgICAgICAgICAgICAgICovCi0gICAgICAgIFVDSEFSIFJldmlzaW9uOyAgICAgICAgIC8qIDBCIC0gUmV2aXNpb24gb2YgZGF0YSBzdHJ1Y3R1cmUgKi8KKyAgICAgICAgdTggU3ViVmVuZG9ySUQwOyAgICAgLyogMDAgLSBTdWIgVmVuZG9yIElEICAgICAgICAgICAqLworICAgICAgICB1OCBTdWJWZW5kb3JJRDE7ICAgICAvKiAwMCAtIFN1YiBWZW5kb3IgSUQgICAgICAgICAgICovCisgICAgICAgIHU4IFN1YlN5c0lEMDsgICAgICAgIC8qIDAyIC0gU3ViIFN5c3RlbSBJRCAgICAgICAgICAgKi8KKyAgICAgICAgdTggU3ViU3lzSUQxOyAgICAgICAgLyogMDIgLSBTdWIgU3lzdGVtIElEICAgICAgICAgICAqLworICAgICAgICB1OCBTdWJDbGFzczsgICAgICAgICAvKiAwNCAtIFN1YiBDbGFzcyAgICAgICAgICAgICAgICovCisgICAgICAgIHU4IFZlbmRvcklEMDsgICAgICAgIC8qIDA1IC0gVmVuZG9yIElEICAgICAgICAgICAgICAgKi8KKyAgICAgICAgdTggVmVuZG9ySUQxOyAgICAgICAgLyogMDUgLSBWZW5kb3IgSUQgICAgICAgICAgICAgICAqLworICAgICAgICB1OCBEZXZpY2VJRDA7ICAgICAgICAvKiAwNyAtIERldmljZSBJRCAgICAgICAgICAgICAgICovCisgICAgICAgIHU4IERldmljZUlEMTsgICAgICAgIC8qIDA3IC0gRGV2aWNlIElEICAgICAgICAgICAgICAgKi8KKyAgICAgICAgdTggUmVzZXJ2ZWQwWzJdOyAgICAgLyogMDkgLSBSZXNlcnZlZCAgICAgICAgICAgICAgICAqLworICAgICAgICB1OCByZXZpc2lvbjsgICAgICAgICAvKiAwQiAtIHJldmlzaW9uIG9mIGRhdGEgc3RydWN0dXJlICovCiAgICAgICAgIC8qIC0tLS1Ib3N0IEFkYXB0ZXIgU3RydWN0dXJlIC0tLS0gKi8KLSAgICAgICAgVUNIQVIgTnVtT2ZDaDsgICAgICAgICAgLyogMEMgLSBOdW1iZXIgb2YgU0NTSSBjaGFubmVsICAqLwotICAgICAgICBVQ0hBUiBCSU9TQ29uZmlnMTsgICAgICAvKiAwRCAtIEJJT1MgY29uZmlndXJhdGlvbiAxICAgICovCi0gICAgICAgIFVDSEFSIEJJT1NDb25maWcyOyAgICAgIC8qIDBFIC0gQklPUyBib290IGNoYW5uZWwmdGFyZ2V0IElEICovCi0gICAgICAgIFVDSEFSIEJJT1NDb25maWczOyAgICAgIC8qIDBGIC0gQklPUyBjb25maWd1cmF0aW9uIDMgICAgKi8KKyAgICAgICAgdTggTnVtT2ZDaDsgICAgICAgICAgLyogMEMgLSBOdW1iZXIgb2YgU0NTSSBjaGFubmVsICAqLworICAgICAgICB1OCBCSU9TQ29uZmlnMTsgICAgICAvKiAwRCAtIEJJT1MgY29uZmlndXJhdGlvbiAxICAgICovCisgICAgICAgIHU4IEJJT1NDb25maWcyOyAgICAgIC8qIDBFIC0gQklPUyBib290IGNoYW5uZWwmdGFyZ2V0IElEICovCisgICAgICAgIHU4IEJJT1NDb25maWczOyAgICAgIC8qIDBGIC0gQklPUyBjb25maWd1cmF0aW9uIDMgICAgKi8KICAgICAgICAgLyogLS0tLVNDU0kgY2hhbm5lbCBTdHJ1Y3R1cmUgLS0tLSAqLwogICAgICAgICAvKiBmcm9tICJDVFJMLUkgU0NTSSBIb3N0IEFkYXB0ZXIgU2V0VXAgbWVudSAiICAqLwotICAgICAgICBVQ0hBUiBTQ1NJMElkOyAgICAgICAgICAvKiAxMCAtIENoYW5uZWwgMCBTQ1NJIElEICAgICAgICovCi0gICAgICAgIFVDSEFSIFNDU0kwQ29uZmlnOyAgICAgIC8qIDExIC0gQ2hhbm5lbCAwIFNDU0kgY29uZmlndXJhdGlvbiAqLwotICAgICAgICBVQ0hBUiBTQ1NJME1heFRhZ3M7ICAgICAvKiAxMiAtIEN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nICovCisgICAgICAgIHU4IFRhcmdldDFFQ29uZmlnOyAgIC8qIDNBIC0gQ2hhbm5lbCAxIFRhcmdldCBFIGNvbmZpZyAqLworICAgICAgICB1OCBUYXJnZXQxRkNvbmZpZzsgICAvKiAzQiAtIENoYW5uZWwgMSBUYXJnZXQgRiBjb25maWcgKi8KKyAgICAgICAgdTggcmVzZXJ2ZWRbM107ICAgICAgLyogM0MgLSBSZXNlcnZlZCAgICAgICAgICAgICAgICAqLwogICAgICAgICAvKiAtLS0tLS0tLS0tIENoZWNrU3VtIC0tLS0tLS0tLS0gICAgICAgKi8KLSAgICAgICAgVUNIQVIgQ2hlY2tTdW07ICAgICAgICAgLyogM0YgLSBDaGVja3N1bSBvZiBOVlJhbSAgICAgICAqLwotfSBOVlJBTSwgKlBOVlJBTTsKKyAgICAgICAgdTggQ2hlY2tTdW07ICAgICAgICAgLyogM0YgLSBDaGVja3N1bSBvZiBOVlJhbSAgICAgICAqLworfTsKIAogLyogQmlvcyBDb25maWd1cmF0aW9uIGZvciBudnJhbS0+QklPU0NvbmZpZzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KICNkZWZpbmUgTkJDX0JJT1NFTkFCTEUgIDB4MDEgICAgLyogQklPUyBlbmFibGUgICAgICAgICAgICAgICAgICAgICovCkBAIC00MDcsMTAgKzM2OSwzIEBACiAjZGVmaW5lIE5DQ19SRVNFVF9USU1FICAweDBBICAgIC8qIFNDU0kgUkVTRVQgcmVjb3ZlcmluZyB0aW1lICAgICAqLwogI2RlZmluZSBOVENfREVGQVVMVCAgICAgKE5UQ18xR0lHQSB8IE5UQ19OT19XSURFU1lOQyB8IE5UQ19ESVNDX0VOQUJMRSkKIAotI2RlZmluZSBPUkNfUkQoeCx5KSAgICAgICAgICAgICAoVUNIQVIpKGluYiggIChpbnQpKChVTE9ORykoKFVMT05HKXgrKFVDSEFSKXkpKSApKQotI2RlZmluZSBPUkNfUkRXT1JEKHgseSkgICAgICAgICAoc2hvcnQpKGlubCg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CisJb3V0YigwLCBiYXNlICsgVFVMX05WUkFNKTsJLyogLUNTICAqLworCXVkZWxheSgzMCk7CiB9CiAKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotIERpc2FibGUgZXJhc2Uvd3JpdGUgc3RhdGUgb2Ygc2VyaWFsIEVFUFJPTQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgdHVsX3NlMl9ld19kcyhXT1JEIEN1ckJhc2UpCisvKioKKyAqCWluaXRpb19zZTJfZXdfZHMJLQlEaXNhYmxlIGVyYXNlL3dyaXRlCisgKglAYmFzZTogQmFzZSBhZGRyZXNzIG9mIEluaXRJTyBjb250cm9sbGVyCisgKgorICoJRGlzYWJsZSBlcmFzZS93cml0ZSBzdGF0ZSBvZiBzZXJpYWwgRUVQUk9NCisgKi8KK3ZvaWQgaW5pdGlvX3NlMl9ld19kcyh1bnNpZ25lZCBsb25nIGJhc2UpCiB7Ci0JdHVsX3NlMl9pbnN0cihDdXJCYXNlLCAwKTsJLyogRVdEUyAqLwotCVRVTF9XUihDdXJCYXNlICsgVFVMX05WUkFNLCAwKTsJCS8qIC1DUyAgKi8KLQl0dWxfc2UyX3dhaXQoKTsKLQlyZXR1cm47CisJaW5pdGlvX3NlMl9pbnN0cihiYXNlLCAwKTsJLyogRVdEUyAqLworCW91dGIoMCwgYmFzZSArIFRVTF9OVlJBTSk7CS8qIC1DUyAgKi8KKwl1ZGVsYXkoMzApOwogfQogCiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlJbnB1dCAgOmFkZHJlc3Mgb2YgU2VyaWFsIEUyUFJPTQotCU91dHB1dCA6dmFsdWUgc3RvcmVkIGluICBTZXJpYWwgRTJQUk9NCi0qKioqKioqK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RCeXRlID0gVFVMX1JEKEN1ckJhc2UsIFRVTF9OVlJBTSkpICYgU0UyREkpCisJCW91dGIoU0UyQ1MgfCBTRTJDTEssIGJhc2UgKyBUVUxfTlZSQU0pOwkJLyogK0NMSyAqLworCQl1ZGVsYXkoMzApOworCQlvdXRiKFNFMkNTLCBiYXNlICsgVFVMX05WUkFNKTsJCQkvKiAtQ0xLICovCisJCXVkZWxheSgzMCk7CisJCWlmICgocmIgPSBpbmIoYmFzZSArIFRVTF9OVlJBTSkpICYgU0UyREkpCiAJCQlicmVhazsJLyogd3JpdGUgY29tcGxldGUgKi8KIAl9Ci0JVFVMX1dSKEN1ckJhc2UgKyBUVUxfTlZSQU0sIDApOwkJLyogLUNTICovCi0JcmV0dXJuOworCW91dGIoMCwgYmFzZSArIFRVTF9OVlJBTSk7CQkJCS8qIC1DUyAqLwogfQogCisvKioKKyAqCWluaXRpb19zZTJfcmRfYWxsCS0JcmVhZCBob3N0YWRhcHRlciBOViBjb25maWd1cmF0aW9uCisgKglAYmFzZTogQmFzZSBhZGRyZXNzIG9mIEluaXRJTyBjb250cm9sbGVyCisgKgorICoJUmVhZHMgdGhlIEUyUFJPTSBkYXRhIGludG8gbWFpbiBtZW1vcnkuIEVuc3VyZXMgdGhhdCB0aGUgY2hlY2tzdW0KKyAqCWFuZCBoZWFkZXIgbWFya2VyIGFyZSB2YWxpZC4gUmV0dXJucyAxIG9uIHN1Y2Nlc3MgLTEgb24gZXJyb3IuCisgKi8KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gUmVhZCBTQ1NJIEgvQSBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgZnJvbSBzZXJpYWwgRUVQUk9NCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgdHVsX3NlMl9yZF9hbGwoV09SR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tPmFjdGl2ZSkJLyogcmV0dXJuIHRvIE9TIGFuZCB3YWl0IGZvciB4ZmVyX2RvbmVfSVNSL1NlbGVjdGVkX0lTUiAqLwogCQkJcmV0dXJuIDE7CS8qIHJldHVybiB0byBPUywgZW5hYmxlIGludGVycnVwdCAqLwotCQl9CiAJCS8qIENoZWNrIHBlbmRpbmcgU0NCICAgICAgICAgICAgKi8KLQkJaWYgKHR1bF9maW5kX2ZpcnN0X3BlbmRfc2NiKHBDdXJIY2IpID09IE5VTEwpIHsKKwkJaWYgKGluaXRpb19maW5kX2ZpcnN0X3BlbmRfc2NiKGhvc3QpID09IE5VTEwpCiAJCQlyZXR1cm4gMTsJLyogcmV0dXJuIHRvIE9TLCBlbmFibGUgaW50ZXJydXB0ICovCi0JCX0KIAl9CQkJLyogRW5kIG9mIGZvciBsb29wICovCiAJLyogc3RhdGVtZW50IHdvbid0IHJlYWNoIGhlcmUgKi8KIH0KIAotCi0KLQotLyorKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB0dWxpcF9zY3NpKEhDUyAqIHBDdXJIY2IpCitzdGF0aWMg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VVQsIGhvc3QtPmFkZHIgKyBUVUxfU0NtZCk7CisJCQlpZiAod2FpdF90dWxpcChob3N0KSA9PSAtMSkKKwkJCQlyZXR1cm4gLTE7CiAJCQlicmVhazsKIAogCQljYXNlIERBVEFfSU46CS8qIERhdGEgaW4gcGhhc2UgICAgICAgICAgICAgICAgKi8KLQkJCXJldHVybiAodHVsX3hwYWRfaW4ocEN1ckhjYikpOworCQkJcmV0dXJuIGluaXRpb194cGFkX2luKGhvc3QpOwogCiAJCWNhc2UgREFUQV9PVVQ6CS8qIERhdGEgb3V0IHBoYXNlICAgICAgICAgICAgICAgKi8KLQkJCXJldHVybiAodHVsX3hwYWRfb3V0KHBDdXJIY2IpKTsKKwkJCXJldHVybiBpbml0aW9feHBhZF9vdXQoaG9zdCk7CiAKIAkJZGVmYXVsdDoKLQkJCXJldHVybiAodHVsX2JhZF9zZXEocEN1ckhjYikpOworCQkJcmV0dXJuIGluaXRpb19iYWRfc2VxKGhvc3QpOwogCQl9CiAJfQogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHR1bF9zdGF0ZV83KEhDUyAqIHBDdXJIY2IpCisvKioKKyAqCWluaXRpb19zdGF0ZV83CQktCVNDU0kgc3RhdGUgbWFjaGluZQorICoJQGhvc3Q6IEluaXRJTyBob3N0IHdlIGFyZSBjb250cm9sbGluZworICoKKyAqLworCitpbnQgaW5pdGlvX3N0YXRlXzcoc3RydWN0IGluaXRpb19ob3N0ICogaG9zdCkKIHsKIAlpbnQgY250LCBpOwogCkBAIC0xODkzLDExMzkgKzE2NzgsMTAyOSBAQAogCXByaW50aygiLXM3LSIpOwogI2VuZGlmCiAJLyogZmx1c2ggU0NTSSBGSUZPICovCi0JY250ID0gVFVMX1JEKHBDdXJIY2ItPkhDU19CYXNlLCBUVUxfU0ZpZm9DbnQpICYgMHgxRjsKKwljbnQgPSBpbmIoaG9zdC0+YWRkciArIFRVTF9TRmlmb0NudCkgJiAweDFGOwogCWlmIChjbnQpIHsKIAkJZm9yIChpID0gMDsgaSA8IGNudDsgaSsrKQotCQkJVFVMX1JEKHBDdXJIY2ItPkhDU19CYXNlLCBUVUxfU0ZpZm8pOworCQkJaW5iKGhvc3QtPmFkZHIgKyBUVUxfU0ZpZm8pOwogCX0KLQlzd2l0Y2ggKHBDdXJIY2ItPkhDU19QaGFzZSkgeworCXN3aXRjaCAoaG9zdC0+cGhhc2UpIHsKIAljYXNlIERBVEFfSU46CQkvKiBEYXRhIGluIHBoYXNlICAgICAgICAgICAgICAgICovCiAJY2FzZSBEQVRBX09VVDoJCS8qIERhdGEgb3V0IHBoYXNlICAgICAgICAgICAgICAgKi8KLQkJcmV0dXJuICh0dWxfYmFkX3NlcShwQ3VySGNiKSk7CisJCXJldHVybiBpbml0aW9fYmFkX3NlcShob3N0KTsKIAlkZWZhdWx0OgotCQlyZXR1cm4gKDYpOwkvKiBHbyB0byBzdGF0ZSA2ICAgICAgICAgICAgICAgICovCisJCXJldHVybiA2OwkvKiBHbyB0byBzdGF0ZSA2ICAgICAgICAgICAgICAgICovCiAJfQogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHR1bF94ZmVyX2RhdGFfaW4oSENTICogcEN1ckhjYikKKy8qKgorICoJaW5pdGlvX3hmZXJfZGF0YV9pbgktCUNvbW1lbmNlIGRhdGEgaW5wdXQKKyAqCUBob3N0OiBJbml0SU8gaG9zdCBpbiB1c2UKKyAqCisgKglDb21tZW5jZSBhIGJsb2NrIG9mIGRhdGEgdHJhbnNmZXIuIFRoZSB0cmFuc2ZlciBpdHNlbGYgd2lsbAorICoJYmUgbWFuYWdlZCBieSB0aGUgY29udHJvbGxlciBhbmQgd2Ugd2lsbCBnZXQgYSBjb21wbGV0aW9uIChvcgorICoJZmFpbHVyZSkgaW50ZXJydX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dXJIY2ItPkhDU19CYXNlICsgVFVMX1NDbWQsIFRTQ19YRl9GSUZPX09VVCk7Ci0JCXJldHVybiAod2FpdF90dWxpcChwQ3VySGNiKSk7CisJaWYgKGhvc3QtPnBoYXNlID09IE1TR19PVVQpIHsKKwkJb3V0YihNU0dfUkVKLCBob3N0LT5hZGRyICsgVFVMX1NGaWZvKTsJCS8qIE1zZyByZWplY3QgICAgICAgICAgICovCisJCW91dGIoVFNDX1hGX0ZJRk9fT1VULCBob3N0LT5hZGRyICsgVFVMX1NDbWQpOworCQlyZXR1cm4gd2FpdF90dWxpcChob3N0KTsKIAl9Ci0JcmV0dXJuIChwQ3VySGNiLT5IQ1NfUGhhc2UpOworCXJldHVybiBob3N0LT5waGFzZTsKIH0KIAotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgdHVsX21zZ291dF9pZGUoSENTICogcEN1ckhjYikKK3N0YXRpYyBpbnQgaW5pdGlvX21zZ291dF9pZGUoc3RydWN0IGluaXRpb19ob3N0ICogaG9zdCkKIHsKLQlUVUxfV1IocEN1ckhjYi0+SENTX0Jhc2UgKyBUVUxfU0ZpZm8sIE1TR19JREUpOwkJLyogSW5pdGlhdG9yIERldGVjdGVkIEVycm9yICovCi0JVFVMX1dSKHBDdXJIY2ItPkhDU19CYXNlICsgVFVMX1NDbWQsIFRTQ19YRl9GSUZPX09VVCk7Ci0JcmV0dXJuICh3YWl0X3R1bGlwKHBDdXJIY2IpKTsKKwlvdXRiKE1TR19JREUsIGhvc3QtPmFkZHIgKyBUVUxfU0ZpZm8pOwkJLyogSW5pdGlhdG9yIERldGVjdGVkIEVycm9yICovCisJb3V0YihUU0NfWEZfRklGT19PVVQsIGhvc3QtPmFkZHIgKyBUVUxfU0NtZCk7CisJcmV0dXJuIHdhaXRfdHVsaXAoaG9zdCk7CiB9CiAKLQotLyoqKioqKioqKioqKioqKioqKio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TF9TRmlmbyk7CisJb3V0YihUU0NfWEZfRklGT19PVVQsIGhvc3QtPmFkZHIgKyBUVUxfU0NtZCk7CisJcmV0dXJuIGluaXRpb193YWl0X2Rpc2MoaG9zdCk7CiAKIH0KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB0dWxfbXNnaW5fYWNjZXB0KEhDUyAqIHBDdXJIY2IpCitzdGF0aWMgaW50IGluaXRpb19tc2dpbl9hY2NlcHQoc3RydWN0IGluaXRpb19ob3N0ICogaG9zdCkKIHsKLQlUVUxfV1IocEN1ckhjYi0+SENTX0Jhc2UgKyBUVUxfU0NtZCwgVFNDX01TR19BQ0NFUFQpOwotCXJldHVybiAod2FpdF90dWxpcChwQ3VySGNiKSk7CisJb3V0YihUU0NfTVNHX0FDQ0VQVCwgaG9zdC0+YWRkciArIFRVTF9TQ21kKTsKKwlyZXR1cm4gd2FpdF90dWxpcChob3N0KTsKIH0KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3YWl0X3R1bGlwKEhDUyAqIHBDdXJIY2IpCitzdGF0aWMgaW50IHdhaXRfdHVsaXAoc3RydWN0IGluaXRpb19ob3N0ICogaG9zdCkKIHsKIAotCXdoaWxlICghKChwQ3VySGNiLT5IQ1NfSlNTdGF0dXMwID0gVFVMX1JEKHBDdXJIY2ItPkhDU19CYXNlLCBUVUxfU1N0YXR1czApKQotCQkgJiBUU1NfSU5UX1BFTkRJTkcpKTsKKwl3aGlsZSAoISgoaG9zdC0+anNzdGF0dXMwID0gaW5iKGhvc3QtPmFkZHIgKyBUVUxfU1N0YXR1czApKQorCQkgJiBUU1NfSU5UX1BFTkRJTkcpKQorCQkJY3B1X3JlbGF4KCk7CiAKLQlwQ3VySGNiLT5IQ1NfSlNJbnQgPSBUVUxfUkQ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aGVyIEVsZW1lbnQgU3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIHN0cnVjdCBTR19TdHJ1YyB7Ci0JVTMyIFNHX1B0cjsJCS8qIERhdGEgUG9pbnRlciAqLwotCVUzMiBTR19MZW47CQkvKiBEYXRhIExlbmd0aCAqLwotfSBTRzsKK3N0cnVjdCBzZ19lbnRyeSB7CisJdTMyIGRhdGE7CQkvKiBEYXRhIFBvaW50ZXIgKi8KKwl1MzIgbGVuOwkJLyogRGF0YSBMZW5ndGggKi8KK307CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogCQlTQ1NJIENvbnRyb2wgQmxvY2sKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXR5cGVkZWYgc3RydWN0IFNjc2lfQ3RybF9CbGsgewotCXN0cnVjdCBTY3NpX0N0cmxfQmxrICpTQ0JfTnh0U2NiOwotCVVCWVRFIFNDQl9TdGF0dXM7CS8qNCAqLwotCVVCWVRFIFNDQl9OeHRTdGF0OwkvKjUgKi8KLQlVQllURSBTQ0JfTW9kZTsJCS8qNiAqLwotCVVCWVRFIFNDQl9Nc2dpbjsJLyo3IFNDQl9SZXMwICovCi0JVVdPUkQgU0NCX1NHSWR4OwkvKjggKi8KLQlVV09SRCBTQ0JfU0dNYXg7CS8qQSAqLworc3RydWN0IHNjc2lfY3RybF9ibGsgeworCXN0cnVjdCBzY3NpX2N0cmxfYmxrICpuZXh0OworCXU4IHN0YXR1czsJLyo0ICovCisJdTggbmV4dF9zdGF0ZTsJLyo1ICovCisJdTggbW9kZTsJCS8qNiAqLworCXU4IG1zZ2luOwkvKjcgU0NCX1J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KioqKioqKioqKioqKioqKioqKioqKgogCQlUYXJnZXQgRGV2aWNlIENvbnRyb2wgU3RydWN0dXJlCkBAIC01MjMsNjIgKzQ5Miw1MyBAQAogI2RlZmluZSBUQ0ZfRFJWX0VOX1RBRyAgICAgICAgICAweDA4MDAKICNkZWZpbmUgVENGX0RSVl8yNTVfNjMgICAgICAgICAgMHgwNDAwCiAKLXR5cGVkZWYgc3RydWN0IEk5MXVfQWRwdF9TdHJ1YyB7Ci0JVVdPUkQgQURQVF9CSU9TOwkvKiAwICovCi0JVVdPUkQgQURQVF9CQVNFOwkvKiAxICovCi0JVUJZVEUgQURQVF9CdXM7CQkvKiAyICovCi0JVUJZVEUgQURQVF9EZXZpY2U7CS8qIDMgKi8KLQlVQllURSBBRFBUX0lOVFI7CS8qIDQgKi8KLX0gSU5JX0FEUFRfU1RSVUNUOwotCi0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogCSAgICAgIEhvc3QgQWRhcHRlciBDb250cm9sIFN0cnVjdHVyZQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdHlwZWRlZiBzdHJ1Y3QgSGFfQ3RybF9TdHJ1YyB7Ci0JVVdPUkQgSENTX0Jhc2U7CQkvKiAwMCAqLwotCVVXT1JEIEhDU19CSU9TOwkJLyogMDIgKi8KLQlVQllURSBIQ1NfSW50cjsJCS8qIDA0ICovCi0JVUJZVEUgSENTX1NDU0lfSUQ7CS8qIDA1ICovCi0JVUJZVEUgSENTX01heFRhcjsJLyogMDYgKi8KLQlVQllURSBIQ1NfTnVtU2NiczsJLyogMDcgKi8KK3N0cnVjdCBpbml0aW9faG9zdCB7CisJdTE2IGFkZHI7CQkvKiAwMCAqLworCXUxNiBiaW9zX2FkZHI7CQkvKiAwMiAqLworCXU4IGlycTsJCQkvKiAwNCAqLworCXU4I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nQgIT0gMCkgewpAQCAtMTE3NiwxOCArMTE1MSwxMCBAQAogLyogICBTZXQgYmlvcyBnZW9tZXRyeSBmb3IgdGhlIGNvbnRyb2xsZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludAotI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQotaXBzX2Jpb3NwYXJhbShEaXNrICogZGlzaywga2Rldl90IGRldiwgaW50IGdlb21bXSkKLXsKLQlpcHNfaGFfdCAqaGEgPSAoaXBzX2hhX3QgKikgZGlzay0+ZGV2aWNlLT5ob3N0LT5ob3N0ZGF0YTsKLQl1bnNpZ25lZCBsb25nIGNhcGFjaXR5ID0gZGlzay0+Y2FwYWNpdHk7Ci0jZWxzZQotaXBzX2Jpb3NwYXJhbShzdHJ1Y3Qgc2NzaV9kZXZpY2UgKnNkZXYsIHN0cnVjdCBibG9ja19kZXZpY2UgKmJkZXYsCi0JICAgICAgc2VjdG9yX3QgY2FwYWNpdHksIGludCBnZW9tW10pCitzdGF0aWMgaW50IGlwc19iaW9zcGFyYW0oc3RydWN0IHNjc2lfZGV2aWNlICpzZGV2LCBzdHJ1Y3QgYmxvY2tfZGV2aWNlICpiZGV2LAorCQkJIHNlY3Rvcl90IGNhcGFjaXR5LCBpbnQgZ2VvbVtdKQogewogCWlwc19oYV90ICpoYSA9IChpcHNfaGFfdCAqKSBzZGV2LT5ob3N0LT5ob3N0ZGF0YTsKLSNlbmRpZgogCWludCBoZWFkczsKIAlpbnQgc2VjdG9yczsKIAlpbnQgY3lsaW5kZXJzOwpAQCAtMTIyNSw3MCArMTE5Miw2IEBACiAJcmV0dXJuICgwKTsKIH0KIAotI2lmIExJTlVYX1ZFUlNJT05fQ09ERSA8IEtFUk5FTF9WRVJTSU9OKDIsNSwwKQotCi0vKiBpcHNfcHJvYzI0X2luZm8gaXMgYSB3cmFwcGVyIGFyb3VuZCBpcHNfcHJvY19pbmZvICoKLSAqIGZvciBjb21wYXRpYmlsaXR5IHdpdGggdGhlIDIuNCBzY3NpIHBhcmFtZXRlcnMgICAgKi8KLXN0YXRpYyBpbnQKLWlwc19wcm9jMjRfaW5mbyhjaGFyICpidWZmZXIsIGNoYXIgKipzdGFydCwgb2ZmX3Qgb2Zmc2V0LCBpbnQgbGVuZ3RoLAotCQkgICAgICAgICAgICAgIGludCBob3N0bm8sIGludCBmdW5jKQotewotCWludCBpOwotCi0JZm9yIChpID0gMDsgaSA8IGlwc19uZXh0X2NvbnRyb2xsZXI7IGkrKykgewotCQlpZiAoaXBzX3NoW2ldICYmIGlwc19zaFtpXS0+aG9zdF9ubyA9PSBob3N0bm8pIHsKLQkJCXJldHVybiBpcHNfcHJvY19pbmZvKGlwc19zaFtpXSwgYnVmZmVyLCBzdGFydCwKLQkJCQkJICAgICBvZmZzZXQsIGxlbmd0aCwgZnVuYyk7Ci0JCX0KLQl9Ci0JcmV0dXJuIC1FSU5WQUw7CQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUm91dGluZSBOYW1lOiBpcHNfc2VsZWN0X3F1ZXVlX2RlcHRoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJvdXRpbmUgRGVzY3JpcHRpb246ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFNlbGVjdCBxdWV1ZSBkZXB0aHMgZm9yIHRoZSBkZXZpY2VzIG9uIHRoZSBjb250b2xsZXIgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZAotaXBzX3NlbGVjdF9xdWV1ZV9kZXB0aChzdHJ1Y3QgU2NzaV9Ib3N0ICpob3N0LCBzdHJ1Y3Qgc2NzaV9kZXZpY2UgKiBzY3NpX2RldnMpCi17Ci0Jc3RydWN0IHNjc2lfZGV2aWNlICpkZXZpY2U7Ci0JaXBzX2hhX3QgKmhhOwotCWludCBjb3VudCA9IDA7Ci0JaW50IG1pbjsKLQotCWhhID0gSVBTX0hBKGhvc3QpOwotCW1pbiA9IGhhLT5tYXhfY21kcyAvIDQ7Ci0KLQlmb3IgKGRldmljZSA9IHNjc2lfZGV2czsgZGV2aWNlOyBkZXZpY2UgPSBkZXZpY2UtPm5leHQpIHsKLQkJaWYgKGRldmljZS0+aG9zdCA9PSBob3N0KSB7Ci0JCQlpZiAoKGRldmljZS0+Y2hhbm5lbCA9PSAwKSAmJiAoZGV2aWNlLT50eXBlID09IDApKQotCQkJCWNvdW50Kys7Ci0JCX0KLQl9Ci0KLQlmb3IgKGRldmljZSA9IHNjc2lfZGV2czsgZGV2aWNlOyBkZXZpY2UgPSBkZXZpY2UtPm5leHQpIHsKLQkJaWYgKGRldmljZS0+aG9zdCA9PSBob3N0KSB7Ci0JCQlpZiAoKGRldmljZS0+Y2hhbm5lbCA9PSAwKSAmJiAoZGV2aWNlLT50eXBlID09IDApKSB7Ci0JCQkJZGV2aWNlLT5xdWV1ZV9kZXB0aCA9Ci0JCQkJICAgIChoYS0+bWF4X2NtZHMgLSAxKSAvIGNvdW50OwotCQkJCWlmIChkZXZpY2UtPnF1ZXVlX2RlcHRoIDwgbWluKQotCQkJCQlkZXZpY2UtPnF1ZXVlX2RlcHRoID0gbWluOwotCQkJfSBlbHNlIHsKLQkJCQlkZXZpY2UtPnF1ZXVlX2RlcHRoID0gMjsKLQkJCX0KLQotCQkJaWYgKGRldmljZS0+cXVldWVfZGVwdGggPCAyKQotCQkJCWRldmljZS0+cXVldWVfZGVwdGggPSAyOwotCQl9Ci0JfQotfQotCi0jZWxzZQogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qIFJvdXRpbmUgTmFtZTogaXBzX3NsYXZlX2NvbmZpZ3VyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTMxNiw3ICsxMjE5LDYgQEAKIAlTRHB0ci0+c2tpcF9tc19wYWdlXzNmID0gMTsKIAlyZXR1cm4gMDsKIH0KLSNlbmRpZgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwpAQCAtMTMzMSw3ICsxMjMzLDYgQEAKIGRvX2lwc2ludHIoaW50IGlycSwgdm9pZCAqZGV2X2lkKQogewogC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TApOwotCQkJCWxvY2FsX2lycV9yZXN0b3JlKGZsYWdzKTsKLQkJCQlyZXR1cm4gMTsKLQkJCX0KLQkJCWt1bm1hcF9hdG9taWMoYnVmZmVyIC0gc2ctPm9mZnNldCwgS01fSVJRMCk7Ci0JCQlsb2NhbF9pcnFfcmVzdG9yZShmbGFncyk7Ci0JCX0KKyAgICAgICAgICAgICAgICAvKiBrbWFwX2F0b21pYygpIGVuc3VyZXMgYWRkcmVzc2FiaWxpdHkgb2YgdGhlIHVzZXIgYnVmZmVyLiovCisgICAgICAgICAgICAgICAgLyogbG9jYWxfaXJxX3NhdmUoKSBwcm90ZWN0cyB0aGUgS01fSVJRMCBhZGRyZXNzIHNsb3QuICAgICAqLworICAgICAgICAgICAgICAgIGxvY2FsX2lycV9zYXZlKGZsYWdzKTsKKyAgICAgICAgICAgICAgICBidWZmZXIgPSBrbWFwX2F0b21pYyhzZy0+cGFnZSwgS01fSVJRMCkgKyBzZy0+b2Zmc2V0OworICAgICAgICAgICAgICAgIGlmIChidWZmZXIgJiYgYnVmZmVyWzBdID09ICdDJyAmJiBidWZmZXJbMV0gPT0gJ08nICYmCisgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclsyXSA9PSAnUCcgJiYgYnVmZmVyWzNdID09ICdQJykgeworICAgICAgICAgICAgICAgICAgICAgICAga3VubWFwX2F0b21pYyhidWZmZXIgLSBzZy0+b2Zmc2V0LCBLTV9JUlEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsX2lycV9yZXN0b3JlKGZsYWdzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBrdW5tYXBfYXRvbWljKGJ1ZmZlciAtIHNnLT5vZmZzZXQsIEtNX0lSUTApOworICAgICAgICAgICAgICAgIGxvY2FsX2lycV9yZXN0b3JlKGZsYWdzKTsKIAl9CiAJcmV0dXJuIDA7CiB9CkBAIC0xNjgwLDE4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yZWFrOwotCi0JCQkJfQotCi0JCQl9IGVsc2UgewotCQkJCS8qIE5vbiBTL0cgUmVxdWVzdCAqLwotCQkJCSh2b2lkKSBpcHNfZmlsbF9zY2Jfc2dfc2luZ2xlKGhhLAotCQkJCQkJCSAgICAgIHNjYi0+Ci0JCQkJCQkJICAgICAgZGF0YV9idXNhZGRyICsKLQkJCQkJCQkgICAgICAoc2NiLT5zZ19icmVhayAqCi0JCQkJCQkJICAgICAgIGhhLT5tYXhfeGZlciksCi0JCQkJCQkJICAgICAgc2NiLCAwLAotCQkJCQkJCSAgICAgIHNjYi0+c2NzaV9jbWQtPgotCQkJCQkJCSAgICAgIHJlcXVlc3RfYnVmZmxlbiAtCi0JCQkJCQkJICAgICAgKHNjYi0+c2dfYnJlYWsgKgotCQkJCQkJCSAgICAgICBoYS0+bWF4X3hmZXIpKTsKLQkJCX0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyBzZ19kbWFfaW5kZXggPCBzY3NpX3NnX2NvdW50KHNjYi0+c2NzaV9jbWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZ19kbWFfaW5kZXgrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXBzX2ZpbGxfc2NiX3NnX3NpbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNnX2RtYV9hZGRyZXNzKCZzZ1tzZ19kbWFfaW5kZXhdKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2IsIGlwc19zZ19pbmRleCsrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNnX2RtYV9sZW4oJnNnW3NnX2RtYV9pbmRleF0pKSA8IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAKIAkJCXN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IG9mIHRoZSBFbXVsZXggTGludXggRGV2aWNlIERyaXZlciBmb3IgICAgICAgICAqCiAjICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSMgKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAwNSBFbXVsZXguICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgICAgICAgICAgKgorIyAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA2IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCiAjICogRU1VTEVYIGFuZCBTTEkgYXJlIHRyYWRlbWFya3Mgb2YgRW11bGV4LiAgICAgICAgICAgICAgICAgICAgICAgICoKICMgKiB3d3cuZW11bGV4LmNvbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgogIyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCkBAIC0yNyw0ICsyNyw1IEBACiBvYmotJChDT05GSUdfU0NTSV9MUEZDKSA6PSBscGZjLm8KIAogbHBmYy1vYmpzIDo9IGxwZmNfbWVtLm8gbHBmY19zbGkubyBscGZjX2N0Lm8gbHBmY19lbHMubyBscGZjX2hiYWRpc2MubwlcCi0JbHBmY19pbml0Lm8gbHBmY19tYm94Lm8gbHBmY19ucG9ydGRpc2MubyBscGZjX3Njc2kubyBscGZjX2F0dHIubworCWxwZmNfaW5pdC5vIGxwZmNfbWJveC5vIGxwZmNfbnBvcnRkaXNjLm8gbHBmY19zY3NpLm8gbHBmY19hdHRyLm8gXAorCWxwZmNfdnBvcnQubyBscGZjX2RlYnVnZnMubwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmYy5oIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmYy5oCmluZGV4IDgyZThmOTAuLmY4ZjY0ZDY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fX0JJR19FTkRJQU5fQklURklFTEQKKwkJdWludDMyX3QgcnN2ZDIgIDoyNDsgIC8qIFJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCQl1aW50MzJfdCBjbXYJOiAxOyAgLyogQ29uZmlndXJlIE1heCBWUElzICAgICAgICAgICAgICAgICAgICovCisJCXVpbnQzMl90IGNjcnAgICA6IDE7ICAvKiBDb25maWcgQ29tbWFuZCBSaW5nIFBvbGxpbmcgICAgICAgICAgKi8KKwkJdWludDMyX3QgY3NhaCAgIDogMTsgIC8qIENvbmZpZ3VyZSBTeW5jaHJvbm91cyBBYm9ydCBIYW5kbGluZyAqLworCQl1aW50MzJfdCBjaGJzICAgOiAxOyAgLyogQ29maWd1cmUgSG9zdCBCYWNraW5nIHN0b3JlICAgICAgICAgICovCisJCXVpbnQzMl90IGNpbmIgICA6IDE7ICAvKiBFbmFibGUgSW50ZXJydXB0IE5vdGlmaWNhdGlvbiBCbG9jayAgKi8KKwkJdWludDMyX3QgY2VyYm0JOiAxOyAgLyogQ29uZmlndXJlIEVuaGFuY2VkIFJlY2VpdmUgQnVmIE1nbXQgICovCisJCXVpbnQzMl90IGNteAk6IDE7ICAvKiBDb25maWd1cmUgTWF4IFhSSXMgICAgICAgICAgICAgICAgICAgKi8KKwkJdWludDMyX3QgY21yCTogMTsgIC8qIENvbmZpZ3VyZSBNYXggUlBJcyAgICAgICAgICAgICAgICAgICAqLworI2Vsc2UJLyogIF9fTElUVExFX0VORElBTiAqLworCQl1aW50MzJfdCBjbXIJOiAxOyAgLyogQ29uZmlndXJlIE1heCBSUElzICAgICAgICAgICAgICAgICAgICovCisJCXVpbnQzMl90IGNteAk6IDE7ICAvKiBDb25maWd1cmUgTWF4IFhSSXMgICAgICAgICAgICAgICAgICAgKi8KKwkJdWludDMyX3QgY2VyYm0JOiAxOyAgLyogQ29uZmlndXJlIEVuaGFuY2VkIFJlY2VpdmUgQnVmIE1nbXQgICovCisJCXVpbnQzMl90IGNpb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jX3ZwZF90ICp2cCA9ICZwaGJhLT52cGQ7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX2RlYnVnZnMuYyBiL2RyaXZlcnMvc2NzaS9scGZjL2xwZmNfZGVidWdmcy5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY3M2NmZTEKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX2RlYnVnZnMuYwpAQCAtMCwwICsxLDUwOCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBFbXVsZXggTGludXggRGV2aWNlIERyaXZlciBmb3IgICAgICAgICAqCisgKiBGaWJyZSBDaGFubmVsIEhvc3QgQnVzIEFkYXB0ZXJzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogQ29weXJpZ2h0IChDKSAyMDA3IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAgICAgICoKKyAqIEVNVUxFWCBhbmQgU0xJIGFyZSB0cmFkZW1hcmtzIG9mIEVtdWxleC4gICAgICAgICAgICAgICAgICAgICAgICAqCisgKiB3d3cuZW11bGV4LmNvbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgICAqCisgKiBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHZlcnNpb24gMiBvZiB0aGUgR05VIEdlbmVyYWwgICAgICAgKgorICogUHV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scGZjL2xwZmNfZGVidWdmcy5oCkBAIC0wLDAgKzEsNTAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgorICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIENvcHlyaWdodCAoQykgMjAwNyBFbXVsZXguICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgICAgICAgICAgICAgICAqCisgKiBFTVVMRVggYW5kIFNMSSBhcmUgdHJhZGVtYXJrcyBvZiBFbXVsZXguICAgICAgICAgICAgICAgICAgICAgICAgKgorICogd3d3LmVtdWxleC5jb20gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yICAgKgorICogbW9kaWZ5IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB2ZXJzaW9uIDIgb2YgdGhlIEdOVSBHZW5lcmFsICAgICAgICoKKyAqIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLiAgICAqCisgKiBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bC4gKgorICogQUxMIEVYUFJFU1MgT1IgSU1QTElFRCBDT05ESVRJT05TLCBSRVBSRVNFTlRBVElPTlMgQU5EICAgICAgICAgICoKKyAqIFdBUlJBTlRJRVMsIElOQ0xVRElORyBBTlkgSU1QTElFRCBXQVJSQU5UWSBPRiBNRVJDSEFOVEFCSUxJVFksICAqCisgKiBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSwgT1IgTk9OLUlORlJJTkdFTUVOVCwgQVJFICAgICAgKgorICogRElTQ0xBSU1FRCwgRVhDRVBUIFRPIFRIRSBFWFRFTlQgVEhBVCBTVUNIIERJU0NMQUlNRVJTIEFSRSBIRUxEICoKKyAqIFRPIEJFIExFR0FMTFkgSU5WQUxJRC4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yICAqCisgKiBtb3JlIGRldGFpbHMsIGEgY29weSBvZiB3aGljaCBjYW4gYmUgZm91bmQgaW4gdGhlIGZpbGUgQ09QWUlORyAgKgorICogaW5jbHVkZWQgd2l0aCB0aGlzIHBhY2thZ2UuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWZuZGVmIF9IX0xQRkNfREVCVUdfRlMKKyNkZWZpbmUgX0hfTFBGQ19ERUJVR19GUworCisjaWZkZWYgQ09ORklHX0xQRkNfREVCVUdfRlMKK3N0cnVjdCBscGZjX2Rpc2NfdHJjIHsKKwljaGFyICpmbXQ7CisJdWludDMyX3QgZGF0YTE7CisJdWludDMyX3QgZGF0YTI7CisJdWludDMyX3QgZGF0YTM7CisJdWludDMyX3Qgc2VxX2NudDsKKwl1bnNpZ25lZCBsb25nIGppZjsKK307CisjZW5kaWYKKworLyogTWFzayBmb3IgZGlzY292ZXJ5X3RyYWNlICovCisjZGVmaW5lIExQRkNfRElTQ19UUkNfRUxTX0NNRAkJMHgxCS8qIFRyYWNlIEVMUyBjb21tYW5kcyAqLworI2RlZmluZSBMUEZDX0RJU0NfVFJD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fdCByY3RsbWFzazsKKyNlbHNlCS8qICBfX0xJVFRMRV9FTkRJQU4gKi8KKwl1aW50OF90IHJjdGxtYXNrOworCXVpbnQ4X3QgcmN0bG1hdGNoOworCXVpbnQ4X3QgdG1hc2s7CisJdWludDhfdCB0bWF0Y2g7CisjZW5kaWYKK307CiAKKworLyogU3RydWN0dXJlIGZvciBNQiBDb21tYW5kIENPTkZJR19IQlEgKDdjKSAqLworCitzdHJ1Y3QgY29uZmlnX2hicV92YXIgeworI2lmZGVmIF9fQklHX0VORElBTl9CSVRGSUVMRAorCXVpbnQzMl90IHJzdmQxICAgICAgOjc7CisJdWludDMyX3QgcmVjdk5vdGlmeSA6MTsgICAgIC8qIFJlY2VpdmUgTm90aWZpY2F0aW9uICovCisJdWludDMyX3QgbnVtTWFzayAgICA6ODsgICAgIC8qICMgTWFzayBFbnRyaWVzICAgICAgICovCisJdWludDMyX3QgcHJvZmlsZSAgICA6ODsgICAgIC8qIFNlbGVjdGlvbiBQcm9maWxlICAgICovCisJdWludDMyX3QgcnN2ZDIgICAgICA6ODsKKyNlbHNlCS8qICBfX0xJVFRMRV9FTkRJQU4gKi8KKwl1aW50MzJfdCByc3ZkMiAgICAgIDo4OworCXVpbnQzMl90IHByb2ZpbGUgICAgOjg7ICAgICAvKiBTZWxlY3Rpb24gUHJvZmlsZSAgICAqLworCXVpbnQzMl90IG51bU1hc2sgICAgOjg7ICAgICAvKiAjIE1hc2sgRW50cmllcyAgICAgICAqLworCXVpbnQzMl90IHJlY3ZOb3RpZnkgOjE7ICAgICAvKiBSZWNlaXZlIE5vdGlmaWNhdGlvbiAqLworCXVpbnQzMl90IHJzdmQxICAgICAgOjc7CisjZW5kaWYKKworI2lmZGVmIF9fQklHX0VORElBTl9CSVRGSUVMRAorCXVpbnQzMl90IGhicUlkICAgICAgOjE2OworCXVpbnQzMl90IHJzdmQzICAgICAgOjEyOworCXVpbnQzMl90IHJpbmdNYXNrICAgOjQ7CisjZWxzZQkvKiAgX19MSVRU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gb2YgbWVtb3J5IGJhc2VkIHBvcnQKKwkJCQkJKiBjb25maWcgYmxvY2sgKi8KKyNlbHNlCS8qICBfX0xJVFRMRV9FTkRJQU4gKi8KKwl1aW50MzJfdCBwY2JMZW4gICAgOiAyNDsgICAgICAgLyogYml0IDIzOjAgIG9mIG1lbW9yeSBiYXNlZCBwb3J0CisJCQkJCSogY29uZmlnIGJsb2NrICovCisJdWludDMyX3Qgc2xpX21vZGUgIDogIDQ7CisJdWludDMyX3QgY01BICAgICAgIDogIDE7CisJdWludDMyX3QgY0hwY2IgICAgIDogIDE7CisJdWludDMyX3QgY0VUICAgICAgIDogIDE7CisJdWludDMyX3QgY0JFICAgICAgIDogIDE7CisjZW5kaWYKKwogCXVpbnQzMl90IHBjYkxvdzsgICAgICAgLyogYml0IDMxOjAgIG9mIG1lbW9yeSBiYXNlZCBwb3J0IGNvbmZpZyBibG9jayAqLwogCXVpbnQzMl90IHBjYkhpZ2g7ICAgICAgLyogYml0IDYzOjMyIG9mIG1lbW9yeSBiYXNlZCBwb3J0IGNvbmZpZyBibG9jayAqLwotCXVpbnQzMl90IGhiYWluaXRbNV07CisJdWludDMyX3QgaGJhaW5pdFs2XTsKKworI2lmZGVmIF9fQklHX0VORElBTl9CSVRGSUVMRAorCXVpbnQzMl90IHJzdmQgICAgICA6IDI0OyAgLyogUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgY212CSAgIDogIDE7ICAvKiBDb25maWd1cmUgTWF4IFZQSXMgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBjY3JwICAgICAgOiAgMTsgIC8qIENvbmZpZyBDb21tYW5kIFJpbmcgUG9sbGluZyAgICAgICAgICAqLworCXVpbnQzMl90IGNzYWggICAgICA6ICAxOyAgLyogQ29uZmlndXJlIFN5bmNocm9ub3VzIEFib3J0IEhhbmRsaW5nICovCisJdWludDMyX3QgY2hicyAgICAgIDogIDE7ICAvKiBDb2ZpZ3VyZSBIb3N0IEJhY2tpbmcgc3RvcmUgICAgICAgICAgKi8KKwl1aW50MzJfdCBjaW5iICAgICAgOiAgMTsgIC8qIEVuYWJsZSBJbnRlcnJ1cHQgTm90aWZpY2F0aW9uIEJsb2NrICAqLworCXVpbnQzMl90IGNlcmJtCSAgIDogIDE7ICAvKiBDb25maWd1cmUgRW5oYW5jZWQgUmVjZWl2ZSBCdWYgTWdtdCAgKi8KKwl1aW50MzJfdCBjbXgJICAgOiAgMTsgIC8qIENvbmZpZ3VyZSBNYXggWFJJcyAgICAgICAgICAgICAgICAgICAqLworCXVpbnQzMl90IGNtcgkgICA6ICAxOyAgLyogQ29uZmlndXJlIE1heCBSUElzICAgICAgICAgICAgICAgICAgICovCisjZWxzZQkvKiAgX19MSVRUTEVfRU5ESUFOICovCisJdWludDMyX3QgY21yCSAgIDogIDE7ICAvKiBDb25maWd1cmUgTWF4IFJQSXMgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBjbXgJICAgOiAgMTsgIC8qIENvbmZpZ3VyZSBNYXggWFJJcyAgICAgICAgICAgICAgICAgICAqLworCXVpbnQzMl90IGNlcmJtCSAgIDogIDE7ICAvKiBDb25maWd1cmUgRW5oYW5jZWQgUmVjZWl2ZSBCdWYgTWdtdCAgKi8KKwl1aW50MzJfdCBjaW5iICAgICAgOiAgMTsgIC8qIEVuYWJsZSBJbnRlcnJ1cHQgTm90aWZpY2F0aW9uIEJsb2NrICAqLworCXVpbnQzMl90IGNoYnMgICAgICA6ICAxOyAgLyogQ29maWd1cmUgSG9zdCBCYWNraW5nIHN0b3JlICAgICAgICAgICovCisJdWludDMyX3QgY3NhaCAgICAgIDogIDE7ICAvKiBDb25maWd1cmUgU3luY2hyb25vdXMgQWJvcnQgSGFuZGxpbmcgKi8KKwl1aW50MzJfdCBjY3JwICAgICAgOiAgMTsgIC8qIENvbmZpZyBDb21tYW5kIFJpbmcgUG9sbGluZyAgICAgICAgICAqLworCXVpbnQzMl90IGNtdgkgICA6ICAxOyAgLyogQ29uZmlndXJlIE1heCBWUElzICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgcnN2ZCAgICAgIDogMjQ7ICAvKiBSZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyNlbmRpZgorI2lmZGVmIF9fQklHX0VORElBTl9CSVRGSUVMRAorCXVpbnQzMl90IHJzdmQyICAgICA6IDI0OyAgLyogUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgZ212CSAgIDogIDE7ICAvKiBHcmFudCBNYXggVlBJcyAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBnY3JwCSAgIDogIDE7ICAvKiBHcmFudCBDb21tYW5kIFJpbmcgUG9sbGluZyAgICAgICAgICAgKi8KKwl1aW50MzJfdCBnc2FoCSAgIDogIDE7ICAvKiBHcmFudCBTeW5jaHJvbm91cyBBYm9ydCBIYW5kbGluZyAgICAgKi8KKwl1aW50MzJfdCBnaGJzCSAgIDogIDE7ICAvKiBHcmFudCBIb3N0IEJhY2tpbmcgU3RvcmUgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBnaW5iCSAgIDogIDE7ICAvKiBHcmFudCBJbnRlcnJ1cHQgTm90aWZpY2F0aW9uIEJsb2NrICAgKi8KKwl1aW50MzJfdCBnZXJibQkgICA6ICAxOyAgLyogR3JhbnQgRVJCTSBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgZ214CSAgIDogIDE7ICAvKiBHcmFudCBNYXggWFJJcyAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBnbXIJICAgOiAgMTsgIC8qIEdyYW50IE1heCBSUElzICAgICAgICAgICAgICAgICAgICAgICAqLworI2Vsc2UJLyogIF9fTElUVExFX0VORElBTiAqLworCXVpbnQzMl90IGdtcgkgICA6ICAxOyAgLyogR3JhbnQgTWF4IFJQSXMgICAgICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgZ214CSAgIDogIDE7ICAvKiBHcmFudCBNYXggWFJJcyAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCBnZXJibQkgICA6ICAxOyAgLyogR3JhbnQgRVJCTSBSZXF1ZXN0ICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgZ2luYgkgICA6ICAxOyAgLyogR3JhbnQgSW50ZXJydXB0IE5vdGlmaWNhdGlvbiBCbG9jayAgICovCisJdWludDMyX3QgZ2hicwkgICA6ICAxOyAgLyogR3JhbnQgSG9zdCBCYWNraW5nIFN0b3JlICAgICAgICAgICAgICovCisJdWludDMyX3QgZ3NhaAkgICA6ICAxOyAgLyogR3JhbnQgU3luY2hyb25vdXMgQWJvcnQgSGFuZGxpbmcgICAgICovCisJdWludDMyX3QgZ2NycAkgICA6ICAxOyAgLyogR3JhbnQgQ29tbWFuZCBSaW5nIFBvbGxpbmcgICAgICAgICAgICovCisJdWludDMyX3QgZ212CSAgIDogIDE7ICAvKiBHcmFudCBNYXggVlBJcyAgICAgICAgICAgICAgICAgICAgICAgKi8KKwl1aW50MzJfdCByc3ZkMiAgICAgOiAyNDsgIC8qIFJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworI2VuZGlmCisKKyNpZmRlZiBfX0JJR19FTkRJQU5fQklURklFTEQKKwl1aW50MzJfdCBtYXhfcnBpICAgOiAxNjsgIC8qIE1heCBSUElzIFBvcnQgc2hvdWxkIGNvbmZpZ3VyZSAgICAgICAqLworCXVpbnQzMl90IG1heF94cmkgICA6IDE2OyAgLyogTWF4IFhSSXMgUG9ydCBzaG91bGQgY29uZmlndXJlICAgICAgICovCisjZWxzZQkvKiAgX19MSVRUTEVfRU5ESUFOICovCisJdWludDMyX3QgbWF4X3hyaSAgIDogMTY7ICAvKiBNYXggWFJJcyBQb3J0IHNob3VsZCBjb25maWd1cmUgICAgICAgKi8KKwl1aW50MzJfdCBtYXhfcnBpICAgOiAxNjsgIC8qIE1heCBSUElzIFBvcnQgc2hvdWxkIGNvbmZpZ3VyZSAgICAgICAqLworI2VuZGlmCisKKyNpZmRlZiBfX0JJR19FTkRJQU5fQklURklFTEQKKwl1aW50MzJfdCBtYXhfaGJxICAgOiAxNjsgIC8qIE1heCBIQlFzIEhvc3QgZXhwZWN0IHRvIGNvbmZpZ3VyZSAgICAqLworCXVpbnQzMl90IHJzdmQzICAgICA6IDE2OyAgLyogTWF4IEhCUXMgSG9zdCBleHBlY3QgdG8gY29uZmlndXJlICAgICovCisjZWxzZQkvKiAgX19MSVRUTEVfRU5ESUFOICovCisJdWludDMyX3QgcnN2ZDMgICAgIDogMTY7ICAvKiBNYXggSEJRcyBIb3N0IGV4cGVjdCB0byBjb25maWd1cmUgICAgKi8KKwl1aW50MzJfdCBtYXhfaGJxICAgOiAxNjsgIC8qIE1heCBIQlFzIEhvc3QgZXhwZWN0IHRvIGNvbmZpZ3VyZSAgICAqLworI2VuZGlmCisKKwl1aW50MzJfdCByc3ZkNDsgICAgICAgICAgIC8qIFJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCisjaWZkZWYgX19CSUdfRU5ESUFOX0JJVEZJRUxECisJdWludDMyX3QgcnN2ZDUgICAgICA6IDE2OyAgLyogUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJdWludDMyX3QgbWF4X3ZwaSAgICA6IDE2OyAgLyogTWF4IG51bWJlciBvZiB2aXJ0IE4tUG9ydHMgICAgICAgICAgICovCisjZWxzZQkvKiAgX19MSVRUTEVfRU5ESUFOICovCisJdWludDMyX3QgbWF4X3ZwaSAgICA6IDE2OyAgLyogTWF4IG51bWJlciBvZiB2aXJ0IE4tUG9ydHMgICAgICAgICAgICovCisJdWludDMyX3QgcnN2ZDUgICAgICA6IDE2OyAgLyogUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisjZW5kaWYKKwogfSBDT05GSUdfUE9SVF9WQ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sYXRlID0gTlVMTDsKK3N0YXRpYyBzdHJ1Y3Qgc2NzaV90cmFuc3BvcnRfdGVtcGxhdGUgKmxwZmNfdnBvcnRfdHJhbnNwb3J0X3RlbXBsYXRlID0gTlVMTDsKIHN0YXRpYyBERUZJTkVfSURSKGxwZmNfaGJhX2luZGV4KTsKIAorCisKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgbHBmY19jb25maWdfcG9ydF9wcmVwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTYxLDcgKzY3LDcgQEAKIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50Ci1scGZjX2NvbmZpZ19wb3J0X3ByZXAoc3RydWN0IGxwZmNfaGJhICogcGhiYSkKK2xwZmNfY29uZmlnX3BvcnRfcHJlcChzdHJ1Y3QgbHBmY19oYmEgKnBoYmEpCiB7CiAJbHBmY192cGRfdCAqdnAgPSAmcGhiYS0+dnBkOwogCWludCBpID0gMCwgcmM7CkBAIC03NSwxMiArODEsMTIgQEAKIAogCXBtYiA9IG1lbXBvb2xfYWxsb2MocGhiYS0+bWJveF9tZW1fcG9vbCwgR0ZQX0tFUk5FTCk7CiAJaWYgKCFwbWIpIHsKLQkJcGhiYS0+aGJhX3N0YXRlID0gTFBGQ19IQkFfRVJST1I7CisJCXBoYmEtPmxpbmtfc3RhdGUgPSBMUEZDX0hCQV9FUlJPUjsKIAkJcmV0dXJuIC1FTk9NRU07CiAJfQogCiAJbWI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mx1c2hfbGlzdChwaGJhKTsKKwlsaXN0X2Zvcl9lYWNoX2VudHJ5KHZwb3J0LCAmcGhiYS0+cG9ydF9saXN0LCBsaXN0ZW50cnkpIHsKKwkJbHBmY19jbGVhbnVwX2Rpc2NvdmVyeV9yZXNvdXJjZXModnBvcnQpOworCX0KIAotCXJldHVybiAoMCk7CisJcmV0dXJuIDA7CiB9CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCkBAIC00NTMsMjAgKzQ2MCwyNCBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiBpbnQKLWxwZmNfaGJhX2Rvd25fcG9zdChzdHJ1Y3QgbHBmY19oYmEgKiBwaGJhKQorbHBmY19oYmFfZG93bl9wb3N0KHN0cnVjdCBscGZjX2hiYSAqcGhiYSkKIHsKIAlzdHJ1Y3QgbHBmY19zbGkgKnBzbGkgPSAmcGhiYS0+c2xpOwogCXN0cnVjdCBscGZjX3NsaV9yaW5nICpwcmluZzsKIAlzdHJ1Y3QgbHBmY19kbWFidWYgKm1wLCAqbmV4dF9tcDsKIAlpbnQgaTsKIAotCS8qIENsZWFudXAgcHJlcG9zdGVkIGJ1ZmZlcnMgb24gdGhlIEVMUyByaW5nICovCi0JcHJpbmcgPSAmcHNsaS0+cmluZ1tMUEZDX0VMU19SSU5HXTsKLQlsaXN0X2Zvcl9lYWNoX2VudHJ5X3NhZmUobXAsIG5leHRfbXAsICZwcmluZy0+cG9zdGJ1ZnEsIGxpc3QpIHsKLQkJbGlzdF9kZWwoJm1wLT5saXN0KTsKLQkJcHJpbmctPnBvc3RidWZxX2NudC0tOwotCQlscGZjX21idWZfZnJlZShwaGJhLC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CQkJIiVkOjA0NTkgQWRhcHRlciBoZWFydGJlYXQgZmFpbHVyZSwgdGFraW5nICIKKwkJCSJ0aGlzIHBvcnQgb2ZmbGluZS5cbiIsIHBoYmEtPmJyZF9ubyk7CisKKwkJc3Bpbl9sb2NrX2lycSgmcGhiYS0+aGJhbG9jayk7CisJCXBzbGktPnNsaV9mbGFnICY9IH5MUEZDX1NMSTJfQUNUSVZFOworCQlzcGluX3VubG9ja19pcnEoJnBoYmEtPmhiYWxvY2spOworCisJCWxwZmNfb2ZmbGluZV9wcmVwKHBoYmEpOworCQlscGZjX29mZmxpbmUocGhiYSk7CisJCWxwZmNfdW5ibG9ja19tZ210X2lvKHBoYmEpOworCQlwaGJhLT5saW5rX3N0YXRlID0gTFBGQ19IQkFfRVJST1I7CisJCWxwZmNfaGJhX2Rvd25fcG9zdChwaGJhKTsKKwl9Cit9CisKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyogICAgbHBmY19oYW5kbGVfZXJhdHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KQEAgLTQ4NiwxMSArNjEwLDE1IEBACiAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQKLWxwZmNfaGFuZGxlX2VyYXR0KHN0cnVjdCBscGZjX2hiYSAqIHBoYmEpCitscGZjX2hhbmRsZV9lcmF0dChzdHJ1Y3QgbHBmY19oYmEgKnBoYmEpCiB7Ci0Jc3RydWN0IGxwZmNfc2xpICpwc2x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JhLCBwcmluZywgbXAyKTsKLQkJfQogCX0KIAlwcmluZy0+bWlzc2J1ZmNudCA9IDA7CiAJcmV0dXJuIDA7CkBAIC0xMDUwLDcgKzExNzgsNyBAQAogLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiBzdGF0aWMgaW50Ci1scGZjX3Bvc3RfcmN2X2J1ZihzdHJ1Y3QgbHBmY19oYmEgKiBwaGJhKQorbHBmY19wb3N0X3Jjdl9idWYoc3RydWN0IGxwZmNfaGJhICpwaGJhKQogewogCXN0cnVjdCBscGZjX3NsaSAqcHNsaSA9ICZwaGJhLT5zbGk7CiAKQEAgLTExNTEsNyArMTI3OSw3IEBACiB7CiAJaW50IHQ7CiAJdWludDMyX3QgKkhhc2hXb3JraW5nOwotCXVpbnQzMl90ICpwd3dubiA9IHBoYmEtPnd3bm47CisJdWludDMyX3QgKnB3d25uID0gKHVpbnQzMl90ICopIHBoYmEtPnd3bm47CiAKIAlIYXNoV29ya2luZyA9IGttYWxsb2MoODAgKiBzaXplb2YodWludDMyX3QpLCBHRlBfS0VSTkVMKTsKIAlpZiAoIUhhc2hXb3JraW5nKQpAQCAtMTE3MCw2NCArMTI5OCw3NiBAQAogfQogCiBzdGF0aWMgdm9pZAotbHBmY19jbGVhbnVwKHN0cnVjdCBscGZjX2hiYSAqIHBoYmEpCitscGZjX2NsZWFudXAoc3RydWN0IGxwZmNfdnBvcnQgKnZwb3J0KQogewogCXN0cnVjdCBscGZjX25vZGVsaXN0ICpuZGxwLCAqbmV4dF9uZGxwOwogCiAJLyogY2xlYW4gdXAgcGhiYSAtIGxwZmMgc3BlY2lmaWMgKi8KLQlscGZjX2Nhbl9kaXNjdG1vKHBoYmEpOwotCWxpc3RfZm9yX2VhY2hfZW50cnlfc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pOworCQlzcGluX2xvY2tfaXJxKHNob3N0LT5ob3N0X2xvY2spOworCQl2cG9ydC0+d29ya19wb3J0X2V2ZW50cyA9IDA7CisJCXZwb3J0LT5mY19mbGFnIHw9IEZDX09GRkxJTkVfTU9ERTsKKwkJc3Bpbl91bmxvY2tfaXJxKHNob3N0LT5ob3N0X2xvY2spOworCX0KIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTMyNiwxNyArMTQ4MiwxNyBAQAogKgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogc3RhdGljIGludAotbHBmY19zY3NpX2ZyZWUoc3RydWN0IGxwZmNfaGJhICogcGhiYSkKK2xwZmNfc2NzaV9mcmVlKHN0cnVjdCBscGZjX2hiYSAqcGhiYSkKIHsKIAlzdHJ1Y3QgbHBmY19zY3NpX2J1ZiAqc2IsICpzYl9uZXh0OwogCXN0cnVjdCBscGZjX2lvY2JxICppbywgKmlvX25leHQ7CiAKLQlzcGluX2xvY2tfaXJxKHBoYmEtPmhvc3QtPmhvc3RfbG9jayk7CisJc3Bpbl9sb2NrX2lycSgmcGhiYS0+aGJhbG9jayk7CiAJLyogUmVsZWFzZSBhbGwgdGhlIGxwZmNfc2NzaV9idWZzIG1haW50YWluZWQgYnkgdGhpcyBob3N0LiAqLwogCWxpc3RfZm9yX2VhY2hfZW50cnlfc2FmZShzYiwgc2JfbmV4dCwgJnBoYmEtPmxwZmNfc2NzaV9idWZfbGlzdCwgbGlzdCkgewogCQlsaXN0X2RlbCgmc2ItPmxpc3QpOwogCQlwY2lfcG9vbF9mcmVlKHBoYmEtPmxwZmNfc2NzaV9kbWFfYnVmX3Bvb2wsIHNiLT5kYXRhLAotCQkJCQkJCQlzYi0+ZG1hX2hhbmRsZSk7CisJCQkgICAgICBzYi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GxwZmNfcHJpbnRmX2xvZyhwaGJhLCBsZXZlbCwgbWFzaywgZm10LCBhcmcuLi4pIFwKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc2NzaS9scGZjL2xwZmNfbWJveC5jIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmY19tYm94LmMKaW5kZXggODA0MWMzZi4uOGY0MmZiZiAxMDA2NDQKLS0tIGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmY19tYm94LmMKKysrIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmY19tYm94LmMKQEAgLTgyLDYgKzgyLDIyIEBACiB9CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIGxwZmNfaGVhcnRfYmVhdCAgSXNzdWUgYSBIRUFSVF9CRUFUICAgICAgICovCisvKiAgICAgICAgICAgICAgICBtYWlsYm94IGNvbW1hbmQgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZAorbHBmY19oZWFydF9iZWF0KHN0cnVjdCBscGZjX2hiYSAqIHBoYmEsIExQRkNfTUJPWFFfdCAqIHBtYikKK3sKKwlNQUlMQk9YX3QgKm1iOworCisJbWIgPSAmcG1iLT5tYjsKKwltZW1zZXQocG1iLCAwLCBzaXplb2YgKExQRkNfTUJPWFFfdCkpOworCW1iLT5tYnhDb21tYW5kID0gTUJYX0hFQVJUQkVBVDsKKwltYi0+bWJ4T3duZXIgPSBPV05fSE9TVDsKKwlyZXR1cm47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogIGxwZmNfcmVhZF9sYSAgSXNzdWUgYSBSRUFEIExBICAgICAgICAgICAgICovCiAvKiAgICAgICAgICAgICAgICBtYWlsYm94IGNvbW1hbmQgICAgICAgICAgICAgKi8KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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CWF9VTlJFR19MT0dJTjsKIAltYi0+bWJ4T3duZXIgPSBPV05fSE9TVDsKIAlyZXR1cm47CiB9CiAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qICBscGZjX3JlZ192cGkgICBJc3N1ZSBhIFJFR19WUEkgICAgICAgICAgICAgICAgKi8KKy8qICAgICAgICAgICAgICAgICAgICBtYWlsYm94IGNvbW1hbmQgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQKK2xwZmNfcmVnX3ZwaShzdHJ1Y3QgbHBmY19oYmEgKnBoYmEsIHVpbnQxNl90IHZwaSwgdWludDMyX3Qgc2lkLAorCSAgICAgTFBGQ19NQk9YUV90ICpwbWIpCit7CisJTUFJTEJPWF90ICptYiA9ICZwbWItPm1iOworCisJbWVtc2V0KHBtYiwgMCwgc2l6ZW9mIChMUEZDX01CT1hRX3QpKTsKKworCW1iLT51bi52YXJSZWdWcGkudnBpID0gdnBpOworCW1iLT51bi52YXJSZWdWcGkuc2lkID0gc2lkOworCisJbWItPm1ieENvbW1hbmQgPSBNQlhfUkVHX1ZQSTsKKwltYi0+bWJ4T3duZXIgPSBPV05fSE9TVDsKKwlyZXR1cm47CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogIGxwZmNfdW5yZWdfdnBpICAgSXNzdWUgYSBVTlJFR19WTlBJICAgICAgICAgICAqLworLyogICAgICAgICAgICAgICAgICAgIG1haWxib3ggY29tbWFuZCAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordm9pZAorbHBmY191bnJlZ192cGkoc3RydWN0IGxwZmNfaGJhICpwaGJhLCB1aW50MTZfdCB2cGksIExQRkNfTUJPWFFfdCAqcG1iKQoreworCU1BSUxCT1h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BUaGUgcG9ydCBleHBlY3RzIHRoZSBob3N0IGdldC9wdXQgcG9pbnRlcnMgdG8gcmVzaWRlIGluIG1lbW9yeQorCSAqIGZvbGxvd2luZyB0aGUgIm5vbi1kaWFnbm9zdGljIiBtb2RlIG1haWxib3ggKDMyIHdvcmRzLCAweDgwIGJ5dGVzKQorCSAqIGFyZWEgb2YgU0xJTS4gIEluIFNMSS0yIG1vZGUsIHRoZXJlJ3MgYW4gYWRkaXRpb25hbCAxNiByZXNlcnZlZAorCSAqIHdvcmRzICgweDQwIGJ5dGVzKS4gIFRoaXMgYXJlYSBpcyBub3QgcmVzZXJ2ZWQgaWYgSEJRcyBhcmUKKwkgKiBjb25maWd1cmVkIGluIFNMSS0zLgorCSAqCisJICogQ1IwUHV0ICAgIC0gU0xJMihubyBIQlFzKSA9IDB4YzAsIFdpdGggSEJRcyA9IDB4ODAKKwkgKiBSUjBHZXQgICAgICAgICAgICAgICAgICAgICAgMHhjNCAgICAgICAgICAgICAgMHg4NAorCSAqIENSMVB1dCAgICAgICAgICAgICAgICAgICAgICAweGM4ICAgICAgICAgICAgICAweDg4CisJICogUlIxR2V0ICAgICAgICAgICAgICAgICAgICAgIDB4Y2MgICAgICAgICAgICAgIDB4OGMKKwkgKiBDUjJQdXQgICAgICAgICAgICAgICAgICAgICAgMHhkMCAgICAgICAgICAgICAgMHg5MAorCSAqIFJSMkdldCAgICAgICAgICAgICAgICAgICAgICAweGQ0ICAgICAgICAgICAgICAweDk0CisJICogQ1IzUHV0ICAgICAgICAgICAgICAgICAgICAgIDB4ZDggICAgICAgICAgICAgIDB4OTgKKwkgKiBSUjNHZXQgICAgICAgICAgICAgICAgICAgICAgMHhkYyAgICAgICAgICAgICAgMHg5YworCSAqCisJICogUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgIDB4YTAtMHhiZgorCSAqICAgIElmIEhCUXMgY29uZmlndXJlZDoKKwkgKiAgICAgICAgICAgICAgICAgICAgICAgICBIQlEgMCBQdXQgcHRy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ykgMjAwNC0yMDA2IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCiAgKiBFTVVMRVggYW5kIFNMSSBhcmUgdHJhZGVtYXJrcyBvZiBFbXVsZXguICAgICAgICAgICAgICAgICAgICAgICAgKgogICogd3d3LmVtdWxleC5jb20gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKICAqIFBvcnRpb25zIENvcHlyaWdodCAoQykgMjAwNC0yMDA1IENocmlzdG9waCBIZWxsd2lnICAgICAgICAgICAgICAqCkBAIC0zOCwxMCArMzgsMTMgQEAKICNkZWZpbmUgTFBGQ19NQlVGX1BPT0xfU0laRSAgICAgNjQgICAgICAvKiBtYXggZWxlbWVudHMgaW4gTUJVRiBzYWZldHkgcG9vbCAqLwogI2RlZmluZSBMUEZDX01FTV9QT09MX1NJWkUgICAgICA2NCAgICAgIC8qIG1heCBlbGVtIGluIG5vbi1ETUEgc2FmZXR5IHBvb2wgKi8KIAorCisKIGludAogbHBmY19tZW1fYWxsb2Moc3RydWN0IGxwZmNfaGJhICogcGhiYSkKIHsKIAlzdHJ1Y3QgbHBmY19kbWFfcG9vbCAqcG9vbCA9ICZwaGJhLT5scGZjX21idWZfc2FmZXR5X3Bvb2w7CisJaW50IGxvbmdzOwogCWludCBpOwogCiAJcGhiYS0+bHBmY19zY3NpX2RtYV9idWZfcG9vbCA9IHBjaV9wb29sX2NyZWF0ZSgibHBmY19zY3NpX2RtYV9idWZfcG9vbCIsCkBAIC04MCwxMCArODMsMjcgQEAKIAlpZiAoIXBoYmEtPm5scF9tZW1fcG9vbCkKIAkJZ290byBmYWlsX2ZyZWVfbWJveF9wb29sOwogCisJcGhiYS0+bHBmY19oYnFfcG9vbCA9IHBjaV9wb29sX2NyZWF0ZSgibHBmY19oYnFfcG9vbCIscGhiYS0+cGNpZGV2LAorCQkJCQkgICAgICBMUEZDX0JQTF9TSVpFLCA4LCAwKTsKKwlpZiAoIXB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fZnJlZShwaGJhLCBoYnFfZW50cnktPmRidWYudmlydCwKKwkJCQkgICAgICBoYnFfZW50cnktPmRidWYucGh5cyk7CisJCQlrZnJlZShoYnFfZW50cnkpOworCQl9IGVsc2UgeworCQkJbHBmY19zbGlfZnJlZV9oYnEocGhiYSwgaGJxX2VudHJ5KTsKKwkJfQorCX0gZWxzZSB7CisJCWxwZmNfbWJ1Zl9mcmVlKHBoYmEsIG1wLT52aXJ0LCBtcC0+cGh5cyk7CisJCWtmcmVlKG1wKTsKKwl9CisJcmV0dXJuOworfQorCmRpZmYgLS1naXQgYS9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX25wb3J0ZGlzYy5jIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmY19ucG9ydGRpc2MuYwppbmRleCBiMzA5ODQxLi5iY2EyZjVjIDEwMDY0NAotLS0gYS9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX25wb3J0ZGlzYy5jCisrKyBiL2RyaXZlcnMvc2NzaS9scGZjL2xwZmNfbnBvcnRkaXNjLmMKQEAgLTEsNCArMSw0IEBACi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgogICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKICAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA3IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCkBAIC0zNSwyMCArMzUsMjIgQEAKICNpbmNsdWRlICJscGZjLmgiCiAjaW5jbHVkZSAibHBmY19sb2dt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ZjX3Njc2kuaAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3Njc2kuaApAQCAtMSw3ICsxLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgogICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA1IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCisgKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAwNiBFbXVsZXguICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgICAgICAgICAgKgogICogRU1VTEVYIGFuZCBTTEkgYXJlIHRyYWRlbWFya3Mgb2YgRW11bGV4LiAgICAgICAgICAgICAgICAgICAgICAgICoKICAqIHd3dy5lbXVsZXguY29tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgpAQCAtMTEwLDcgKzExMCw2IEBACiBzdHJ1Y3QgbHBmY19zY3NpX2J1ZiB7CiAJc3RydWN0IGxpc3RfaGVhZCBsaXN0OwogCXN0cnVjdCBzY3NpX2NtbmQgKnBDbWQ7Ci0Jc3RydWN0IGxwZmNfaGJhICpzY3NpX2hiYTsKIAlzdHJ1Y3QgbHBmY19ycG9ydF9kYXRhICpyZGF0YTsKIAogCXVpbnQzMl90IHRpbWVvdXQ7CmRpZmYgLS1naXQgYS9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3NsaS5jIGIvZHJpdmVycy9zY3NpL2xw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cml2ZXJzL3Njc2kvbHBmYy9scGZjX3ZlcnNpb24uaAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3ZlcnNpb24uaApAQCAtMTgsNyArMTgsNyBAQAogICogaW5jbHVkZWQgd2l0aCB0aGlzIHBhY2thZ2UuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0jZGVmaW5lIExQRkNfRFJJVkVSX1ZFUlNJT04gIjguMS4xMiIKKyNkZWZpbmUgTFBGQ19EUklWRVJfVkVSU0lPTiAiOC4yLjEiCiAKICNkZWZpbmUgTFBGQ19EUklWRVJfTkFNRSAibHBmYyIKIApkaWZmIC0tZ2l0IGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmY192cG9ydC5jIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmY192cG9ydC5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjg1Nzk3ZGIKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3Zwb3J0LmMKQEAgLTAsMCArMSw1MjMgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgorICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA2IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCisgKiBFTVVMRVggYW5kIFNMSSBhcmUgdHJhZGVtYXJrcyBvZiBFbXVsZXguICAgICAgICAgICAgICAgICAgICAgICAgKgorICogd3d3LmVtdWxleC5jb20gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIFBvcnRpb25zIENvcHlyaWdodCAoQykgMjAwNC0yMDA1IENocmlzdG9waCBIZWxsd2lnICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciAgICoKKyAqIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdmVyc2lvbiAyIG9mIHRoZSBHTlUgR2VuZXJhbCAgICAgICAqCisgKiBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbi4gICAgKgorICogVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwuICoKKyAqIEFMTCBFWFBSRVNTIE9SIElNUExJRUQgQ09ORElUSU9OUywgUkVQUkVTRU5UQVRJT05TIEFORCAgICAgICAgICAqCisgKiBXQVJSQU5USUVTLCBJTkNMVURJTkcgQU5ZIElNUExJRUQgV0FSUkFOVFkgT0YgTUVSQ0hBTlRBQklMSVRZLCAgKgorICogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UsIE9SIE5PTi1JTkZSSU5HRU1FTlQsIEFSRSAgICAgICoKKyAqIERJU0NMQUlNRUQsIEVYQ0VQVCBUTyBUSEUgRVhURU5UIFRIQVQgU1VDSCBESVNDTEFJTUVSUyBBUkUgSEVMRCAqCisgKiBUTyBCRSBMRUdBTExZIElOVkFMSUQuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1Ym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W5yZWdfdnBpKHZwb3J0KTsKKworCWxwZmNfZnJlZV92cGkocGhiYSwgdnBvcnQtPnZwaSk7CisJdnBvcnQtPndvcmtfcG9ydF9ldmVudHMgPSAwOworCXNwaW5fbG9ja19pcnEoJnBoYmEtPmhiYWxvY2spOworCWxpc3RfZGVsX2luaXQoJnZwb3J0LT5saXN0ZW50cnkpOworCXNwaW5fdW5sb2NrX2lycSgmcGhiYS0+aGJhbG9jayk7CisKKwlyYyA9IFZQT1JUX09LOworb3V0OgorCXNjc2lfaG9zdF9wdXQoc2hvc3QpOworCXJldHVybiByYzsKK30KKworCitFWFBPUlRfU1lNQk9MKGxwZmNfdnBvcnRfY3JlYXRlKTsKK0VYUE9SVF9TWU1CT0wobHBmY192cG9ydF9kZWxldGUpOwpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zY3NpL2xwZmMvbHBmY192cG9ydC5oIGIvZHJpdmVycy9zY3NpL2xwZmMvbHBmY192cG9ydC5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmYyMjM1NTAKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL3Njc2kvbHBmYy9scGZjX3Zwb3J0LmgKQEAgLTAsMCArMSwxMTMgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIGZpbGUgaXMgcGFydCBvZiB0aGUgRW11bGV4IExpbnV4IERldmljZSBEcml2ZXIgZm9yICAgICAgICAgKgorICogRmlicmUgQ2hhbm5lbCBIb3N0IEJ1cyBBZGFwdGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIENvcHlyaWdodCAoQykgMjAwNC0yMDA2IEVtdWxleC4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuICAgICAgICAgICAqCisgKiBFTVVMRVggYW5kIFNMSSBhcmUgdHJhZGVtYXJrcyBvZiBFbXVsZXguICAgICAgICAgICAgICAgICAgICAgICAgKgorICogd3d3LmVtdWxleC5jb20gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqIFBvcnRpb25zIENvcHlyaWdodCAoQykgMjAwNC0yMDA1IENocmlzdG9waCBIZWxsd2lnICAgICAgICAgICAgICAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciAgICoKKyAqIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdmVyc2lvbiAyIG9mIHRoZSBHTlUgR2VuZXJhbCAgICAgICAqCisgKiBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbi4gICAgKgorICogVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwuICoKKyAqIEFMTCBFWFBSRVNTIE9SIElNUExJRUQgQ09ORElUSU9OUywgUkVQUkVTRU5UQVRJT05TIEFORCAgICAgICAgICAqCisgKiBXQVJSQU5USUVTLCBJTkNMVURJTkcgQU5ZIElNUExJRUQgV0FSUkFOVFkgT0YgTUVSQ0hBTlRBQklMSVRZLCAgKgorICogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UsIE9SIE5PTi1JTkZSSU5HRU1FTlQsIEFSRSAgICAgICoKKyAqIERJU0NMQUlNRUQsIEVYQ0VQVCBUTyBUSEUgRVhURU5UIFRIQVQgU1VDSCBESVNDTEFJTUVSUyBBUkUgSEVMRCAqCisgKiBUTyBCRSBMRUdBTExZIElOVkFMSUQuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMa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UQgJWlcbiIsIGNtZC0+ZGV2aWNlLT50YXJnZXQpOworCQlwcmludGsoS0VSTl9ERUJVRyAicHBhOiBubyBkZXZpY2UgYXQgU0NTSSBJRCAlaVxuIiwgY21kLT5kZXZpY2UtPnRhcmdldCk7CiAJCWJyZWFrOwogCWNhc2UgRElEX0JVU19CVVNZOgotCQlwcmludGsoInBwYTogQlVTIEJVU1kgLSBFUFAgdGltZW91dCBkZXRlY3RlZFxuIik7CisJCXByaW50ayhLRVJOX0RFQlVHICJwcGE6IEJVUyBCVVNZIC0gRVBQIHRpbWVvdXQgZGV0ZWN0ZWRcbiIpOwogCQlicmVhazsKIAljYXNlIERJRF9USU1FX09VVDoKLQkJcHJpbnRrKCJwcGE6IHVua25vd24gdGltZW91dFxuIik7CisJCXByaW50ayhLRVJOX0RFQlVHICJwcGE6IHVua25vd24gdGltZW91dFxuIik7CiAJCWJyZWFrOwogCWNhc2UgRElEX0FCT1JUOgotCQlwcmludGsoInBwYTogdG9sZCB0byBhYm9ydFxuIik7CisJCXByaW50ayhLRVJOX0RFQlVHICJwcGE6IHRvbGQgdG8gYWJvcnRcbiIpOwogCQlicmVhazsKIAljYXNlIERJRF9QQVJJVFk6Ci0JCXByaW50aygicHBhOiBwYXJpdHkgZXJyb3IgKD8/PylcbiIpOworCQlwcmludGsoS0VSTl9ERUJVRyAicHBhOiBwYXJpdHkgZXJyb3IgKD8/PylcbiIpOwogCQlicmVhazsKIAljYXNlIERJRF9FUlJPUjoKLQkJcHJpbnRrKCJwcGE6IGludGVybmFsIGRyaXZlciBlcnJvclxuIik7CisJCXByaW50ayhLRVJOX0RFQlVHICJwcGE6IGludGVybmFsIGRyaXZlciBlcnJvclxuIik7CiAJCWJyZWFrOwogCWNhc2UgRElEX1JFU0VUOgotCQlwcmludGsoInBwYTogdG9sZCB0byByZXNldCBkZXZpY2VcbiIpOworCQlwcmludGsoS0VSTl9ERUJVRyAicHBhOiB0b2xkIHRvIHJlc2V0IGRldmljZVxuIik7CiAJ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AgICAgICB1aW50OF90IGVudHJ5X2NvdW50OyAgICAgICAgICAgIC8qIEVudHJ5IGNvdW50LiAqLworICAgICAgICB1aW50OF90IHN5c19kZWZpbmU7ICAgICAgICAgICAgIC8qIFN5c3RlbSBkZWZpbmVkLiAqLworICAgICAgICB1aW50OF90IGVudHJ5X3N0YXR1czsgICAgICAgICAgIC8qIEVudHJ5IFN0YXR1cy4gKi8KKworICAgICAgICB1aW50MzJfdCBoYW5kbGU7ICAgICAgICAgICAgICAgIC8qIFN5c3RlbSBoYW5kbGUuICovCisgICAgICAgIHVpbnQxNl90IGNvbXBfc3RhdHVzOyAgICAgICAgICAgLyogQ29tcGxldGlvbiBzdGF0dXMuICovCisgICAgICAgIHVpbnQxNl90IHRpbWVvdXQ7ICAgICAgICAgICAgICAgLyogdGltZW91dCAqLworICAgICAgICB1aW50MTZfdCBhZGltX3RhZ2dpbmdfbW9kZTsKKworICAgICAgICB1aW50MTZfdCB2ZnBvcnRfaWQ7CisgICAgICAgIHVpbnQzMl90IGV4Y2hfYWRkcjsKKworICAgICAgICB1aW50MTZfdCBucG9ydF9oYW5kbGU7ICAgICAgICAgIC8qIE5fUE9SVCBoYW5kbGUuICovCisgICAgICAgIHVpbnQxNl90IGNvbnRyb2xfZmxhZ3M7CisgICAgICAgIHVpbnQzMl90IGlvX3BhcmFtZXRlcl8wOworICAgICAgICB1aW50MzJfdCBpb19wYXJhbWV0ZXJfMTsKKyAgICAgICAgdWludDMyX3QgdHhfYWRkcmVzc1syXTsgICAgICAgICAvKiBEYXRhIHNlZ21lbnQgMCBhZGRyZXNzLiAqLworICAgICAgICB1aW50MzJfdCB0eF9sZW47ICAgICAgICAgICAgICAgIC8qIERhdGEgc2VnbWVudCAwIGxlbmd0aC4gKi8KKyAgICAgICAgdWludDMyX3QgcnhfYWRkcmVzc1syXTsgICAgICAgICAvKiBEYXRhIHNlZ21lbnQgMSBhZGRyZXNzLiAqLworICAgICAgICB1aW50MzJfdCByeF9sZW47ICAgICAgIC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