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5vYXNpcy1vcGVuLm9yZy9kb2Nib29rL3htbC80LjEuMi9kb2Nib29reC5kdGQiIFtdPgorCis8Ym9vayBpZD0idzFpZCI+CisgIDxib29raW5mbz4KKyAgICA8dGl0bGU+VzE6IERhbGxhcycgMS13aXJlIGJ1czwvdGl0bGU+CisKKyAgICA8YXV0aG9yZ3JvdXA+CisgICAgICA8YXV0aG9yPgorICAgICAgICA8Zmlyc3RuYW1lPkRhdmlkPC9maXJzdG5hbWU+CisgICAgICAgIDxzdXJuYW1lPkZyaWVzPC9zdXJuYW1lPgorICAgICAgICA8YWZmaWxpYXRpb24+CisgICAgICAgICAgPGFkZHJlc3M+CisgICAgICAgICAgICA8ZW1haWw+RGF2aWRARnJpZXMubmV0PC9lbWFpbD4KKyAgICAgICAgICA8L2FkZHJlc3M+CisgICAgICAgIDwvYWZmaWxpYXRpb24+CisgICAgICA8L2F1dGhvcj4KKworICAgIDwvYXV0aG9yZ3JvdXA+CisKKyAgICA8Y29weXJpZ2h0PgorICAgICAgPHllYXI+MjAxMzwveWVhcj4KKyAgICAgIDwhLS0KKyAgICAgIDxob2xkZXI+PC9ob2xkZXI+CisgICAgICAtLT4KKyAgICA8L2NvcHlyaWdodD4KKworICAgIDxsZWdhbG5vdGljZT4KKyAgICAgIDxwYXJhPgorICAgICAgICBUaGlzIGRvY3VtZW50YXRpb24gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUKKyAgICAgICAgaXQgYW5kL29yIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYworICAgICAgICBMaWNlbnNlIHZlcnNpb24gMi4KKyAgICAgIDwvcGFyYT4KKworICAgICAgPHBhcmE+CisgICAgICAgIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUKKyAgICAgICAgdXNlZnVsLCBidXQgV0lUSE9VV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gorCisgICAgPC9zZWN0MT4KKworCisgIDwvY2hhcHRlcj4KKworPC9ib29rPgpkaWZmIC0tZ2l0IGEvRG9jdW1lbnRhdGlvbi9Eb2NCb29rL3dyaXRpbmctYW4tYWxzYS1kcml2ZXIudG1wbCBiL0RvY3VtZW50YXRpb24vRG9jQm9vay93cml0aW5nLWFuLWFsc2EtZHJpdmVyLnRtcGwKaW5kZXggMDY3NDFlOS4uZDAwNTZhNCAxMDA2NDQKLS0tIGEvRG9jdW1lbnRhdGlvbi9Eb2NCb29rL3dyaXRpbmctYW4tYWxzYS1kcml2ZXIudG1wbAorKysgYi9Eb2N1bWVudGF0aW9uL0RvY0Jvb2svd3JpdGluZy1hbi1hbHNhLWRyaXZlci50bXBsCkBAIC00NjgsOCArNDY4LDYgQEAKICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CiAgICAgICAgICAgfQogCi0gICAgICAgICAgc25kX2NhcmRfc2V0X2RldihjYXJkLCAmcGNpLT5kZXYpOwotCiAgICAgICAgICAgKnJjaGlwID0gY2hpcDsKICAgICAgICAgICByZXR1cm4gMDsKICAgfQpAQCAtNDkyLDcgKzQ5MCw4IEBACiAgICAgICAgICAgfQogCiAgICAgICAgICAgLyogKDIpICovCi0gICAgICAgICAgZXJyID0gc25kX2NhcmRfY3JlYXRlKGluZGV4W2Rldl0sIGlkW2Rldl0sIFRISVNfTU9EVUxFLCAwLCAmY2FyZCk7CisgICAgICAgICAgZXJyID0gc25kX2NhcmRfbmV3KCZwY2ktPmRldiwgaW5kZXhbZGV2XSwgaWRbZGV2XSwgVEhJU19NT0RVTEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICZjYXJkKTsKICAgICAgICAgICBpZiAoZXJyIDwgMCkKICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CiAKQEAgLTU5MSw3ICs1OTAsOCBAQAogICBzdHJ1Y3Qgc25kX2NhcmQgKmNhcmQ7CiAgIGludCBlcnI7CiAgIC4uLi4KLSAg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xzID0gPDA+OworCQlyZWcgPSA8MD47CisKKyAgICAgICAgICAgICAgICBlbmRwb2ludEAwIHsKKwkJCXJlZyA9IDwwPjsKKwkJCS4uLgorCQl9OworICAgICAgICAgICAgICAgIGVuZHBvaW50QDEgeworCQkJcmVnID0gPDE+OworCQkJLi4uCisJCX07CisgICAgICAgIH07CisKKyAgICAgICAgcG9ydEAxIHsKKwkJcmVnID0gPDE+OworCisJCWVuZHBvaW50IHsgLi4uIH07CisJfTsKK307CisKK0FsbCAncG9ydCcgbm9kZXMgY2FuIGJlIGdyb3VwZWQgdW5kZXIgYW4gb3B0aW9uYWwgJ3BvcnRzJyBub2RlLCB3aGljaAorYWxsb3dzIHRvIHNwZWNpZnkgI2FkZHJlc3MtY2VsbHMsICNzaXplLWNlbGxzIHByb3BlcnRpZXMgZm9yIHRoZSAncG9ydCcKK25vZGVzIGluZGVwZW5kZW50bHkgZnJvbSBhbnkgb3RoZXIgY2hpbGQgZGV2aWNlIG5vZGVzIGEgZGV2aWNlIG1pZ2h0CitoYXZlLgorCitkZXZpY2UgeworICAgICAgICAuLi4KKyAgICAgICAgcG9ydHMgeworICAgICAgICAgICAgICAgICNhZGRyZXNzLWNlbGxzID0gPDE+OworICAgICAgICAgICAgICAgICNzaXplLWNlbGxzID0gPDA+OworCisgICAgICAgICAgICAgICAgcG9ydEAwIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC4uLgorICAgICAgICAgICAgICAgICAgICAgICAgZW5kcG9pbnRAMCB7IC4uLiB9OworICAgICAgICAgICAgICAgICAgICAgICAgZW5kcG9pbnRAMSB7IC4uLiB9OworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBwb3J0QDEgeyAuLi4gfTsKKyAgICAgICAgfTsKK307CisKK0xpbmtzIGJldHdlZW4gZW5kcG9pbnRzCistLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitFYWNoIGVuZHBvaW50IHNob3VsZCBjb250YWluIGEgJ3JlbW90ZS1lbm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iBhbmQgZ2l2ZW4KK29ubHkgZm9yIG1vcmUgZGV0YWlsZWQgZGVzY3JpcHRpb24gaW4gdGhpcyBkb2N1bWVudC4KKworbmFtZSAgICAgICAgICBwaW5zICAgICBmdW5jdGlvbnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CittcHAwICAgICAgICAgIDAgICAgICAgIGdwaW8sIGRldihhZDIpLCBzcGkwKGNzMSksIHNwaTEoY3MxKQorbXBwMSAgICAgICAgICAxICAgICAgICBncGlvLCBkZXYoYWQzKSwgc3BpMChtb3NpKSwgc3BpMShtb3NpKQorbXBwMiAgICAgICAgICAyICAgICAgICBncGlvLCBkZXYoYWQ0KSwgcHRwKGV2ZW50cmVxKSwgbGVkKGMwKSwgYXVkaW8oc2RpKQorbXBwMyAgICAgICAgICAzICAgICAgICBncGlvLCBkZXYoYWQ1KSwgcHRwKHRyaWdnZW4pLCBsZWQocDMpLCBhdWRpbyhtY2xrKQorbXBwNCAgICAgICAgICA0ICAgICAgICBncGlvLCBkZXYoYWQ2KSwgc3BpMChtaXNvKSwgc3BpMShtaXNvKQorbXBwNSAgICAgICAgICA1ICAgICAgICBncGlvLCBkZXYoYWQ3KSwgc3BpMChjczIpLCBzcGkxKGNzMikKK21wcDYgICAgICAgICAgNiAgICAgICAgZ3BpbywgZGV2KGFkMCksIGxlZChwMSksIGF1ZGlvKHJjbGspCittcHA3ICAgICAgICAgIDcgICAgICAgIGdwaW8sIGRldihhZDEpLCBwdHAoY2xrKSwgbGVkKHAyKSwgYXVkaW8oZXh0Y2xrKQorbXBwOCAgICAgICAgICA4ICAgICAgICBncGlvLCBkZXYgKGJvb3RjcyksIHNwaTAoY3MwKSwgc3BpMShjczApCittcHA5ICAgICAgICAgIDkgICAgICAgIGdwaW8sIG5mKHdlbiksIHNwaTAoc2NrKSwgc3BpMShzY2spCittcHAxMCAgICAgICAgMTAgICAgICAgIGdwaW8sIG5mKHJlbiksIGRyYW0odnR0Y3RybCksIGxlZChjMSkKK21wcDExICAgICAgICAxMSAgICAgICAgZ3BpbywgZGV2KGEwKSwgbGVkKGMyKSwgYXVkaW8oc2RvKQorbXBwMTIgICAgICAgIDEyICAgICAgICBncGlvLCBkZXYoYTEpLCBhdWRpbyhiY2xrKQorbXBwMTMgICAgICAgIDEzICAgICAgICBncGlvLCBkZXYocmVhZHluKSwgcGNpZTAocnN0b3V0biksIHBjaWUxKHJzdG91dG4pCittcHAxNCAgICAgICAgMTQgICAgICAgIGdwaW8sIGkyYzAoc2RhKSwgdWFydDEodHhkKQorbXBwMTUgICAgICAgIDE1ICAgICAgICBncGlvLCBpMmMwKHNjayksIHVhcnQxKHJ4ZCkKK21wcDE2ICAgICAgICAxNiAgICAgICAgZ3BpbywgdWFydDAodHhkKQorbXBwMTcgICAgICAgIDE3ICAgICAgICBncGlvLCB1YXJ0MChyeGQpCittcHAxOCAgICAgICAgMTggICAgICAgIGdwaW8sIHRkbShpbnRuKQorbXBwMTkgICAgICAgIDE5ICAgICAgICBncGlvLCB0ZG0ocnN0bikKK21wcDIwICAgICAgICAyMCAgICAgICAgZ3BpbywgdGRtKHBjbGspCittcHAyMSAgICAgICAgMjEgICAgICAgIGdwaW8sIHRkbShmc3luYykKK21wcDIyICAgICAgICAyMiAgICAgICAgZ3BpbywgdGRtKGRyeCkKK21wcDIzICAgICAgICAyMyAgICAgICAgZ3BpbywgdGRtKGR0eCkKK21wcDI0ICAgICAgICAyNCAgICAgICAgZ3BpbywgbGVkKHAwKSwgZ2UxKHJ4ZDApLCBzZChjbWQpLCB1YXJ0MChydHMpCittcHAyNSAgICAgICAgMjUgICAgICAgIGdwaW8sIGxlZChwMiksIGdlMShyeGQxKSwgc2QoZDApLCB1YXJ0MChjdHMpCittcHAyNiAgICAgICAgMjYgICAgICAgIGdwaW8sIHBjaWUwKGNsa3JlcSksIGdlMShyeGQyKSwgc2QoZDIpLCB1YXJ0MShydHMpCittcHAyNyAgICAgICAgMjcgICAgICAgIGdwaW8sIHBjaWUxKGNsa3JlcSksIGdlMShyeGQzKSwgc2QoZDEpLCB1YXJ0MShjdHMpCittcHAyOCAgICAgICAgMjggICAgICAgIGdwaW8sIGxlZChwMyksIGdlMSh0eGN0bCksIHNkKGNsaykKK21wcDI5ICAgICAgICAyOSAgICAgICAgZ3BpbywgcGNpZTEoY2xrcmVxKSwgZ2UxKHJ4Y2xrKSwgc2QoZDMpCittcHAzMCAgICAgICAgMzAgICAgICAgIGdwaW8sIGdlMSh0eGQwKSwgc3BpMShjczApCittcHAzMSAgICAgICAgMzEgICAgICAgIGdwaW8sIGdlMSh0eGQxKSwgc3BpMShtb3NpKQorbXBwMzIgICAgICAgIDMyICAgICAgICBncGlvLCBnZTEodHhkMiksIHNwaTEoc2NrKSwgcHRwKHRyaWdnZW4pCittcHAzMyAgICAgICAgMzMgICAgICAgIGdwaW8sIGdlMSh0eGQzKSwgc3BpMShtaXNvKQorbXBwMzQgICAgICAgIDM0ICAgICAgICBncGlvLCBnZTEodHhjbGtvdXQpLCBzcGkxKHNjaykKK21wcDM1ICAgICAgICAzNSAgICAgICAgZ3BpbywgZ2UxKHJ4Y3RsKSwgc3BpMShjczEpLCBzcGkwKGNzMikKK21wcDM2ICAgICAgICAzNiAgICAgICAgZ3BpbywgcGNpZTAoY2xrcmVxKQorbXBwMzcgICAgICAgIDM3ICAgICAgICBncGlvLCBwY2llMChjbGtyZXEpLCB0ZG0oaW50biksIGdlKG1kYykKK21wcDM4ICAgICAgICAzOCAgICAgICAgZ3BpbywgcGNpZTEoY2xrcmVxKSwgZ2UobWRpbykKK21wcDM5ICAgICAgICAzOSAgICAgICAgZ3BpbywgcmVmKGNsa291dCkKK21wcDQwICAgICAgICA0MCAgICAgICAgZ3BpbywgdWFydDEodHhkKQorbXBwNDEgICAgICAgIDQxICAgICAgICBncGlvLCB1YXJ0MShyeGQpCittcHA0MiAgICAgICAgNDIgICAgICAgIGdwaW8sIHNwaT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WRhIDM4MC8zODUgU29DIHBpbmN0cmwgZHJpdmVyIGZvciBtcHAKKworUGxlYXNlIHJlZmVyIHRvIG1hcnZlbGwsbXZlYnUtcGluY3RybC50eHQgaW4gdGhpcyBkaXJlY3RvcnkgZm9yIGNvbW1vbiBiaW5kaW5nCitwYXJ0IGFuZCB1c2FnZS4KKworUmVxdWlyZWQgcHJvcGVydGllczoKKy0gY29tcGF0aWJsZTogIm1hcnZlbGwsODhmNjgxMC1waW5jdHJsIiwgIm1hcnZlbGwsODhmNjgyMC1waW5jdHJsIiBvcgorICAibWFydmVsbCw4OGY2ODI4LXBpbmN0cmwiIGRlcGVuZGluZyBvbiB0aGUgc3BlY2lmaWMgdmFyaWFudCBvZiB0aGUKKyAgU29DIGJlaW5nIHVzZWQuCistIHJlZzogcmVnaXN0ZXIgc3BlY2lmaWVyIG9mIE1QUCByZWdpc3RlcnMKKworQXZhaWxhYmxlIG1wcCBwaW5zL2dyb3VwcyBhbmQgZnVuY3Rpb25zOgorTm90ZTogYnJhY2tldHMgKHgpIGFyZSBub3QgcGFydCBvZiB0aGUgbXBwIG5hbWUgZm9yIG1hcnZlbGwsZnVuY3Rpb24gYW5kIGdpdmVuCitvbmx5IGZvciBtb3JlIGRldGFpbGVkIGRlc2NyaXB0aW9uIGluIHRoaXMgZG9jdW1lbnQuCisKK25hbWUgICAgICAgICAgcGlucyAgICAgZnVuY3Rpb25zCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorbXBwMCAgICAgICAgICAwICAgICAgICBncGlvLCB1YTAocnhkKQorbXBwMSAgICAgICAgICAxICAgICAgICBncGlvLCB1YTAodHhkKQorbXBwMiAgICAgICAgICAyICAgICAgICBncGlvLCBpMmMwKHNjaykKK21wcDMgICAgICAgICAgMyAgICAgICAgZ3BpbywgaTJjMChzZGEpCittcHA0ICAgICAgICAgIDQgICAgICAgIGdwaW8sIGdlKG1kYyksIHVhMSh0eGQpLCB1YTAocnRzKQorbXBwNSAgICAgICAgICA1ICAgICAgICBncGlvLCBnZShtZGlvKSwgdWExKHJ4ZCksIHVhMChjdHMpCittcHA2ICAgICAgICAgIDYgICAgICAgIGdwaW8sIGdlMCh0eGNsa291dCksIGdlMChjcnMpLCBkZXYoY3MzKQorbXBwNyAgICAgICAgICA3ICAgICAgICBncGlvLCBnZTAodHhkMCksIGRldihhZDkpCittcHA4ICAgICAgICAgIDggICAgICAgIGdwaW8sIGdlMCh0eGQxKSwgZGV2KGFkMTApCittcHA5ICAgICAgICAgIDkgICAgICAgIGdwaW8sIGdlMCh0eGQyKSwgZGV2KGFkMTEpCittcHAxMCAgICAgICAgIDEwICAgICAgIGdwaW8sIGdlMCh0eGQzKSwgZGV2KGFkMTIpCittcHAxMSAgICAgICAgIDExICAgICAgIGdwaW8sIGdlMCh0eGN0bCksIGRldihhZDEzKQorbXBwMTIgICAgICAgICAxMiAgICAgICBncGlvLCBnZTAocnhkMCksIHBjaWUwKHJzdG91dCksIHBjaWUxKHJzdG91dCkgWzFdLCBzcGkwKGNzMSksIGRldihhZDE0KQorbXBwMTMgICAgICAgICAxMyAgICAgICBncGlvLCBnZTAocnhkMSksIHBjaWUwKGNsa3JlcSksIHBjaWUxKGNsa3JlcSkgWzFdLCBzcGkwKGNzMiksIGRldihhZDE1KQorbXBwMTQgICAgICAgICAxNCAgICAgICBncGlvLCBnZTAocnhkMiksIHB0cChjbGspLCBtKHZ0dF9jdHJsKSwgc3BpMChjczMpLCBkZXYod2VuMSkKK21wcDE1ICAgICAgICAgMTUgICAgICAgZ3BpbywgZ2UwKHJ4ZDMpLCBnZShtZGMgc2xhdmUpLCBwY2llMChyc3RvdXQpLCBzcGkwKG1vc2kpLCBwY2llMShyc3RvdXQpIFsxXQorbXBwMTYgICAgICAgICAxNiAgICAgICBncGlvLCBnZTAocnhjdGwpLCBnZShtZGlvIHNsYXZlKSwgbShkZWNjX2VyciksIHNwaTAobWlzbyksIHBjaWUwKGNsa3JlcSkKK21wcDE3ICAgICAgICAgMTcgICAgICAgZ3BpbywgZ2UwKHJ4Y2xrKSwgcHRwKGNsayksIHVhMShyeGQpLCBzcGkwKHNjayksIHNhdGExKHByc250KQorbXBwMTggICAgICAgICAxOCAgICAgICBncGlvLCBnZTAocnhlcnIpLCBwdHAodHJpZ19nZW4pLCB1YTEodHhkKSwgc3BpMChjczApLCBwY2llMShyc3RvdXQpIFsxXQorbXBwMTkgICAgICAgICAxOSAgICAgICBncGlvLCBnZTAoY29sKSwgcHRwKGV2ZW50X3JlcSksIHBjaWUwKGNsa3JlcSksIHNhdGExKHByc250KSwgdWEwKGN0cykKK21wcDIwICAgICAgICAgMjAgICAgICAgZ3BpbywgZ2UwKHR4Y2xrKSwgcHRwKGNsayksIHBjaWUxKHJzdG91dCkgWzFdLCBzYXRhMChwcnNudCksIHVhMChydHMpCittcHAyMSAgICAgICAgIDIxICAgICAgIGdwaW8sIHNwaTAoY3MxKSwgZ2UxKHJ4ZDApLCBzYXRhMChwcnNudCksIHNkMChjbWQpLCBkZXYoYm9vdGNzKQorbXBwMjIgICAgICAgICAyMiAgICAgICBncGlvLCBzcGkwKG1vc2kpLCBkZXYoYWQwKQorbXBwMjMgICAgICAgICAyMyAgICAgICBncGlvLCBzcGkwKHNjayksIGRldihhZDIpCittcHAyNCAgICAgICAgIDI0ICAgICAgIGdwaW8sIHNwaTAobWlzbyksIHVhMChjdHMpLCB1YTEocnhkKSwgc2QwKGQ0KSwgZGV2KHJlYWR5KQorbXBwMjUgICAgICAgICAyNSAgICAgICBncGlvLCBzcGkwKGNzMCksIHVhMChydHMpLCB1YTEodHhkKSwgc2QwKGQ1KSwgZGV2KGNzMCkKK21wcDI2ICAgICAgICAgMjYgICAgICAgZ3Bpbywgc3BpMChjczIpLCBpMmMxKHNjayksIHNkMChkNiksIGRldihjczEpCittcHAyNyAgICAgICAgIDI3ICAgICAgIGdwaW8sIHNwaTAoY3MzKSwgZ2UxKHR4Y2xrb3V0KSwgaTJjMShzZGEpLCBzZDAoZDcpLCBkZXYoY3MyKQorbXBwMjggICAgICAgICAyOCAgICAgICBncGlvLCBnZTEodHhkMCksIHNkMChjbGspLCBkZXYoYWQ1KQorbXBwMjkgICAgICAgICAyOSAgICAgICBncGlvLCBnZTEodHhkMSksIGRldihhbGUwKQorbXBwMzAgICAgICAgICAzMCAgICAgICBncGlvLCBnZTEodHhkMiksIGRldihvZW4pCittcHAzMSAgICAgICAgIDMxICAgICAgIGdwaW8sIGdlMSh0eGQzKSwgZGV2KGFsZTEpCittcHAzMiAgICAgICAgIDMyICAgICAgIGdwaW8sIGdlMSh0eGN0bCksIGRldih3ZW4wKQorbXBwMzMgICAgICAgICAzMyAgICAgICBncGlvLCBtKGRlY2NfZXJyKSwgZGV2KGFkMykKK21wcDM0ICAgICAgICAgMzQgICAgICAgZ3BpbywgZGV2KGFkMSkKK21wcDM1ICAgICAgICAgMzUgICAgICAgZ3BpbywgcmVmKGNsa19vdXQxKSwgZGV2KGExKQorbXBwMzYgICAgICAgICAzNiAgICAgICBncGlvLCBwdHAodHJpZ19nZW4pLCBkZXYoYTApCittcHAzNyAgICAgICAgIDM3ICAgICAgIGdwaW8sIHB0cChjbGspLCBnZTEocnhjbGspLCBzZDAoZDMpLCBkZXYoYWQ4KQorbXBwMzggICAgICAgICAzOCAgICAgICBncGlvLCBwdHAoZXZlbnRfcmVxKSwgZ2UxKHJ4ZDEpLCByZWYoY2xrX291dDApLCBzZDAoZDApLCBkZXYoYWQ0KQorbXBwMzkgICAgICAgICAzOSAgICAgICBncGlvLCBpMmMxKHNjayksIGdlMShyeGQyKSwgdWEwKGN0cyksIHNkMChkMSksIGRldihhMikKK21wcDQwICAgICAgICAgNDAgICAgICAgZ3BpbywgaTJjMShzZGEpLCBnZTEocnhkMyksIHVhMChydHMpLCBzZDAoZDIpLCBkZXYoYWQ2KQorbXBwNDEgICAgICAgICA0MSAgICAgICBncGlvLCB1YTEocnhkKSwgZ2UxKHJ4Y3RsKSwgdWEwKGN0cyksIHNwaTEoY3MzKSwgZGV2KGJ1cnN0L2xhc3QpCittcHA0MiAgICAgICAgIDQyICAgICAgIGdwaW8sIHVhMSh0eGQpLCB1YTAocnRzKSwgZGV2KGFkNykKK21wcDQzICAgICAgICAgNDMgICAgICAgZ3BpbywgcGNpZTAoY2xrcmVxKSwgbSh2dHRfY3RybCksIG0oZGVjY19lcnIpLCBwY2llMChyc3RvdXQpLCBkZXYoY2xrb3V0KQorbXBwNDQgICAgICAgICA0NCAgICAgICBncGlvLCBzYXRhMChwcnNudCksIHNhdGExKHByc250KSwgc2F0YTIocHJzbnQpIFsyXSwgc2F0YTMocHJzbnQpIFszXSwgcGNpZTAocnN0b3V0KQorbXBwNDUgICAgICAgICA0NSAgICAgICBncGlvLCByZWYoY2xrX291dDApLCBwY2llMChyc3RvdXQpLCBwY2llMShyc3RvdXQpIFsxXSwgcGNpZTIocnN0b3V0KSwgcGNpZTMocnN0b3V0KQorbXBwNDYgICAgICAgICA0NiAgICAgICBncGlvLCByZWYoY2xrX291dDEpLCBwY2llMChyc3RvdXQpLCBwY2llMShyc3RvdXQpIFsxXSwgcGNpZTIocnN0b3V0KSwgcGNpZTMocnN0b3V0KQorbXBwNDcgICAgICAgICA0NyAgICAgICBncGlvLCBzYXRhMChwcnNudCksIHNhdGExKHByc250KSwgc2F0YTIocHJzbnQpIFsyXSwgc3BpMShjczIpLCBzYXRhMyhwcnNudCkgWzJdCittcHA0OCAgICAgICAgIDQ4ICAgICAgIGdwaW8sIHNhdGEwKHByc250KSwgbSh2dHRfY3RybCksIHRkbTJjKHBjbGspLCBhdWRpbyhtY2xrKSwgc2QwKGQ0KQorbXBwNDkgICAgICAgICA0OSAgICAgICBncGlvLCBzYXRhMihwcnNudCkgWzJdLCBzYXRhMyhwcnNudCkgWzJdLCB0ZG0yYyhmc3luYyksIGF1ZGlvKGxyY2xrKSwgc2QwKGQ1KQorbXBwNTAgICAgICAgICA1MCAgICAgICBncGlvLCB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XNlZCBmb3IgRERDIEVESUQgcHJvYmluZworCitleGFtcGxlOgorCisJZ3ByOiBpb211eGMtZ3ByQDAyMGUwMDAwIHsKKwkJLyogLi4uICovCisJfTsKKworICAgICAgICBoZG1pOiBoZG1pQDAxMjAwMDAgeworICAgICAgICAgICAgICAgICNhZGRyZXNzLWNlbGxzID0gPDE+OworICAgICAgICAgICAgICAgICNzaXplLWNlbGxzID0gPDA+OworICAgICAgICAgICAgICAgIGNvbXBhdGlibGUgPSAiZnNsLGlteDZxLWhkbWkiOworICAgICAgICAgICAgICAgIHJlZyA9IDwweDAwMTIwMDAwIDB4OTAwMD47CisgICAgICAgICAgICAgICAgaW50ZXJydXB0cyA9IDwwIDExNSAweDA0PjsKKyAgICAgICAgICAgICAgICBncHIgPSA8Jmdwcj47CisgICAgICAgICAgICAgICAgY2xvY2tzID0gPCZjbGtzIDEyMz4sIDwmY2xrcyAxMjQ+OworICAgICAgICAgICAgICAgIGNsb2NrLW5hbWVzID0gImlhaGIiLCAiaXNmciI7CisgICAgICAgICAgICAgICAgZGRjLWkyYy1idXMgPSA8JmkyYzI+OworCisgICAgICAgICAgICAgICAgcG9ydEAwIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZyA9IDwwPjsKKworICAgICAgICAgICAgICAgICAgICAgICAgaGRtaV9tdXhfMDogZW5kcG9pbnQgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdGUtZW5kcG9pbnQgPSA8JmlwdTFfZGkwX2hkbWk+OworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgcG9ydEAxIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZyA9IDwxPjsKKworICAgICAgICAgICAgICAgICAgICAgICAgaGRtaV9tdXhfMTogZW5kcG9pbnQgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdGUtZW5kcG9pbnQgPSA8JmlwdTFfZGkxX2hkb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OVD15CitDT05GSUdfTVREPXkKK0NPTkZJR19NVERfQ01ETElORV9QQVJUUz15CitDT05GSUdfTVREX0JMT0NLPXkKK0NPTkZJR19NVERfQ0ZJPXkKK0NPTkZJR19NVERfQ0ZJX0FEVl9PUFRJT05TPXkKK0NPTkZJR19NVERfQ0ZJX0FNRFNURD15CitDT05GSUdfTVREX1BIWVNNQVA9eQorQ09ORklHX01URF9NMjVQODA9eQorQ09ORklHX01URF9TU1QyNUw9eQorQ09ORklHX01URF9OQU5EPXkKK0NPTkZJR19NVERfTkFORF9FQ0NfQkNIPXkKK0NPTkZJR19NVERfTkFORF9BVTE1NTA9eQorQ09ORklHX01URF9OQU5EX1BMQVRGT1JNPXkKK0NPTkZJR19FRVBST01fQVQyND15CitDT05GSUdfRUVQUk9NX0FUMjU9eQorQ09ORklHX1NDU0lfVEdUPXkKK0NPTkZJR19CTEtfREVWX1NEPXkKK0NPTkZJR19DSFJfREVWX1NHPXkKK0NPTkZJR19TQ1NJX01VTFRJX0xVTj15CitDT05GSUdfQVRBPXkKK0NPTkZJR19QQVRBX0hQVDM3WD15CitDT05GSUdfUEFUQV9IUFQzWDJOPXkKK0NPTkZJR19QQVRBX1BDTUNJQT15CitDT05GSUdfUEFUQV9QTEFURk9STT15CitDT05GSUdfTkVUREVWSUNFUz15CitDT05GSUdfTkxNT049eQorQ09ORklHX1BDTUNJQV8zQzU4OT15CitDT05GSUdfTUlQU19BVTFYMDBfRU5FVD15CitDT05GSUdfU01DOTFYPXkKK0NPTkZJR19TTVNDOTExWD15CitDT05GSUdfQU1EX1BIWT15CitDT05GSUdfU01TQ19QSFk9eQorQ09ORklHX0lOUFVUX0VWREVWPXkKK0NPTkZJR19LRVlCT0FSRF9HUElPPXkKK0NPTkZJR19JTlBVVF9UT1VDSFNDUkVFTj15CitDT05GSUdfVE9VQ0hTQ1JFRU5fQURTNzg0Nj15CitDT05GSUdfVE9VQ0hTQ1JFRU5fV005N1hYPXkKK0NPTkZJR19JTlBVVF9NS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K0NPTkZJR19TUVVBU0hGU19MWk89eQorQ09ORklHX1NRVUFTSEZTX1haPXkKK0NPTkZJR19GMkZTX0ZTPXkKK0NPTkZJR19GMkZTX0ZTX1NFQ1VSSVRZPXkKK0NPTkZJR19ORlNfRlM9eQorQ09ORklHX05GU19WM19BQ0w9eQorQ09ORklHX05GU19WND15CitDT05GSUdfTkZTX1Y0XzE9eQorQ09ORklHX05GU19WNF8yPXkKK0NPTkZJR19ORlNfVjRfMV9JTVBMRU1FTlRBVElPTl9JRF9ET01BSU49ImxvY2FsIgorQ09ORklHX05GU19WNF8xX01JR1JBVElPTj15CitDT05GSUdfTkZTRD15CitDT05GSUdfTkZTRF9WM19BQ0w9eQorQ09ORklHX05GU0RfVjQ9eQorQ09ORklHX05MU19DT0RFUEFHRV80Mzc9eQorQ09ORklHX05MU19DT0RFUEFHRV84NTA9eQorQ09ORklHX05MU19DT0RFUEFHRV84NTI9eQorQ09ORklHX05MU19DT0RFUEFHRV8xMjUwPXkKK0NPTkZJR19OTFNfQVNDSUk9eQorQ09ORklHX05MU19JU084ODU5XzE9eQorQ09ORklHX05MU19JU084ODU5XzI9eQorQ09ORklHX05MU19JU084ODU5XzE1PXkKK0NPTkZJR19OTFNfVVRGOD15CitDT05GSUdfTUFHSUNfU1lTUlE9eQorQ09ORklHX1NFQ1VSSVRZRlM9eQorQ09ORklHX0NSWVBUT19VU0VSPXkKK0NPTkZJR19DUllQVE9fQ1JZUFREPXkKK0NPTkZJR19DUllQVE9fVVNFUl9BUElfSEFTSD15CitDT05GSUdfQ1JZUFRPX1VTRVJfQVBJX1NLQ0lQSEVSPXkKK0NPTkZJR19DUkMzMl9TTElDRUJZND15CitDT05GSUdfRk9OVFM9eQorQ09ORklHX0ZPTlRfOHg4PXkKZGlmZiAtLWdpdCBhL2FyY2gvbWlwcy9jb25maWdzL2xvb25nc29uM19kZWZjb25maWcgYi9hcmNoL21pcHMvY29uZmlncy9sb29uZ3NvbjNfZGVmY29uZmlnCm5ldyBm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kJCSIxOlx0InVzZXJfbHdsKCIlMCIsICIoJTIpIikiXG4iICAgIFwKKwkJCSIyOlx0InVzZXJfbHdyKCIlMCIsICIzKCUyKSIpIlxuXHQiIFwKIAkJCSJsaVx0JTEsIDBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIzOlxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIuaW5zblxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTE0OSw4ICsxNTAsOCBAQAogI2RlZmluZSAgICAgTG9hZEhXVShhZGRyLCB2YWx1ZSwgcmVzKSBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5zZXRcdG5vYXRcbiIgICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsYnVcdCUwLCAwKCUyKVxuIiAgICAgICAgICAgICAgXAotCQkJIjI6XHRsYnVcdCQxLCAxKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sYnUoIiUwIiwgIjAoJTIpIikiXG4iICAgXAorCQkJIjI6XHQidXNlcl9sYnUoIiQxIiwgIjEoJTIpIikiXG5cdCIgXAogCQkJInNsbFx0JTAsIDB4OFxuXHQiICAgICAgICAgICAgICAgICAgXAogCQkJIm9yXHQlMCwgJDFcblx0IiAgICAgICAgICAgICAgICAgICAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMTcwLDggKzE3MSw4IEBACiAKICNkZWZpbmUgICAgIExvYWRXVShhZGRyLCB2YWx1ZSwgcmVzKSAgXAogCQlfX2FzbV9fIF9fdm9sYXRpbGVfXyAoICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCSIxOlx0bHdsXHQlMCwgKCUyKVxuIiAgICAgICAgICAgICAgIFwKLQkJCSIyOlx0bHdyXHQlMCwgMyglMilcblx0IiAgICAgICAgICAgIFwKKwkJCSIxOlx0InVzZXJfbHdsKCIlMCIsICIoJTIpIikiXG4iICAgIFwKKwkJCSIyOlx0InVzZXJfbHdyKCIlMCIsICIzKCUyKSIpIlxuXHQiIFwKIAkJCSJkc2xsXHQlMCwgJTAsIDMyXG5cdCIgICAgICAgICAgICAgIFwKIAkJCSJkc3JsXHQlMCwgJTAsIDMyXG5cdCIgICAgICAgICAgICAgIFwKIAkJCSJsaVx0JTEsIDBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTIwOSw5ICsyMTAsOSBAQAogI2RlZmluZSAgICAgU3RvcmVIVyhhZGRyLCB2YWx1ZSwgcmVzKSBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5zZXRcdG5vYXRcbiIgICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRzYlx0JTEsIDEoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9zYigiJTEiLCAiMSglMikiKSJcbiIgICAgXAogCQkJInNybFx0JDEsICUxLCAweDhcbiIgICAgICAgICAgICAgICAgXAotCQkJIjI6XHRzYlx0JDEsIDAoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjI6XHQidXNlcl9zYigiJDEiLCAiMCglMikiKSJcbiIgICAgXAogCQkJIi5zZXRcdGF0XG5cdCIgICAgICAgICAgICAgICAgICAgICAgXAogCQkJImxpXHQlMCwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMjI5LDggKzIzMCw4IEBACiAKICNkZWZpbmUgICAgIFN0b3JlVyhhZGRyLCB2YWx1ZSwgcmVzKSAgXAogCQlfX2FzbV9fIF9fdm9sYXRpbGVfXyAoICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCSIxOlx0c3dsXHQlMSwoJTIpXG4iICAgICAgICAgICAgICAgIFwKLQkJCSIyOlx0c3dyXHQlMSwgMyglMilcblx0IiAgICAgICAgICAgIFwKKwkJCSIxOlx0InVzZXJfc3dsKCIlMSIsICIoJTIpIikiXG4iICAgIFwKKwkJCSIyOlx0InVzZXJfc3dyKCIlMSIsICIzKCUyKSIpIlxuXHQiIFwKIAkJCSJsaVx0JTAsIDBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIzOlxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIuaW5zblxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTI2Nyw4ICsyNjgsOCBAQAogI2lmZGVmIF9fTElUVExFX0VORElBTgogI2RlZmluZSAgICAgTG9hZEhXKGFkZHIsIHZhbHVlLCByZXMpICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICgiLnNldFx0bm9hdFxuIiAgICAgICAgXAotCQkJIjE6XHRsYlx0JTAsIDEoJTIpXG4iICAgICAgICAgICAgICAgXAotCQkJIjI6XHRsYnVcdCQxLCAwKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sYigiJTAiLCAiMSglMikiKSJcbiIgICAgXAorCQkJIjI6XHQidXNlcl9sYnUoIiQxIiwgIjAoJTIpIikiXG5cdCIgXAogCQkJInNsbFx0JTAsIDB4OFxuXHQiICAgICAgICAgICAgICAgICAgXAogCQkJIm9yXHQlMCwgJDFcblx0IiAgICAgICAgICAgICAgICAgICAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMjg3LDggKzI4OCw4IEBACiAKICNkZWZpbmUgICAgIExvYWRXKGFkZHIsIHZhbHVlLCByZXMpICAgXAogCQlfX2FzbV9fIF9fdm9sYXRpbGVfXyAoICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCSIxOlx0bHdsXHQlMCwgMyglMilcbiIgICAgICAgICAgICAgIFwKLQkJCSIyOlx0bHdyXHQlMCwgKCUyKVxuXHQiICAgICAgICAgICAgIFwKKwkJCSIxOlx0InVzZXJfbHdsKCIlMCIsICIzKCUyKSIpIlxuIiAgIFwKKwkJCSIyOlx0InVzZXJfbHdyKCIlMCIsICIoJTIpIikiXG5cdCIgIFwKIAkJCSJsaVx0JTEsIDBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIzOlxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKIAkJCSIuaW5zblxuXHQiICAgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTMwNiw4ICszMDcsOCBAQAogI2RlZmluZSAgICAgTG9hZEhXVShhZGRyLCB2YWx1ZSwgcmVzKSBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5zZXRcdG5vYXRcbiIgICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsYnVcdCUwLCAxKCUyKVxuIiAgICAgICAgICAgICAgXAotCQkJIjI6XHRsYnVcdCQxLCAwKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sYnUoIiUwIiwgIjEoJTIpIikiXG4iICAgXAorCQkJIjI6XHQidXNlcl9sYnUoIiQxIiwgIjAoJTIpIikiXG5cdCIgXAogCQkJInNsbFx0JTAsIDB4OFxuXHQiICAgICAgICAgICAgICAgICAgXAogCQkJIm9yXHQlMCwgJDFcblx0IiAgICAgICAgICAgICAgICAgICAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMzI3LDggKzMyOCw4IEBACiAKICNkZWZpbmUgICAgIExvYWRXVShhZGRyLCB2YWx1ZSwgcmVzKSAgXAogCQlfX2FzbV9fIF9fdm9sYXRpbGVfXyAoICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCSIxOlx0bHdsXHQlMCwgMyglMilcbiIgICAgICAgICAgICAgIFwKLQkJCSIyOlx0bHdyXHQlMCwgKCUyKVxuXHQiICAgICAgICAgICAgIFwKKwkJCSIxOlx0InVzZXJfbHdsKCIlMCIsICIzKCUyKSIpIlxuIiAgIFwKKwkJCSIyOlx0InVzZXJfbHdyKCIlMCIsICIoJTIpIikiXG5cdCIgIFwKIAkJCSJkc2xsXHQlMCwgJTAsIDMyXG5cdCIgICAgICAgICAgICAgIFwKIAkJCSJkc3JsXHQlMCwgJTAsIDMyXG5cdCIgICAgICAgICAgICAgIFwKIAkJCSJsaVx0JTEsIDBcbiIgICAgICAgICAgICAgICAgICAgICAgIFwKQEAgLTM2Niw5ICszNjcsOSBAQAogI2RlZmluZSAgICAgU3RvcmVIVyhhZGRyLCB2YWx1ZSwgcmVzKSBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5zZXRcdG5vYXRcbiIgICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRzYlx0JTEsIDAoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9zYigiJTEiLCAiMCglMikiKSJcbiIgICAgXAogCQkJInNybFx0JDEsJTEsIDB4OFxuIiAgICAgICAgICAgICAgICAgXAotCQkJIjI6XHRzYlx0JDEsIDEoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjI6XHQidXNlcl9zYigiJDEiLCAiMSglMikiKSJcbiIgICAgXAogCQkJIi5zZXRcdGF0XG5cdCIgICAgICAgICAgICAgICAgICAgICAgXAogCQkJImxpXHQlMCwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMzg2LDggKzM4Nyw4IEBACiAKICNkZWZpbmUgICAgIFN0b3JlVyhhZGRyLCB2YWx1ZSwgcmVzKSAgXAogCQlfX2FzbV9fIF9fdm9sYXRpbGVfXyAoICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCSIxOlx0c3dsXHQlMSwgMyglMilcbiIgICAgICAgICAgICAgIFwKLQkJCSIyOl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VQMV9CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMV9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNFVDApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNFVDApLAorfTsKKworc3RhdGljIHZvaWQgKmlwaV9jbGVhcjBfcmVnc1tdID0geworCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMF9CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIENMRUFSMCksCisJKHZvaWQgKikoU01QX0NPUkVfR1JPVVAwX0JBU0UgKyBTTVBfQ09SRTFfT0ZGU0VUICsgQ0xFQVIwKSwKKwkodm9pZCAqKShTTVBfQ09SRV9HUk9VUDBfQkFTRSArIFNNUF9DT1JFMl9PRkZTRVQgKyBDTEVBUjApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMF9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIENM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01QX0NPUkUwX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMF9CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMF9CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMF9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMV9CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMV9CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMV9CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMV9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUyX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQMl9CQVNFICsgU01QX0NPUkUzX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUwX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9DT1JFX0dST1VQM19CQVNFICsgU01QX0NPUkUxX09GRlNFVCArIFNUQVRVUzApLAorCSh2b2lkICopKFNNUF9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gY29yZSAodXN1YWxseSBDb3JlIDApIGNhbgorICogc2FmZWx5IGRpc2FibGUgdGhlIGNsb2NrIG9mIHRoZSB0YXJnZXQgY29yZS4gbG9vbmdzb24zX3BsYXlfZGVhZCgpIGlzCisgKiBjYWxsZWQgdmlhIENLU0VHMSAodW5jYWNoZWQgYW5kIHVubW1hcGVkKSAqLworc3RhdGljIHZvaWQgbG9vbmdzb24zX3BsYXlfZGVhZChpbnQgKnN0YXRlX2FkZHIpCit7CisJcmVnaXN0ZXIgaW50IHZhbDsKKwlyZWdpc3RlciBsb25nIGNwdWlkLCBjb3JlLCBub2RlLCBjb3VudDsKKwlyZWdpc3RlciB2b2lkICphZGRyLCAqYmFzZSwgKmluaXRmdW5jOworCisJX19hc21fXyBfX3ZvbGF0aWxlX18oCisJCSIgICAuc2V0IHB1c2ggICAgICAgICAgICAgICAgICAgICBcbiIKKwkJIiAgIC5zZXQgbm9yZW9yZGVyICAgICAgICAgICAgICAgIFxuIgorCQkiICAgbGkgJVthZGRyXSwgMHg4MDAwMDAwMCAgICAgICAgXG4iIC8qIEtTRUcwICovCisJCSIxOiBjYWNoZSAwLCAwKCVbYWRkcl0pICAgICAgICAgICBcbiIgLyogZmx1c2ggTDEgSUNhY2hlICovCisJCSIgICBjYWNoZSAwLCAxKCVbYWRkcl0pICAgICAgICAgICBcbiIKKwkJIiAgIGNhY2hlIDAsIDIoJVthZGRyXSkgICAgICAgICAgIFxuIgorCQkiICAgY2FjaGUgMCwgMyglW2FkZHJdKSAgICAgICAgICAgXG4iCisJCSIgICBjYWNoZSAxLCAwKCVbYWRkcl0pICAgICAgICAgICBcbiIgLyogZmx1c2ggTDEgRENhY2hlICovCisJCSIgICBjYWNoZSAxLCAxKCVbYWRkcl0pICAgICAgICAgICBcbiIKKwkJIiAgIGNhY2hlIDEsIDIoJVthZGRyXSkgICAgICAgICAgIFxuIgorCQkiICAgY2FjaGUgMSwgMyglW2FkZHJdKSAgICAgICAgICAgXG4iCisJCSIgICBhZGRpdSAlW3NldHNdLCAlW3NldHNdLCAtMSAgICBcbiIKKwkJIiAgIGJuZXogICVbc2V0c10sIDFiICAgICAgICAgICAgIFxuIgorCQkiICAgYWRkaXUgJVthZGRyXSwgJVthZGRyXSwgMHgyMCAgXG4iCisJCSIgICBsaSAgICAlW3ZhbF0sIDB4NyAgICAgICAgICAgICBcbiIgLyogKnN0YXRlX2FkZHIgPSBDUFVfREVBRDsgKi8KKwkJIiAgIHN3ICAgICVbdmFsXSwgKCVbc3RhdGVfYWRkcl0pIFxuIgorCQkiICAgc3luYyAgICAgICAgICAgICAgICAgICAgICAgICAgXG4iCisJCSIgICBjYWNoZSAyMSwgKCVbc3RhdGVfYWRkcl0pICAgICBcbiIgLyogZmx1c2ggZW50cnkgb2YgKnN0YXRlX2FkZHIgKi8KKwkJIiAgIC5zZXQgcG9wICAgICAgICAgICAgICAgICAgICAgIFxuIgorCQk6IFthZGRyXSAiPSZyIiAoYWRkciksIFt2YWxdICI9JnIiICh2YWwpCisJCTogW3N0YXRlX2FkZHJdICJyIiAoc3RhdGVfYWRkciksCisJCSAgW3NldHNdICJyIiAoY3B1X2RhdGFbc21wX3Byb2Nlc3Nvcl9pZCgpXS5kY2FjaGUuc2V0cykpOworCisJX19hc21fXyBfX3ZvbGF0aWxlX18oCisJCSIgICAuc2V0IHB1c2ggICAgICAgICAgICAgICAgICAgICAgICAgXG4iCisJCSIgICAuc2V0IG5vcmVvcmRlciAgICAgICAgICAgICAgICAgICAgXG4iCisJCSIgICAuc2V0IG1pcHM2NCAgICAgICAgICAgICAgICAgICAgICAgXG4iCisJCSIgICBtZmMwICAlW2NwdWlkXSwgJDE1LCAxICAgICAgICAgICAgXG4iCisJCSIgICBhbmRpICAlW2NwdWlkXSwgMHgzZmYgICAgICAgICAgICAgXG4iCisJCSIgICBkbGkgICAlW2Jhc2VdLCAweDkwMDAwMDAwM2ZmMDEwMDAgXG4iCisJCSIgICBhbmRpICAlW2NvcmVdLCAlW2NwdWlkXSwgMHgzICAgICAgXG4iCisJCSIgICBzbGwgICAlW2NvcmVdLCA4ICAgICAgICAgICAgICAgICAgXG4iIC8qIGdldCBjb3JlIGlkICovCisJCSIgICBvciAgICAlW2Jhc2VdLCAlW2Jhc2VdLCAlW2NvcmVdICAgXG4iCisJCSIgICBhbmRpICAlW25vZGVdLCAlW2NwdWlkXSwgMHhjICAgICAgXG4iCisJCSIgICBkc2xsICAlW25vZGVdLCA0MiAgICAgICAgICAgICAgICAgXG4iIC8qIGdldCBub2RlIGlkICovCisJCSIgICBvciAgICAlW2Jhc2VdLCAlW2Jhc2VdLCAlW25vZGVdICAgXG4iCisJCSIxOiBsaSAgICAlW2NvdW50XSwgMHgxMDAgICAgICAgICAgICAgXG4iIC8qIHdhaXQgZm9yIGluaXQgbG9vcCAqLworCQkiMjogYm5leiAgJVtjb3VudF0sIDJiICAgICAgICAgICAgICAgIFxuIiAvKiBsaW1pdCBtYWlsYm94IGFjY2VzcyAqLworCQkiICAgYWRkaXUgJVtjb3VudF0sIC0xICAgICAgICAgICAgICAgIFxuIgorCQkiICAgbGQgICAgJVtpbml0ZnVuY10sIDB4MjAoJVtiYXNlXSkgIFxuIiAvKiBnZXQgUEMgdmlhIG1haWxib3ggKi8KKwkJIiAgIGJlcXogICVbaW5pdGZ1bmNdLCAxYiAgICAgICAgICAgICBcbiIKKwkJIiAgIG5vcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiIKKwkJIiAgIGxkICAgICRzcCwgMHgyOCglW2Jhc2VdKSAgICAgICAgICBcbiIgLyogZ2V0IFNQIHZpYSBtYWlsYm94ICovCisJCSIgICBsZCAgICAkZ3AsIDB4MzAoJVtiYXNlXSkgICAgICAgICAgXG4iIC8qIGdldCBHUCB2aWEgbWFpbGJveCAqLworCQkiICAgbGQgICAgJGExLCAweDM4KCVbYmFzZV0pICAgICAgICAgIFxuIgorCQkiICAganIgICAgJVtpbml0ZnVuY10gICAgICAgICAgICAgICAgIFxuIiAvKiBqdW1wIHRvI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lLXBsbC0yLjAiOworCQkJY2xvY2tzID0gPCZzeXNjbGs+OworCQkJY2xvY2stb3V0cHV0LW5hbWVzID0gInBsbDAiLCAicGxsMC1kaXYyIiwgInBsbDAtZGl2NCI7CisJCX07CisKKwkJcGxsMTogcGxsMUA4MjAgeworCQkJI2Nsb2NrLWNlbGxzID0gPDE+OworCQkJcmVnID0gPDB4ODIwIDB4ND47CisJCQljb21wYXRpYmxlID0gImZzbCxxb3JpcS1jb3JlLXBsbC0yLjAiOworCQkJY2xvY2tzID0gPCZzeXNjbGs+OworCQkJY2xvY2stb3V0cHV0LW5hbWVzID0gInBsbDEiLCAicGxsMS1kaXYyIiwgInBsbDEtZGl2NCI7CisJCX07CisKKwkJcGxsMjogcGxsMkA4NDAgeworCQkJI2Nsb2NrLWNlbGxzID0gPDE+OworCQkJcmVnID0gPDB4ODQwIDB4ND47CisJCQljb21wYXRpYmxlID0gImZzbCxxb3JpcS1jb3JlLXBsbC0yLjAiOworCQkJY2xvY2tzID0gPCZzeXNjbGs+OworCQkJY2xvY2stb3V0cHV0LW5hbWVzID0gInBsbDIiLCAicGxsMi1kaXYyIiwgInBsbDItZGl2NCI7CisJCX07CisKKwkJcGxsMzogcGxsM0A4NjAgeworCQkJI2Nsb2NrLWNlbGxzID0gPDE+OworCQkJcmVnID0gPDB4ODYwIDB4ND47CisJCQljb21wYXRpYmxlID0gImZzbCxxb3JpcS1jb3JlLXBsbC0yLjAiOworCQkJY2xvY2tzID0gPCZzeXNjbGs+OworCQkJY2xvY2stb3V0cHV0LW5hbWVzID0gInBsbDMiLCAicGxsMy1kaXYyIiwgInBsbDMtZGl2NCI7CisJCX07CisKKwkJcGxsNDogcGxsNEA4ODAgeworCQkJI2Nsb2NrLWNlbGxzID0gPDE+OworCQkJcmVnID0gPDB4ODgwIDB4ND47CisJCQljb21wYXRpYmxlID0gImZzbCxxb3JpcS1jb3JlLXBsbC0yLjAiOworCQkJY2xvY2tzID0gPCZzeXNjbGs+OworCQkJY2xvY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IDxsaW51eC9wZXJmX2V2ZW50Lmg+CiAjaW5jbHVkZSA8YXNtL2Zpcm13YXJlLmg+CkBAIC02Miw5ICs2NCwxMSBAQAogICoKICAqICAgICAgICA2MCAgICAgICAgNTYgICAgICAgIDUyICAgICAgICA0OCAgICAgICAgNDQgICAgICAgIDQwICAgICAgICAzNiAgICAgICAgMzIKICAqIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfAotICogICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyAgICAgIHRocmVzaF9jbXAgICAgIF0gICBbICB0aHJlc2hfY3RsICAgXQotICogICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgKi0gRUJCIChMaW51eCkgICAgICAgICAgICAgICAgICAgICAgdGhyZXNoIHN0YXJ0L3N0b3AgT1IgRkFCIG1hdGNoIC0qCisgKiAgIHwgfCBbIF0gICAgICAgICAgICAgICAgICAgICAgICAgICBbICAgICAgdGhyZXNoX2NtcCAgICAgXSAgIFsgIHRocmVzaF9jdGwgICBdCisgKiAgIHwgfCAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICB8IHwgICotIElGTSAoTGludXgpICAgICAgICAgICAgICAgICB0aHJlc2ggc3RhcnQvc3RvcCBPUiBGQUIgbWF0Y2ggLSoKKyAqICAgfCAqLSBCSFJCIChMaW51eCkKKyAqICAgKi0gRUJCIChMaW51eCkKICAqCiAgKiAgICAgICAgMjggICAgICAgIDI0ICAgICAgICAyMCAgICAgICAgMTYgICAgICAgIDEyICAgICAgICAgOCAgICAgICAgIDQgICAgICAgICAwCiAgKiB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC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LSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfAotICogICAgICAgICAgICAgICAgICAgfCAgIFsgXSAgIFsgIHNhbXBsZSBdICAgWyAgICAgXSAgIFs2XSBbNV0gICBbNF0gWzNdICAgWzJdIFsxXQotICogICAgICAgICAgICAgIEVCQiAtKiAgICB8ICAgICAgICAgICAgICAgICAgICAgfAotICogICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgIENvdW50IG9mIGV2ZW50cyBmb3IgZWFjaCBQTUMuCi0gKiAgICAgIEwxIEkvRCBxdWFsaWZpZXIgLSogICAgICAgICAgICAgICAgICAgICB8ICAgICAgICBwMSwgcDIsIHAzLCBwNCwgcDUsIHA2LgorICogICAgICAgICAgICAgICBbIF0gfCAgIFsgXSAgIFsgIHNhbXBsZSBdICAgWyAgICAgXSAgIFs2XSBbNV0gICBbNF0gWzNdICAgWzJdIFsxXQorICogICAgICAgICAgICAgICAgfCAgfCAgICB8ICAgICAgICAgICAgICAgICAgICAgfAorICogICAgICBCSFJCIElGTSAtKiAgfCAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgIENvdW50IG9mIGV2ZW50cyBmb3IgZWFjaCBQTUMuCisgKiAgICAgICAgICAgICAgRUJCIC0qICAgIHwgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICBwMSwgcDIsIHAzLCBwNCwgcDUsIHA2LgorICogICAgICBMMSBJL0QgcXVhbGlmaWVyIC0qICAgICAgICAgICAgICAgICAgICAgfAogICogICAgICAgICAgICAgICAgICAgICBuYyAtIG51bWJlciBvZiBjb3VudGVycyAtKgogICoKICAqIFRoZSBQTUMgZmllbGRzIFAxLi5QNiwgYW5kIE5DLCBhcmUgYWRkZXIgZmllbGRzLiBBcyB3ZSBhY2N1bXVsYXRlIGNvbnN0cmFpbnRzCkBAIC0xOTUsNiArMjE1LDkgQEAKICNkZWZpbmUgQ05TVF9FQkJfVkFMKHYpCQkoKCh2KSAmIEVWRU5U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yB1c2VkICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgICAgID0gMCA6IHRoZSBYQVBJQyBpcyBub3QgdXNlZCwgaWU6Ki8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgICAgICAgICBpbnRzIGZ3ZGVkIHRvIGFub3RoZXIgWEFQSUMgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgIEJpdHMxOjcgUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIENZQzogIEJpdHMwOjcgUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1bnNpZ25lZCBjaGFyIFdQX2luZGV4OyAgICAgLyogRm9yIFdQRUc6IFdQRUcgaW5zdGFuY2UgaW5kZXggLSBsb3dlciBvbmVzIGhhdmUgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgIGxvd2VyIHNsb3QgbnVtYmVycy9QQ0kgYnVzIG51bWJlcnMgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIENZQzogIE5vIG1lYW5pbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1bnNpZ25lZCBjaGFyIGNoYXNzaXNfbnVtOyAgLyogMSBiYXNlZCBDaGFzc2lzIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIExvb2tPdXQgV1BFR3MgdGhpcyBmaWVsZCBpbmRpY2F0ZXMgdGhlICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRXhwYW5zaW9uIENoYXNzaXMgIywgZW51bWVyYXRlZCBmcm9tIEJvb3QgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm9kZSBXUEVHIGV4dGVybmFsIHBvcnQsIHRoZW4gQm9vdCBOb2RlIENZQyAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZXh0ZXJuYWwgcG9ydCwgdGhlbiBOZXh0IFZpZ2lsIGNoYXNzaXMgV1BFRyAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZXh0ZXJuYWwgcG9ydCwgZXRjLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hhcmVkIExvb2tvdXRzIGhhdmUgb25seSAxIGNoYXNzaXMgbnVtYmVyICh0aGUgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgb25lIGFzc2lnbmVkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gX19hdHRyaWJ1dGVfXygocGFja2VkKSk7Ci0KLQotdHlwZWRlZiBlbnVtIHsKLQlDb21wYXRUd2lzdGVyID0gMCwgIC8qIENvbXBhdGliaWxpdHkgVHdpc3RlciAgICAgICAgICAgICAgICovCi0JQWx0VHdpc3RlciAgICA9IDEsICAvKiBBbHRlcm5hdGUgVHdpc3RlciBvZiBpbnRlcm5hbCA4LXdheSAqLwotCUNvbXBhdEN5Y2xvbmUgPSAyLCAgLyogQ29tcGF0aWJpbGl0eSBDeWNsb25lICAgICAgICAgICAgICAgKi8KLQlBbHRDeWNsb25lICAgID0gMywgIC8qIEFsdGVybmF0ZSBDeWNsb25lIG9mIGludGVybmFsIDgtd2F5ICovCi0JQ29tcGF0V1BFRyAgICA9IDQsICAvKiBDb21wYXRpYmlsaXR5IFdQRUcgICAgICAgICAgICAgICAgICAqLwotCUFsdFdQRUcgICAgICAgPSA1LCAgLyogU2Vjb25kIFBsYW5hciBXUEVHICAgICAgICAgICAgICAgICAgKi8KLQlMb29rT3V0QVdQRUcgID0gNiwgIC8qIExvb2tPdXQgV1BFR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Wwoc3RydWN0IHBlcmZfZXZlbnQgKmV2ZW50LCBpbnQgZmxhZ3MpCit7CisJc3RydWN0IGludGVsX3VuY29yZV9ib3ggKmJveCA9IHVuY29yZV9ldmVudF90b19ib3goZXZlbnQpOworCWludCBpOworCisJc25iX3VuY29yZV9pbWNfZXZlbnRfc3RvcChldmVudCwgUEVSRl9FRl9VUERBVEUpOworCisJZm9yIChpID0gMDsgaSA8IGJveC0+bl9ldmVudHM7IGkrKykgeworCQlpZiAoZXZlbnQgPT0gYm94LT5ldmVudF9saXN0W2ldKSB7CisJCQktLWJveC0+bl9ldmVudHM7CisJCQlicmVhazsKKwkJfQorCX0KK30KKworc3RhdGljIGludCBzbmJfcGNpMnBoeV9tYXBfaW5pdChpbnQgZGV2aWQpCit7CisJc3RydWN0IHBjaV9kZXYgKmRldiA9IE5VTEw7CisJaW50IGJ1czsKKworCWRldiA9IHBjaV9nZXRfZGV2aWNlKFBDSV9WRU5ET1JfSURfSU5URUwsIGRldmlkLCBkZXYpOworCWlmICghZGV2KQorCQlyZXR1cm4gLUVOT1RUWTsKKworCWJ1cyA9IGRldi0+YnVzLT5udW1iZXI7CisKKwlwY2lidXNfdG9fcGh5c2lkW2J1c10gPSAwOworCisJcGNpX2Rldl9wdXQoZGV2KTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgc3RydWN0IHBtdSBzbmJfdW5jb3JlX2ltY19wbXUgPSB7CisJLnRhc2tfY3R4X25yCT0gcGVyZl9pbnZhbGlkX2NvbnRleHQsCisJLmV2ZW50X2luaXQJPSBzbmJfdW5jb3JlX2ltY19ldmVudF9pbml0LAorCS5hZGQJCT0gc25iX3VuY29yZV9pbWNfZXZlbnRfYWRkLAorCS5kZWwJCT0gc25iX3VuY29yZV9pbWNfZXZlbnRfZGVsLAorCS5zdGFydAkJPSBzbmJfdW5jb3JlX2ltY19ldmVudF9zdGFydCwKKwkuc3RvcAkJPSBzbmJfdW5jb3JlX2ltY19ldmVudF9zdG9wLAorCS5yZWFk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HJpbnRmKG0sICIgICAgICAgICAgICAgICAgICAgICAgICAgICIpOworCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICIgICAgICAgICAgICAgICAgICAgICAgICAgICIpOwogCX0gZWxzZSB7CiAJCWlmIChwciAmIF9QQUdFX1VTRVIpCi0JCQlzZXFfcHJpbnRmKG0sICJVU1IgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICJVU1IgIik7CiAJCWVsc2UKLQkJCXNlcV9wcmludGYobSwgIiAgICAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIiAgICAiKTsKIAkJaWYgKHByICYgX1BBR0VfUlcpCi0JCQlzZXFfcHJpbnRmKG0sICJSVyAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIlJXICIpOwogCQllbHNlCi0JCQlzZXFfcHJpbnRmKG0sICJybyAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgInJvICIpOwogCQlpZiAocHIgJiBfUEFHRV9QV1QpCi0JCQlzZXFfcHJpbnRmKG0sICJQV1QgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICJQV1QgIik7CiAJCWVsc2UKLQkJCXNlcV9wcmludGYobSwgIiAgICAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIiAgICAiKTsKIAkJaWYgKHByICYgX1BBR0VfUENEKQotCQkJc2VxX3ByaW50ZihtLCAiUENEICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiUENEICIpOwogCQllbHNlCi0JCQlzZXFfcHJpbnRmKG0sICIgICAgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICIgICAgIik7CiAKIAkJLyogQml0IDkgaGFzIGEgZGlmZmVyZW50IG1lYW5pbmcgb24gbGV2ZWwgMyB2cyA0ICovCiAJCWlmIChsZX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lcik7CitBQ1BJX0dMT0JBTCh1MzIsIGFjcGlfZ2JsX2RlZXBlc3RfbmVzdGluZyk7CitBQ1BJX0lOSVRfR0xPQkFMKHUzMiwgYWNwaV9nYmxfbmVzdGluZ19sZXZlbCwgMCk7CiAjZW5kaWYKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0zNzQsMTEgKzM2MywxMSBAQAogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi1BQ1BJX0VYVEVSTiBzdHJ1Y3QgYWNwaV90aHJlYWRfc3RhdGUgKmFjcGlfZ2JsX2N1cnJlbnRfd2Fsa19saXN0OworQUNQSV9HTE9CQUwoc3RydWN0IGFjcGlfdGhyZWFkX3N0YXRlICosIGFjcGlfZ2JsX2N1cnJlbnRfd2Fsa19saXN0KTsKIAogLyogQ29udHJvbCBtZXRob2Qgc2luZ2xlIHN0ZXAgZmxhZyAqLwogCi1BQ1BJX0VYVEVSTiB1OCBhY3BpX2dibF9jbV9zaW5nbGVfc3RlcDsKK0FDUElfR0xPQkFMKHU4LCBhY3BpX2dibF9jbV9zaW5nbGVfc3RlcCk7CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKQEAgLTM4OCw4ICszNzcsOSBAQAogCiBleHRlcm4gc3RydWN0IGFjcGlfYml0X3JlZ2lzdGVyX2luZm8KICAgICBhY3BpX2dibF9iaXRfcmVnaXN0ZXJfaW5mb1tBQ1BJX05VTV9CSVRSRUddOwotQUNQSV9FWFRFUk4gdTggYWNwaV9nYmxfc2xlZXBfdHlwZV9hOwotQUNQSV9FWFRFUk4gdTggYWNwaV9nYmxfc2xlZXBfdHlwZV9iOworCitBQ1BJX0dMT0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UsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9hY29iamVjdC5oIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY29iamVjdC5oCmluZGV4IGNjN2FiNmQuLjIyZmI2NDQgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvYWNvYmplY3QuaAorKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2Fjb2JqZWN0LmgKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC0xOTMsNyArMTkzLDggQEAKICNkZWZpbmUgQUNQSV9NRVRIT0RfSU5URVJOQUxfT05MWSAgICAgICAweDAyCS8qIE1ldGhvZCBpcyBpbXBsZW1lbnRlZCBpbnRlcm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YWNwaV93YWxrX3N0YXRlICp3YWxrX3N0YXRlLAorCQkJICAgICB1bmlvbiBhY3BpX3BhcnNlX29iamVjdCAqKm91dF9vcCk7CisKK3N0YXRpYyBhY3BpX3N0YXR1cwogYWNwaV9kc19jcmVhdGVfbWV0aG9kX211dGV4KHVuaW9uIGFjcGlfb3BlcmFuZF9vYmplY3QgKm1ldGhvZF9kZXNjKTsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCisgKiBGVU5DVElPTjogICAgYWNwaV9kc19hdXRvX3NlcmlhbGl6ZV9tZXRob2QKKyAqCisgKiBQQVJBTUVURVJTOiAgbm9kZSAgICAgICAgICAgICAgICAgICAgICAgIC0gTmFtZXNwYWNlIE5vZGUgb2YgdGhlIG1ldGhvZAorICogICAgICAgICAgICAgIG9ial9kZXNjICAgICAgICAgICAgICAgICAgICAtIE1ldGhvZCBvYmplY3QgYXR0YWNoZWQgdG8gbm9kZQorICoKKyAqIFJFVFVSTjogICAgICBTdGF0dXMKKyAqCisgKiBERVNDUklQVElPTjogUGFyc2UgYSBjb250cm9sIG1ldGhvZCBBTUwgdG8gc2NhbiBmb3IgY29udHJvbCBtZXRob2RzIHRoYXQKKyAqICAgICAgICAgICAgICBuZWVkIHNlcmlhbGl6YXRpb24gZHVlIHRvIHRoZSBjcmVhdGlvbiBvZiBuYW1lZCBvYmplY3RzLgorICoKKyAqIE5PVEU6IEl0IGlzIGEgYml0IG9mIG92ZXJraWxsIHRvIG1hcmsgYWxsIHN1Y2ggbWV0aG9kcyBzZXJpYWxpemVkLCBzaW5jZQorICogdGhlcmUgaXMgb25seSBhIHByb2JsZW0gaWYgdGhlIG1ldGhvZCBhY3R1YWxseSBibG9ja3MgZHVyaW5nIGV4ZWN1dGlvbi4KKyAqIEEgYmxvY2tpbmcgb3BlcmF0aW9uIGlzLCBmb3IgZXhhbXBsZSwgYSBTbGVlc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hbWwod2Fsa19zdGF0ZSk7CisJaWYgKEFDUElfRkFJTFVSRShzdGF0dXMpKSB7CisJCXJldHVybl9BQ1BJX1NUQVRVUyhzdGF0dXMpOworCX0KKworCWFjcGlfcHNfZGVsZXRlX3BhcnNlX3RyZWUob3ApOworCXJldHVybl9BQ1BJX1NUQVRVUyhzdGF0dXMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX2RzX2RldGVjdF9uYW1lZF9vcGNvZGVzCisgKgorICogUEFSQU1FVEVSUzogIHdhbGtfc3RhdGUgICAgICAtIEN1cnJlbnQgc3RhdGUgb2YgdGhlIHBhcnNlIHRyZWUgd2FsaworICogICAgICAgICAgICAgIG91dF9vcCAgICAgICAgICAtIFVudXNlZCwgcmVxdWlyZWQgZm9yIHBhcnNlciBpbnRlcmZhY2UKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IERlc2NlbmRpbmcgY2FsbGJhY2sgdXNlZCBkdXJpbmcgdGhlIGxvYWRpbmcgb2YgQUNQSSB0YWJsZXMuCisgKiAgICAgICAgICAgICAgQ3VycmVudGx5IHVzZWQgdG8gZGV0ZWN0IG1ldGhvZHMgdGhhdCBtdXN0IGJlIG1hcmtlZCBzZXJpYWxpemVkCisgKiAgICAgICAgICAgICAgaW4gb3JkZXIgdG8gYXZvaWQgcHJvYmxlbXMgd2l0aCB0aGUgY3JlYXRpb24gb2YgbmFtZWQgb2JqZWN0cy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgYWNwaV9zdGF0dXMKK2FjcGlfZHNfZGV0ZWN0X25hbWVkX29wY29kZXMoc3RydWN0IGFjcGlfd2Fsa19zdG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NwaS9hY3BpY2EvZXZncGUuYwppbmRleCBhOWNiNGExLi45NTVmODNkIDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2Z3BlLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZS5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZWJsay5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZWJsay5jCmluZGV4IGEzMWU1NDkuLmNhYWVkM2MgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXZncGVibGsuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2Z3BlYmxrLmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIG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ICogQWxsIHJpZ2h0cyByZXNlcnZlZC4KICAqCiAgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhjb25maWcuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhjb25maWcuYwppbmRleCAwNmQyMTZjLi44YmExNDY0IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2V4Y29uZmlnLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9leGNvbmZpZy5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9leGNvbnZydC5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9leGNvbnZydC5jCmluZGV4IDY5ZTRhOGMuLmM1NDUzODYgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhjb252cnQuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V4Y29udnJ0LmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiov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jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9leHV0aWxzLmMKaW5kZXggOTlkYzdiMi4uZDlkNzJkZiAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9leHV0aWxzLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9leHV0aWxzLmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC0xMDAsMzcgKzEwMCw2IEBACiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgotICogRlVOQ1RJT046ICAgIGFjcGlfZXhfcmVhY3F1aXJlX2ludGVycHJldGVyCi0gKgotICogUEFSQU1FVEVSUzogIE5vbmUKLSAqCi0gKiBSRVRVUk46ICAgICAgTm9uZQotICoKLSAqIERFU0NSSVBUSU9OOiBSZWFjcXVpcmUgdGhlIGludGVycHJldGVyIGV4ZWN1dGlvbiByZWdpb24gZnJvbSB3aXRoaW4gdGhlCi0gKiAgICAgICAgICAgICAgaW50ZXJwcmV0ZXIgY29kZS4gRmFpbHVyZSB0byBlbnRlciB0aGUgaW50ZXJwcmV0ZXIgcmVnaW9uIGlzIGEKLSAqICAgICAgICAgICAgICBmYXRhbCBzeXN0ZW0gZXJyb3IuIFVzZWQgaW4gY29uanVuY3Rpb24gd2l0aAotICogICAgICAgICAgICAgIHJlbGlucXVpc2hfaW50ZXJwcmV0ZXIKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIGFjcGlfZXhfcmVhY3F1aXJlX2ludGVycHJldGVyKHZvaWQpCi17Ci0JQUNQSV9GVU5DVElPTl9UUkFDRShleF9yZWFjcXVpcmVfaW50ZXJwcmV0ZXIpOwotCi0JLyoKLQkgKiBJZiB0aGUgZ2xvYmFsIHNlcmlhbGl6ZWQgZmxhZyBpcyBzZXQsIGRvIG5vdCByZWxlYXNlIHRoZSBpbnRlcnByZXRlciwKLQkgKiBzaW5jZSBpdCB3YXMgbm90IGFjdHVhbGx5IHJlbGVhc2VkIGJ5IGFjcGlfZXhfcmVsaW5xdWlzaF9pbnRlcnByZXRlci4KLQkgKiBUaGlzIGZvcmNlcyB0aGUgaW50ZXJwcmV0ZXIgdG8gYmUgc2luZ2xlIHRocmVhZGVkLgotCSAqLwotCWlmICghYWNwaV9nYmxfYWxsX21ldGhvZHNfc2VyaWFsaXplZCkgewotCQlhY3BpX2V4X2VudGVyX2ludGVycHJldGVyKCk7Ci0JfQotCi0JcmV0dXJuX1ZPSUQ7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgogICogRlVOQ1RJT046ICAgIGFjcGlfZXhfZXhpdF9pbnRlcnByZXRlcgogICoKICAqIFBBUkFNRVRFUlM6ICBOb25lCkBAIC0xMzksNyArMTA4LDE2IEBACiAgKgogICogREVTQ1JJUFRJT046IEV4aXQgdGhlIGludGVycHJldGVyIGV4ZWN1dGlvbiByZWdpb24uIFRoaXMgaXMgdGhlIHRvcCBsZXZlbAogICogICAgICAgICAgICAgIHJvdXRpbmUgdXNlZCB0byBleGl0IHRoZSBpbnRlcnByZXRlciB3aGVuIGFsbCBwcm9jZXNzaW5nIGhhcwotICogICAgICAgICAgICAgIGJlZW4gY29tcGxldGVkLgorICogICAgICAgICAgICAgIGJlZW4gY29tcGxldGVkLCBvciB3aGVuIHRoZSBtZXRob2QgYmxvY2tzLgorICoKKyAqIENhc2VzIHdoZXJlIHRoZSBpbnRlcnByZXRlciBpcyB1bmxvY2tlZCBpbnRlcm5hbGx5OgorICogICAgICAxKSBNZXRob2Qgd2lsbCBiZSBibG9ja2VkIG9uIGEgU2xlZXAoKSBBTUwgb3Bjb2RlCisgKiAgICAgIDIpIE1ldGhvZCB3aWxsIGJlIGJsb2NrZWQgb24gYW4gQWNxdWlyZSgpIEFNTCBvcGNvZGUKKyAqICAgICAgMykgTWV0aG9kIHdpbGwgYmUgYmxvY2tlZCBvbiBhIFdhaXQoKSBBTUwgb3Bjb2RlCisgKiAgICAgIDQpIE1ldGhvZCB3aWxsIGJlIGJsb2NrZWQgdG8gYWNxdWlyZSB0aGUgZ2xvYmFsIGxvY2sKKyAqICAgICAgNSkgTWV0aG9kIHdpbGwgYmUgYmxvY2tlZCB3YWl0aW5nIHRvIGV4ZWN1dGUgYSBzZXJpYWxpemVkIGNvbnRyb2wKKyAqICAgICAgICAgIG1ldGhvZCB0aGF0IGlzIGN1cnJlbnRseSBleGVjdXRpbmcKKyAqICAgICAgNikgQWJvdXQgdG8gaW52b2tlIGEgdXNlci1pbnN0YWxsZWQgb3ByZWdpb24gaGFuZGxlcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKQEAgLTE2MCw0NCArMTM4LDYgQEAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCi0gKiBGVU5DVElPTjogICAgYWNwaV9leF9yZWxpbnF1aXNoX2ludGVycHJldGVyCi0gKgotICogUEFSQU1FVEVSUzogIE5vbmUKLSAqCi0gKiBSRVRVUk46ICAgICAgTm9uZQotICoKLSAqIERFU0NSSVBUSU9OOiBFeGl0IHRoZSBpbnRlcnByZXRlciBleGVjdXRpb24gcmVnaW9uLCBmcm9tIHdpdGhpbiB0aGUKLSAqICAgICAgICAgICAgICBpbnRlcnByZXRlciAtIGJlZm9yZSBhdHRlbXB0aW5nIGFuIG9wZXJhdGlvbiB0aGF0IHdpbGwgcG9zc2libHkKLSAqICAgICAgICAgICAgICBibG9jayB0aGUgcnVubmluZyB0aHJlYWQuCi0gKgotICogQ2FzZXMgd2hlcmUgdGhlIGludGVycHJldGVyIGlzIHVubG9ja2VkIGludGVybmFsbHkKLSAqICAgICAgMSkgTWV0aG9kIHRvIGJlIGJsb2NrZWQgb24gYSBTbGVlcCgpIEFNTCBvcGNvZGUKLSAqICAgICAgMikgTWV0aG9kIHRvIGJlIGJsb2NrZWQgb24gYW4gQWNxdWlyZSgpIEFNTCBvcGNvZGUKLSAqICAgICAgMykgTWV0aG9kIHRvIGJlIGJsb2NrZWQgb24gYSBXYWl0KCkgQU1MIG9wY29kZQotICogICAgICA0KSBNZXRob2QgdG8gYmUgYmxvY2tlZCB0byBhY3F1aXJlIHRoZSBnbG9iYWwgbG9jawotICogICAgICA1KSBNZXRob2QgdG8gYmUgYmxvY2tlZCB3YWl0aW5nIHRvIGV4ZWN1dGUgYSBzZXJpYWxpemVkIGNvbnRyb2wgbWV0aG9kCi0gKiAgICAgICAgICB0aGF0IGlzIGN1cnJlbnRseSBleGVjdXRpbmcKLSAqICAgICAgNikgQWJvdXQgdG8gaW52b2tlIGEgdXNlci1pbnN0YWxsZWQgb3ByZWdpb24gaGFuZGxlcgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgYWNwaV9leF9yZWxpbnF1aXNoX2ludGVycHJldGVyK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MKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9uc2FyZ3VtZW50cy5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9uc2FyZ3VtZW50cy5jCmluZGV4IDc0YjI0YzguLjgwZmNmYzggMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvbnNhcmd1bWVudHMuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL25zYXJndW1lbnRzLmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CmRpZmYgLS1naXQgYS9kcml2ZXJzL2FjcGkvYWNwaWNhL25zY29udmVydC5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9uc2NvbnZl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IC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC00MzIsOCArNDMyLDggQEAKICAqIERFU0NSSVBUSU9OOiBSZXBhaXIgZm9yIHRoZSBfQ1NUIG9iamVjdDoKICAqICAgICAgICAgICAgICAxLiBTb3J0IHRoZSBsaXN0IGFzY2VuZGluZyBieSBDIHN0YXRlIHR5cGUKICAqICAgICAgICAgICAgICAyLiBFbnN1cmUgdHlwZSBjYW5ub3QgYmUgemVybwotICogICAgICAgICAgICAgIDMuIEEgc3ViLXBhY2thZ2UgY291bnQgb2YgemVybyBtZWFucyBfQ1NUIGlzIG1lYW5pbmdsZXNzCi0gKiAgICAgICAgICAgICAgNC4gQ291bnQgbXVzdCBtYXRjaCB0aGUgbnVtYmVyIG9mIEMgc3RhdGUgc3ViLXBhY2thZ2VzCisgKiAgICAgICAgICAgICAgMy4gQSBzdWJwYWNrYWdlIGNvdW50IG9mIHplcm8gbWVhbnMgX0NTVCBpcyBtZWFuaW5nbGVzcworICogICAgICAgICAgICAgIDQuIENvdW50IG11c3QgbWF0Y2ggdGhlIG51bWJlciBvZiBDIHN0YXRlIHN1YnBhY2thZ2VzCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCkBAIC02MTEsNiArNjExLDcgQEAKIAl1bmlvbiBhY3BpX29wZXJhbmRfb2JqZWN0ICoqdG9wX29iamVjdF9saXN0OwogCXVuaW9uIGFjcGlfb3BlcmFuZF9vYmplY3QgKipzdWJfb2JqZWN0X2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FVEVSUzogIGluZm8gICAgICAgICAgICAgICAgLSBNZXRob2QgZXhlY3V0aW9uIGluZm9ybWF0aW9uIGJsb2NrCiAgKiAgICAgICAgICAgICAgcmV0dXJuX29iamVjdCAgICAgICAtIFBvaW50ZXIgdG8gdGhlIHRvcC1sZXZlbCByZXR1cm5lZCBvYmplY3QKLSAqICAgICAgICAgICAgICBzdGFydF9pbmRleCAgICAgICAgIC0gSW5kZXggb2YgdGhlIGZpcnN0IHN1Yi1wYWNrYWdlCi0gKiAgICAgICAgICAgICAgZXhwZWN0ZWRfY291bnQgICAgICAtIE1pbmltdW0gbGVuZ3RoIG9mIGVhY2ggc3ViLXBhY2thZ2UKLSAqICAgICAgICAgICAgICBzb3J0X2luZGV4ICAgICAgICAgIC0gU3ViLXBhY2thZ2UgZW50cnkgdG8gc29ydCBvbgorICogICAgICAgICAgICAgIHN0YXJ0X2luZGV4ICAgICAgICAgLSBJbmRleCBvZiB0aGUgZmlyc3Qgc3VicGFja2FnZQorICogICAgICAgICAgICAgIGV4cGVjdGVkX2NvdW50ICAgICAgLSBNaW5pbXVtIGxlbmd0aCBvZiBlYWNoIHN1YnBhY2thZ2UKKyAqICAgICAgICAgICAgICBzb3J0X2luZGV4ICAgICAgICAgIC0gU3VicGFja2FnZSBlbnRyeSB0byBzb3J0IG9uCiAgKiAgICAgICAgICAgICAgc29ydF9kaXJlY3Rpb24gICAgICAtIEFzY2VuZGluZyBvciBkZXNjZW5kaW5nCiAgKiAgICAgICAgICAgICAgc29ydF9rZXlfbmFtZSAgICAgICAtIE5hbWUgb2YgdGhlIHNvcnRfaW5kZXggZmllbGQKICAqCkBAIC04MDUsNyArODEyLDcgQEAKIAl9CiAKIAkvKgotCSAqIE5PVEU6IGFzc3VtZXMgbGlzdCBvZiBzdWItcGFja2FnZXMgY29udGFpbnMgbm8gTlVMTCBlbGVtZW50cy4KKwkgKiBOT1RFOiBhc3N1bWVzIGxpc3Qgb2Ygc3VicGFja2FnZXMgY29udGFpbnMgb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ogICAgICAgICAgICAgIGhhbmRsZXIgICAgICAgICAgICAgLSBIYW5kbGVyIHVzZWQgaW4gY2FsbCB0byBhdHRhY2hfZGF0YQogICogICAgICAgICAgICAgIGRhdGEgICAgICAgICAgICAgICAgLSBXaGVyZSB0aGUgZGF0YSBpcyByZXR1cm5lZAorICogICAgICAgICAgICAgIGNhbGxiYWNrICAgICAgICAgICAgLSBmdW5jdGlvbiB0byBleGVjdXRlIGJlZm9yZSByZXR1cm5pbmcKICAqCiAgKiBSRVRVUk46ICAgICAgU3RhdHVzCiAgKgotICogREVTQ1JJUFRJT046IFJldHJpZXZlIGRhdGEgdGhhdCB3YXMgcHJldmlvdXNseSBhdHRhY2hlZCB0byBhIG5hbWVzcGFjZSBub2RlLgorICogREVTQ1JJUFRJT046IFJldHJpZXZlIGRhdGEgdGhhdCB3YXMgcHJldmlvdXNseSBhdHRhY2hlZCB0byBhIG5hbWVzcGFjZSBub2RlCisgKiAgICAgICAgICAgICAgYW5kIGV4ZWN1dGUgYSBjYWxsYmFjayBiZWZvcmUgcmV0dXJuaW5nLgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiBhY3BpX3N0YXR1cwotYWNwaV9nZXRfZGF0YShhY3BpX2hhbmRsZSBvYmpfaGFuZGxlLCBhY3BpX29iamVjdF9oYW5kbGVyIGhhbmRsZXIsIHZvaWQgKipkYXRhKQorYWNwaV9nZXRfZGF0YV9mdWxsKGFjcGlfaGFuZGxlIG9ial9oYW5kbGUsIGFjcGlfb2JqZWN0X2hhbmRsZXIgaGFuZGxlciwKKwkJICAgdm9pZCAqKmRhdGEsIHZvaWQgKCpjYWxsYmFjaykodm9pZCAqKSkKIHsKIAlzdHJ1Y3QgYWNwaV9uYW1lc3BhY2Vfbm9kZSAqbm9kZTsKIAlhY3BpX3N0YXR1cyBzdGF0dXM7CkBAIC05NjAsMTAgKzk2MywzNCBAQAogCX0KIAogCXN0YXR1cyA9IGFjcGlfbnNfZ2V0X2F0dGFjaGVkX2RhdGEobm9kZSwgaGFuZGxlciwgZGF0YSk7CisJaWYgKEFDUElfU1VDQ0VTUyhzdGF0dXMpICYmIGNhbGxiYWNrKSB7CisJCWNhbGxiYWNrKCpkYXRhKTsKKwl9CiAKIHVubG9ja19hbmRfZXhpdDoKIAkodm9pZClhY3BpX3V0X3JlbGVhc2VfbXV0ZXgoQUNQSV9NVFhfTkFNRVNQQUNFKTsKIAlyZXR1cm4gKHN0YXR1cyk7CiB9CiAKK0FDUElfRVhQT1JUX1NZTUJPTChhY3BpX2dldF9kYXRhX2Z1bGwpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfZ2V0X2RhdGEKKyAqCisgKiBQQVJBTUVURVJTOiAgb2JqX2hhbmRsZSAgICAgICAgICAtIE5hbWVzcGFjZSBub2RlCisgKiAgICAgICAgICAgICAgaGFuZGxlciAgICAgICAgICAgICAtIEhhbmRsZXIgdXNlZCBpbiBjYWxsIHRvIGF0dGFjaF9kYXRhCisgKiAgICAgICAgICAgICAgZGF0YSAgICAgICAgICAgICAgICAtIFdoZXJlIHRoZSBkYXRhIGlzIHJldHVybmVkCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cworICoKKyAqIERFU0NSSVBUSU9OOiBSZXRyaWV2ZSBkYXRhIHRoYXQgd2FzIHByZXZpb3VzbHkgYXR0YWNoZWQgdG8gYSBuYW1lc3BhY2Ugbm9kZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworYWNwaV9zdGF0dXMKK2FjcGlfZ2V0X2RhdGEoYWNwaV9oYW5kbGUgb2JqX2hhbmRsZSwgYWNwaV9vYmplY3Rfa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CkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9wc3dhbGsuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvcHN3YWxrLmMKaW5kZXggYWJkNjU2Mi4uOWNiMDdlMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9wc3dhbGsuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3Bzd2Fsay5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9wc3hmYWNlLmMgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3BzeGZhY2UuYwppbmRleCBmY2I3YTg0Li5lMTM1YW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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS91dGNvcHkuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXRjb3B5LmMKaW5kZXggZWRmZjRlNi4uMjcwYzE2NCAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS91dGNvcHkuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0Y29weS5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtNTM1LDEwICs1MzUsMTAgQEAKIAogCWNhc2UgQUNQSV9UWVBFX0xPQ0FMX1JFRkVSRU5DRToKIAotCQkvKiBUQkQ6IHNob3VsZCB2YWxpZGF0ZSBpbmNvbWluZyBoYW5kbGUgKi8KKwkJLyogQW4gaW5jb21pbmcgcmVmZXJlbmN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Y2EvdXRkZWNvZGUuYwppbmRleCBiM2YzMWRkLi5mYmZhOWVjIDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0ZGVjb2RlLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dGRlY29kZS5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS91dGRlbGV0ZS5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dGRlbGV0ZS5jCmluZGV4IGMwN2QyMjIuLmEzNTE2ZGUgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXRkZWxldGUuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0ZGVsZXRlLmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZC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kZCwgJmRzLT5kZXBlbmRlbnRfZGV2aWNlcywgbGlzdCkKLQkJaWYgKGhhbmRsZSA9PSBkZC0+aGFuZGxlKQorCQlpZiAoYWRldiA9PSBkZC0+YWRldikKIAkJCXJldHVybiBkZDsKIAogCXJldHVybiBOVUxMOwogfQogCit2b2lkIHJlZ2lzdGVyX2RvY2tfZGVwZW5kZW50X2RldmljZShzdHJ1Y3QgYWNwaV9kZXZpY2UgKmFkZXYsCisJCQkJICAgIGFjcGlfaGFuZGxlIGRzaGFuZGxlKQoreworCXN0cnVjdCBkb2NrX3N0YXRpb24gKmRzID0gZmluZF9kb2NrX3N0YXRpb24oZHNoYW5kbGUpOworCisJaWYgKGRzICYmICFmaW5kX2RvY2tfZGVwZW5kZW50X2RldmljZShkcywgYWRldikpCisJCWFkZF9kb2NrX2RlcGVuZGVudF9kZXZpY2UoZHMsIGFkZXYpOworfQorCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqICAgICAgICAgICAgICAgICAgICAgICAgIERvY2sgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIGludCBfX2luaXQgaXNfYmF0dGVyeShhY3BpX2hhbmRsZSBoYW5kbGUpCi17Ci0Jc3RydWN0IGFjcGlfZGV2aWNlX2luZm8gKmluZm87Ci0JaW50IHJldCA9IDE7Ci0KLQlpZiAoIUFDUElfU1VDQ0VTUyhhY3BpX2dldF9vYmplY3RfaW5mbyhoYW5kbGUsICZpbmZvKSkpCi0JCXJldHVybiAwOwotCWlmICghKGluZm8tPnZhbGlkICYgQUNQSV9WQUxJRF9ISUQpKQotCQlyZXQgPSAwOwotCWVsc2UKLQkJcmV0ID0gIXN0cmNtcCgiUE5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UwX0JJVF9EQVRBX1JEWV9FTiAgICAgICAgIDB4MDEKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RNUF9JTlRfRU4gICAgICAgICAgMHgwMgogCiAjZGVmaW5lIElOVl9NUFU2MDUwX1JFR19SQVdfQUNDRUwgICAgICAgICAgIDB4M0IKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1RFTVBFUkFUVVJFICAgICAgICAgMHg0MQogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfUkFXX0dZUk8gICAgICAgICAgICAweDQzCiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1VTRVJfQ1RSTCAgICAgICAgICAgMHg2QQotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRklGT19SU1QgICAgICAgICAgICAgICAgICAgIDB4MDQKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RNUF9SU1QgICAgICAgICAgICAgICAgICAgICAweDA4Ci0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9JMkNfTVNUX0VOICAgICAgICAgICAgICAgICAgMHgyMAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRklGT19FTiAgICAgICAgICAgICAgICAgICAgIDB4NDAKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RNUF9FTiAgICAgICAgICAgICAgICAgICAgICAweDgwCisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX1JTVCAgICAgICAgICAgIDB4MDQKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RNUF9SU1QgICAgICAgICAgICAgMHgwOAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfSTJDX01TVF9FTiAgICAgICAgICAweDIwCisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX0VOICAgICAgICAgICAgIDB4NDAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RNUF9FTiAgICAgICAgICAgICAgMHg4MAogCiAjZGVmaW5lIElOVl9NUFU2MDUwX1JFR19QV1JfTUdNVF8xICAgICAgICAgIDB4NkIKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0hfUkVTRVQgICAgICAgICAgICAgICAgICAgICAweDgwCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9TTEVFUCAgICAgICAgICAgICAgICAgICAgICAgMHg0MAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfQ0xLX01BU0sgICAgICAgICAgICAgICAgICAgIDB4NworI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfSF9SRVNFVCAgICAgICAgICAgICAweDgwCisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9TTEVFUCAgICAgICAgICAgICAgIDB4NDAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0NMS19NQVNLICAgICAgICAgICAgMHg3CiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1BXUl9NR01UXzIgICAgICAgICAgMHg2QwotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfUFdSX0FDQ0xfU1RCWSAgICAgICAgICAgICAgIDB4MzgKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1BXUl9HWVJPX1NUQlkgICAgICAgICAgICAgICAweDA3CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9QV1JfQUNDTF9TVEJZICAgICAgIDB4MzgKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1BXUl9HWVJPX1NUQlkgICAgICAgMHgwNwogCiAjZGVmaW5lIElOVl9NUFU2MDUwX1JFR19GSUZPX0NPVU5UX0ggICAgICAgIDB4NzIKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX0ZJRk9fUl9XICAgICAgICAgICAgMHg3NApAQCAtMTgwLDEwICsxODAsMTAgQEAKIAogLyogaW5pdCBwYXJhbWV0ZXJzICovCiAjZGVmaW5lIElOVl9NUFU2MDUwX0lOSVRfRklGT19SQVRFICAgICAgICAgICA1MAotI2RlZmluZSBJTlZfTVBVNjA1MF9USU1FX1NUQ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RvX2J1ZmZlcnNfd2l0aF90aW1lc3RhbXAoaW5kaW9fZGV2LCBidWYsCisJCWlpb19nZXRfdGltZV9ucygpKTsKKworZG9uZToKKwlpaW9fdHJpZ2dlcl9ub3RpZnlfZG9uZShpbmRpb19kZXYtPnRyaWcpOworCisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCitzdGF0aWMgaW50IGx0cjUwMV9pbml0KHN0cnVjdCBsdHI1MDFfZGF0YSAqZGF0YSkKK3sKKwlpbnQgcmV0OworCisJcmV0ID0gaTJjX3NtYnVzX3JlYWRfYnl0ZV9kYXRhKGRhdGEtPmNsaWVudCwgTFRSNTAxX0FMU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+YWxzX2NvbnRyID0gcmV0IHwgTFRSNTAxX0NPTlRSX0FDVElWRTsKKworCXJldCA9IGkyY19zbWJ1c19yZWFkX2J5dGVfZGF0YShkYXRhLT5jbGllbnQsIExUUjUwMV9QU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+cHNfY29udHIgPSByZXQgfCBMVFI1MDFfQ09OVFJfQUNUSVZFOworCisJcmV0dXJuIGx0cjUwMV93cml0ZV9jb250cihkYXRhLT5jbGllbnQsIGRhdGEtPmFsc19jb250ciwKKwkJZGF0YS0+cHNfY29udHIpOworfQorCitzdGF0aWMgaW50IGx0cjUwMV9wcm9iZShzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LAorCQkJICBjb25zdCBzdHJ1Y3QgaTJjX2RldmljZV9pZCAqaWQpCit7CisJc3RydWN0IGx0cjUwMV9kYXRhICpkYXRhOworCXN0cnVjdCBpaW9fZGV2ICppbmRpb19kZXY7CisJaW50IHJldDsKKworCWluZGlvX2RldiA9IGRldm1faWlvX2RldmljZV9hbGxvYygmY2xpZW50LT5kZXYsIHNpemVvZigqZGF0YSkpOworCWlmICghaW5kaW9fZGV2KQorCQlyZXR1cm4gLUVOT01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XYtPnZhciA9IEdERF9WQVIocmVnMSk7CisJbWRldi0+YmFyID0gR0REX0JBUihyZWcxKTsKKwltZGV2LT5ncm91cCA9IEdERF9HUlAocmVnMik7CisJbWRldi0+aW5zdCA9IEdERF9JTlMocmVnMik7CisKKwlwcl9kZWJ1ZygiRm91bmQgYSAxNnolMDNkXG4iLCBtZGV2LT5pZCk7CisKKwltZGV2LT5pcnEuc3RhcnQgPSBHRERfSVJRKHJlZzEpOworCW1kZXYtPmlycS5lbmQgPSBHRERfSVJRKHJlZzEpOworCW1kZXYtPmlycS5mbGFncyA9IElPUkVTT1VSQ0VfSVJROworCisJbWRldi0+bWVtLnN0YXJ0ID0gbWFwYmFzZSArIG9mZnNldDsKKwltZGV2LT5tZW0uZW5kID0gbWRldi0+bWVtLnN0YXJ0ICsgc2l6ZSAtIDE7CisJbWRldi0+bWVtLmZsYWdzID0gSU9SRVNPVVJDRV9NRU07CisKKwltZGV2LT5pc19hZGRlZCA9IGZhbHNlOworCisJcmV0ID0gbWNiX2RldmljZV9yZWdpc3RlcihidXMsIG1kZXYpOworCWlmIChyZXQgPCAwKQorCQlnb3RvIGVycjsKKworCXJldHVybiAwOworCitlcnI6CisJbWNiX2ZyZWVfZGV2KG1kZXYpOworCisJcmV0dXJuIHJldDsKK30KKworaW50IGNoYW1lbGVvbl9wYXJzZV9jZWxscyhzdHJ1Y3QgbWNiX2J1cyAqYnVzLCBwaHlzX2FkZHJfdCBtYXBiYXNlLAorCQkJdm9pZCBfX2lvbWVtICpiYXNlKQoreworCWNoYXIgX19pb21lbSAqcCA9IGJhc2U7CisJc3RydWN0IGNoYW1lbGVvbl9mcGdhX2hlYWRlciAqaGVhZGVyOworCXVpbnQzMl90IGR0eXBlOworCWludCBudW1fY2VsbHMgPSAwOworCWludCByZXQgPSAwOworCXUzMiBoc2l6ZTsKKworCWhzaXplID0gc2l6ZW9mKHN0cnVjdCBjaGFtZWxlb25fZnBnYV9oZWFkZXIpOworCisJaGVhZGVyID0ga3phb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RbaV1fRU4gPT0gMS4KKyAqLworI2RlZmluZSBISVNSX1JFRyAgICAgICAgICAgICAgICAgICAgICAgICAweDIwNjAKKyNkZWZpbmUgICBISVNSX0lOVF8wX1NUUyAgICAgIEJJVCgwKQorI2RlZmluZSAgIEhJU1JfSU5UXzFfU1RTICAgICAgQklUKDEpCisjZGVmaW5lICAgSElTUl9JTlRfMl9TVFMgICAgICBCSVQoMikKKyNkZWZpbmUgICBISVNSX0lOVF8zX1NUUyAgICAgIEJJVCgzKQorI2RlZmluZSAgIEhJU1JfSU5UXzRfU1RTICAgICAgQklUKDQpCisjZGVmaW5lICAgSElTUl9JTlRfNV9TVFMgICAgICBCSVQoNSkKKyNkZWZpbmUgICBISVNSX0lOVF82X1NUUyAgICAgIEJJVCg2KQorI2RlZmluZSAgIEhJU1JfSU5UXzdfU1RTICAgICAgQklUKDcpCisjZGVmaW5lICAgSElTUl9JTlRfU1RTX01TSyBcCisJKEhJU1JfSU5UXzBfU1RTIHwgSElTUl9JTlRfMV9TVFMgfCBISVNSX0lOVF8yX1NUUykKKworLyogSG9zdCBJbnRlcnJ1cHQgRW5hYmxlIFJlZ2lzdGVyLiBSZXNpZGVzIGluIFBDSSBtZW1vcnkgc3BhY2UuICovCisjZGVmaW5lIEhJRVJfUkVHICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjA2NAorI2RlZmluZSAgIEhJRVJfSU5UXzBfRU4gICAgICBCSVQoMCkKKyNkZWZpbmUgICBISUVSX0lOVF8xX0VOICAgICAgQklUKDEpCisjZGVmaW5lICAgSElFUl9JTlRfMl9FTiAgICAgIEJJVCgyKQorI2RlZmluZSAgIEhJRVJfSU5UXzNfRU4gICAgICBCSVQoMykKKyNkZWZpbmUgICBISUVSX0lOVF80X0VOICAgICAgQklUKDQpCisjZGVmaW5lICAgSElFUl9JTlRfNV9FTiAgICAgIEJJVCg1KQorI2RlZmluZSAgIEhJRVJfSU5UXzZfRU4gICAgICBCSVQoNikKKyNkZWZpbmUgICBISUV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PmRldi0+b2Zfbm9kZSwgInRpLHBoeS1waXBlMy1zYXRhIikpCisJCXJldHVybiAwOworCisJLyogUHV0IERQTEwgaW4gSURMRSBtb2RlICovCisJdmFsID0gdGlfcGlwZTNfcmVhZGwocGh5LT5wbGxfY3RybF9iYXNlLCBQTExfQ09ORklHVVJBVElPTjIpOworCXZhbCB8PSBQTExfSURMRTsKKwl0aV9waXBlM193cml0ZWwocGh5LT5wbGxfY3RybF9iYXNlLCBQTExfQ09ORklHVVJBVElPTjIsIHZhbCk7CisKKwkvKiB3YWl0IGZvciBMRE8gYW5kIE9zY2lsbGF0b3IgdG8gcG93ZXIgZG93biAqLworCXRpbWVvdXQgPSBqaWZmaWVzICsgbXNlY3NfdG9famlmZmllcyhQTExfSURMRV9USU1FKTsKKwlkbyB7CisJCWNwdV9yZWxheCgpOworCQl2YWwgPSB0aV9waXBlM19yZWFkbChwaHktPnBsbF9jdHJsX2Jhc2UsIFBMTF9TVEFUVVMpOworCQlpZiAoKHZhbCAmIFBMTF9USUNPUFdETikgJiYgKHZhbCAmIFBMTF9MRE9QV0ROKSkKKwkJCWJyZWFrOworCX0gd2hpbGUgKCF0aW1lX2FmdGVyKGppZmZpZXMsIHRpbWVvdXQpKTsKKworCWlmICghKHZhbCAmIFBMTF9USUNPUFdETikgfHwgISh2YWwgJiBQTExfTERPUFdETikpIHsKKwkJZGV2X2VycihwaHktPmRldiwgIkZhaWxlZCB0byBwb3dlciBkb3duOiBQTExfU1RBVFVTIDB4JXhcbiIsCisJCQl2YWwpOworCQlyZXR1cm4gLUVCVVNZOworCX0KKworCXJldHVybiAwOworfQorc3RhdGljIHN0cnVjdCBwaHlfb3BzIG9wcyA9IHsKKwkuaW5pdAkJPSB0aV9waXBlM19pbml0LAorCS5leGl0CQk9IHRpX3BpcGUzX2V4aXQsCisJLnBvd2VyX29uCT0gdGlfcGlwZTNfcG93ZXJfb24sCisJLnBvd2VyX29mZgk9IHRpX3BpcGUzX3Bvd2VyX29mZiwKKwkub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gRFJWX1BJTkdST1VQX1JFR18jI2RydnR5cGUociksCQlcCiAJCS5kcnZ0eXBlX2JhbmsgPSAwLAkJCQkJXAogCQkuZHJ2dHlwZV9iaXQgPSA2LAkJCQkJXAogCX0KIAogc3RhdGljIGNvbnN0IHN0cnVjdCB0ZWdyYV9waW5ncm91cCB0ZWdyYTExNF9ncm91cHNbXSA9IHsKIAkvKiAgICAgICBwZ19uYW1lLCAgICAgICAgICAgICAgICBmMCwgICAgICAgICBmMSwgICAgICAgICBmMiwgICAgICAgICAgIGYzLCAgICAgICAgICBzYWZlLCAgICAgciwgICAgICBvZCwgaW9yLCByY3Zfc2VsICovCi0JLyogRklYTUU6IEZpbGwgaW4gY29ycmVjdCBkYXRhIGluIHNhZmUgY29sdW1uICovCiAJUElOR1JPVVAodWxwaV9kYXRhMF9wbzEsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwMCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMV9wbzIsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwNCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMl9wbzMsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwOCwgIE4sICBOLCAgTiksCkBAIC0yNjM1LDYgKzE3NDEsNyBAQAogCVBJTkdST1VQKHBiYjYsICAgICAgICAgICAgICAgICAgIFZHUDYsICAgICAgIERJU1BMQVlBLCAgIERJU1BMQVlCLCAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYTQsICBOLCAgTiwgIE4pLAogCVBJTkdST1VQKHBiYjcsICAgICAgICAgICAgICAgICAgIEkyUzQs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ICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzI4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChwd3JfaW50X24sICAgICAgICAgICAgICBQTUksICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzJjLCAgTiwgIE4sICBOKSwKKwlQSU5HUk9VUChjbGtfMzJrX2luLCAgICAgICAgICAgICBDTEssICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBDTEssICAgICAgMHgzMzMwLCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChvd3IsICAgICAgICAgICAgICAgICAgICBPV1IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM0LCAgTiwgIE4sICBZKSwKIAlQSU5HUk9VUChkYXAxX2ZzX3BuMCwgICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChkYXAxX2Rpbl9wbjEsICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzNjLCAgTiwgIE4sICBOKSwKQEAgLTI2OTcsMzggKzE4MDUsNDggQEAKIAlQSU5HUk9VUCh1c2JfdmJ1c19lbjFfcG41LCAgICAgICBVU0IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzM2Y4LCAgWSwgIE4sICBOKSwKIAlQSU5HUk9VUChzZG1tYzNfY2xrX2xiX2luX3BlZTUsICBTRE1NQzMsICAgICBSU1ZE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AgICAgVUFSVEEsICAgICAgUlNWRDMsICAgICAgICBHTUksICAgICAgICAgUlNWRDMsICAgICAgMHgzMTljLCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTAsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKGdlbjFfaTJjX3NkYV9wYzUsICAgICAgIEkyQzEsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIEkyQzEsICAgICAgIDB4MzFhNCwgIFksICBOLCAgTiksCisgICAgICAgUElOR1JPVVAoZ2VuMV9pMmNfc2RhX3BjNSwgICAgICAgSTJDMSwgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJDMSwgICAgICAgMHgzMWEwLCAgWSwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTQsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGRhcDRfZnNfcHA0LCAgICAgICAgICAgIEkyUzMsICAgICAgIEdNSSwgICAgICAgIERUViwgICAgICAgICAgUlNWRDQsICAgICAgIEkyUzMsICAgICAgIDB4MzFhOCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAoZGFwNF9kaW5fcHA1LCAgICAgICAgICAgSTJTMywgICAgICAgR01JLCAgICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJTMywgICAgICAgMHgzMWFjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChkYXA0X2RvdXRfcHA2LCAgICAgICAgICBJMlMzLCAgICAgICBHTUksICAgICAgICBEVFYsICAgICAgICAgIFJTVkQ0LCAgICAgICBJMlMzLCAgICAgICAweDMxYjAsICBOLCAgTiwgIE4pLApAQCAtMjk2NCw5ICsxODU5LDkgQEAKICAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0NF9wYWE0LCAgICAgICBTRE1NQzQsICAgICBTUEkzLCAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyNzAsICBOLCAgWSwgIE4pLAogICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ1X3BhYTUsICAgICAgIFNETU1DNCwgICAgIFNQSTMsICAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3NCwgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoc2RtbWM0X2RhdDZfcGFhNiwgICAgICAgU0RNTUM0LCAgICAgU1BJMywgICAgICAgR01JLCAgICAgICAgICBSU1ZENCwgICAgICAgU0RNTUM0LCAgICAgMHgzMjc4LCAgTiwgIFksICBOKSwKLSAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0N19wYWE3LCAgICAgICBTRE1NQzQsICAgICBSU1ZEMSwgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyN2MsICBOLCAgWSwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ3X3BhYTcsICAgICAgIFNETU1DNCwgICAgIFJTVkQyLCAgICAgIEdNSSwgICAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3YywgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoY2FtX21jbGtfcGNjMCwgICAgICAgICAgVkksICAgICAgICAgVklfQUxUMSwgICAgVklfQUxUMywgICAgICBTRE1NQzIsICAgICAgVkksICAgICAgICAgMHgzMjg0LCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChwY2MxLCAgICAgICAgICAgICAgICAgICBJMlM0LCAgICAgICBSU1ZEMSwgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBJMlM0LCAgICAgICAweDMyODgsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHBjYzEsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIEkyUzQsICAgICAgIDB4MzI4OCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAocGJiMCwgICAgICAgICAgICAgICAgICAgVkdQNiwgICAgICAgVklNQ0xLMiwgICAgU0RNTUMyLCAgICAgICBWSU1DTEsyX0FMVCwgVkdQNiwgICAgICAgMHgzMjhjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChjYW1faTJjX3NjbF9wYmIxLCAgICAgICBWR1AxLCAgICAgICBJMkMzLCAgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBWR1AxLCAgICAgICAweDMyOTAsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGNhbV9pMmNfc2RhX3BiYjIsICAgICAgIFZHUDIsICAgICAgIEkyQzMsICAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIFZHUDIsICAgICAgIDB4MzI5NCwgIFksICBOLCAgTiksCkBAIC0zMDQ3LDggKzE5NDIsOCBAQAogICAgICAgIFBJTkdST1VQKGdwaW9fdzNfYXVkX3B3MywgICAgICAgIFNQSTYsICAgICAgIFNQSTEsICAgICAgIFNQSTIsICAgICAgICAgSTJDMSwgICAgICAgIFNQSTEsICAgICAgIDB4MzNmMCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAodXNiX3ZidXNfZW4wX3BuNCwgICAgICAgVVNCLCAgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgVVNCLCAgICAgICAgMHgzM2Y0LCAgWSwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUCh1c2JfdmJ1c19lbjFfcG41LCAgICAgICBVU0IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBVU0IsICAgICAgICAweDMzZjgsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzNmYywgIE4sICBOLCAgTiksCi0gICAgICAgUElOR1JPVVAoc2RtbWMzX2Nsa19sYl9pbl9wZWU1LCAgU0RNTUMzLCAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgU0RNTUMzLCAgICAgMHgzNDAwLCAgTiwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChzZG1tYzNfY2xrX2xiX2luX3BlZTUsICBTRE1NQzMsICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzMsICAgICAweDMzZmMsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzQwMCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAoZ21pX2Nsa19sYiwgICAgICAgICAgICAgU0RNTUMyLCAgICAgUlNWRDIsICAgICAgR01JLCAgICAgICAgICBSU1ZENCwgICAgICAgU0RNTUMyLCAgICAgMHgzNDA0LCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChyZXNldF9vdXRfbiwgICAgICAgICAgICBSU1ZEMSwgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJFU0VU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pMmM3X2JfcGluc1tdID0geworCS8qIFNDTCwgU0RBICovCisJUkNBUl9HUF9QSU4oMiwgMiksIFJDQVJfR1BfUElOKDIsIDMpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaTJjN19iX211eFtdID0geworCVNDTDdfQl9NQVJLLCBTREE3X0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGkyYzdfY19waW5zW10gPSB7CisJLyogU0NMLCBTREEgKi8KKwlSQ0FSX0dQX1BJTig2LCAyOCksIFJDQVJfR1BfUElOKDYsIDI5KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGkyYzdfY19tdXhbXSA9IHsKKwlTQ0w3X0NfTUFSSywgU0RBN19DX01BUkssCit9OworLyogLSBJMkM4IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaTJjOF9waW5zW10gPSB7CisJLyogU0NMLCBTREEgKi8KKwlSQ0FSX0dQX1BJTig0LCAxMyksIFJDQVJfR1BfUElOKDQsIDE0KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGkyYzhfbXV4W10gPSB7CisJU0NMOF9NQVJLLCBTREE4X01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBpMmM4X2JfcGluc1tdID0geworCS8qIFNDTCwgU0RBICovCisJUkNBUl9HUF9QSU4oMiwgNCksIFJDQVJfR1BfUElOKDIsIDUpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgaTJjOF9iX211eFtdID0geworCVNDTDhfQl9NQVJLLCBTREE4X0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IGkyYzhfY19waW5zW10gPSB7CisJLyogU0NMLCBTREEgKi8KKwlSQ0F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WQgaW50IG1zaW9mMV9yeF9iX211eFtdID0geworCU1TSU9GMV9SWERfQl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4X2JfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDcsIDE3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9iX211eFtdID0geworCU1TSU9GMV9UWERfQl9NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2NfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDIsIDE1KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfY19tdXhbXSA9IHsKKwlNU0lPRjFfU0NLX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zeW5jX2NfcGluc1tdID0geworCS8qIFNZTkMgKi8KKwlSQ0FSX0dQX1BJTigyLCAxNiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19jX211eFtdID0geworCU1TSU9GMV9TWU5DX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9jX3BpbnNbXSA9IHsKKwkvKiBSWEQgKi8KKwlSQ0FSX0dQX1BJTigyLCAxOCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhfY19tdXhbXSA9IHsKKwlNU0lPRjFfUlhEX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9jX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTigyLCAxNyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfdHhfY19tdXhbXSA9IHsKK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C0yMTM1LDYgKzI0MDQsMTk3IEBACiBzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl90eF9tdXhbXSA9IHsKIAlNU0lPRjJfVFhEX01BUkssCiB9OworCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfYl9waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oMywgMCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2JfbXV4W10gPSB7CisJTVNJT0YyX1NDS19CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19iX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMywgMSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19iX211eFtdID0geworCU1TSU9GMl9TWU5DX0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zczFfYl9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oMywgOCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3MxX2JfbXV4W10gPSB7CisJTVNJT0YyX1NTMV9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3MyX2JfcGluc1tdID0geworCS8qIFNTMiAqLworCVJDQVJfR1BfUElOKDMsIDkpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3NzMl9iX211eFtdID0geworCU1TSU9GMl9TUzJfQl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3J4X2JfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDMsIDE3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9yeF9iX211eFtdID0geworCU1TSU9GMl9SWERfQl9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2JfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDMsIDE2KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl90eF9iX211eFtdID0geworCU1TSU9GMl9UWERfQl9NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2NfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDIsIDIpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX2Nsa19jX211eFtdID0geworCU1TSU9GMl9TQ0tfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3N5bmNfY19waW5zW10gPSB7CisJLyogU1lOQyAqLworCVJDQVJfR1BfUElOKDIsIDMpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3N5bmNfY19tdXhbXSA9IHsKKwlNU0lPRjJfU1lOQ19DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfcnhfY19waW5zW10gPSB7CisJLyogUlhEICovCisJUkNBUl9HUF9QSU4oMiwgNSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfcnhfY19tdXhbXSA9IHsKKwlNU0lPRjJfUlhEX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl90eF9jX3BpbnNbXSA9IHsKKwkvKiBUWEQgKi8KKwlSQ0FSX0dQX1BJTigyLCA0KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl90eF9jX211eFtdID0geworCU1TS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worc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfdHhfZF9waW5zW10gPSB7CisJLyogVFhEICovCisJUkNBUl9HUF9QSU4oMiwgMTYpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2RfbXV4W10gPSB7CisJTVNJT0YyX1RYRF9EX01BUkssCit9OworCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfZV9waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oNywgMTUpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX2Nsa19lX211eFtdID0geworCU1TSU9GMl9TQ0tfRV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3N5bmNfZV9waW5zW10gPSB7CisJLyogU1lOQyAqLworCVJDQVJfR1BfUElOKDcsIDE2KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zeW5jX2VfbXV4W10gPSB7CisJTVNJT0YyX1NZTkNfRV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3J4X2VfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDcsIDE0KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9yeF9lX211eFtdID0geworCU1TSU9GMl9SWERfRV9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2VfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDcsIDEzKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl90eF9lX211eFtdID0geworCU1TSU9GMl9UWERfRV9NQVJLLAorfTsKKy8qIC0gUVNQSSAtLS0tLS0tLS0tLS0tLS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ICogfCBNb2R1bGUgSW5pdCBhbmQgUHJvYmUgICAgICAgIHwgICAgICAgMHgwMTViICAgICAgIHwgMHg0YiwweGJhLDB4ZmEgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgweDAxNWEJfAotICogfCBNYWlsYm94IGNvbW1hbmRzICAgICAgICAgICAgIHwgICAgICAgMHgxMTg3ICAgICAgIHwgMHgxMTFhLTB4MTExYiAgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgxMTU1LTB4MTE1OCAgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgxMDE4LTB4MTAxOSAgfAorICogfCBNb2R1bGUgSW5pdCBhbmQgUHJvYmUgICAgICAgIHwgICAgICAgMHgwMTdkICAgICAgIHwgMHgwMDRiLDB4MDE0MQl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDAxNDQsMHgwMTQ2CXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MDE1Yi0weDAxNjAJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgwMTZlLTB4MDE3MAl8CisgKiB8IE1haWxib3ggY29tbWFuZHMgICAgICAgICAgICAgfCAgICAgICAweDExODcgICAgICAgfCAweDEwMTgtMHgxMDE5CXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTBjYSAgICAgICAgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTExNS0weDExMTYgIHwKLSAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTBjYQkJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgxMTFhLTB4MTExYgl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDExNTUtMHgxMTU4ICB8CiAgKiB8IERldmljZSBEaXNjb3ZlcnkgICAgICAgICAgICAgfCAgICAgICAweDIwOTUgICAgICAgfCAweDIwMjAtMHgyMDIyLCB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDIwMTEtMHgyMDEyLCB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDIwMTYgICAgICAgICB8CkBAIC0zMiwxOCArMzQsMTcgQEAKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA0NywweDUwNTIgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA4NCwweDUwNzUJfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg1MDNkLDB4NTA0NCAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg1MDdiCQl8CiAgKiB8IFRpbWVyIFJvdXRpbmVzICAgICAgICAgICAgICAgfCAgICAgICAweDYwMTIgICAgICAgfCAgICAgICAgICAgICAgICB8Ci0gKiB8IFVzZXIgU3BhY2UgSW50ZXJhY3Rpb25zICAgICAgfCAgICAgICAweDcwZTEgICAgICAgfCAweDcwMTgsMHg3MDJlLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwMjAsMHg3MDI0LCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwMzksMHg3MDQ1LCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwNzMtMHg3MDc1LCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwN2IsMHg3MDhjLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTUsMHg3MGE2LCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTgsMHg3MGFiLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYWQtMHg3MGFlLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZDEtMHg3MGRiLCB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwNDcsMHg3MDNiCXwKLSAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NzBkZS0weDcwZGYsIHwKKyAqIHwgVXNlciBTcGFjZSBJbnRlcmFjdGlvbnMgICAgICB8ICAgICAgIDB4NzBlMiAgICAgICB8IDB4NzAxOCwweDcwMmUgIHwKKyAqIHwJCQkJICB8CQkgICAgICAgfCAweDcwMjAsMHg3MDI0ICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwMzksMHg3MDQ1ICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwNzMtMHg3MDc1ICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTUtMHg3MGE2ICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYTgsMHg3MGFiICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwYWQtMHg3MGFlICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZDctMHg3MGRiICB8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZGUtMHg3MGRmICB8CiAgKiB8IFRhc2sgTWFuYWdlbWVudCAgICAgICAgICAgICAgfCAgICAgICAweDgwM2QgICAgICAgfCAweDgwMjUtMHg4MDI2ICB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDgwMGIsMHg4MDM5ICB8CiAgKiB8IEFFUi9FRUggICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAweDkwMTEgICAgICAgfAkJfApAQCAtNTksNyArNjAsMTEgQEAKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4YjEzYy0weGIxNDAgIHwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4YjE0OQkJfAogICogfCBNdWx0aVEgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgMHhjMDBjICAgICAgIHwJCXwKLSAqIHwgTWlzYyAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4ZDAxMCAgICAgICB8CQl8CisgKiB8IE1pc2MgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAweGQyZmYgICAgICAgfCAweGQwMTctMHhkMDE5CXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4ZDAyMAkJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHhkMDJlLTB4ZDBmZgl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweGQxMDEtMHhkMWZlCXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4ZDIxMi0weGQyZmUJfAogICogfCBUYXJnZXQgTW9kZQkJICB8CSAgMHhlMDcwICAgICAgIHwgMHhlMDIxCQl8CiAgKiB8IFRhcmdldCBNb2RlIE1hbmFnZW1lbnQJICB8CSAgMHhmMDcyICAgICAgIHwgMHhmMDAyLTB4ZjAwMwl8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweGYwNDYtMHhmMDQ5ICB8CkBAIC0xMDQsNyArMTA5LDg3IEBACiAJcmV0dXJuIHB0ciArIChyc3AtPmxlbmd0aCAqIHNpemVvZihyZXNwb25zZV90KSk7CiB9CiAKLXN0YXRpYyBpbnQKK2ludAorcWxhMjd4eF9kdW1wX21waV9yYW0oc3RydWN0IHFsYV9od19kYXRhICpoYSwgdWludDMyX3QgYWRkciwgdWludDMyX3QgKnJhbSwKKwl1aW50MzJfdCByYW1fZHdvcmRzLCB2b2lkICoqbnh0KQoreworCWludCBydmFsOworCXVpbnQzMl90IGNudCwgc3RhdCwgdGltZXIsIGR3b3JkcywgaWR4OworCXVpbnQxNl90IG1iMCwgbWIxOworCXN0cnVjdCBkZXZpY2Vf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BmbGFncyk7CisJY29udHJvbGxlci0+eGZlciA9IE5VTEw7CisJaWYgKCFyZXQpCisJCXJldCA9IGNvbnRyb2xsZXItPmVycm9yOworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmNvbnRyb2xsZXItPmxvY2ssIGZsYWdzKTsKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IHNwaV9xdXBfcHJvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldikKK3sKKwlzdHJ1Y3Qgc3BpX21hc3RlciAqbWFzdGVyOworCXN0cnVjdCBjbGsgKmljbGssICpjY2xrOworCXN0cnVjdCBzcGlfcXVwICpjb250cm9sbGVyOworCXN0cnVjdCByZXNvdXJjZSAqcmVzOworCXN0cnVjdCBkZXZpY2UgKmRldjsKKwl2b2lkIF9faW9tZW0gKmJhc2U7CisJdTMyIGRhdGEsIG1heF9mcmVxLCBpb21vZGU7CisJaW50IHJldCwgaXJxLCBzaXplOworCisJZGV2ID0gJnBkZXYtPmRldjsKKwlyZXMgPSBwbGF0Zm9ybV9nZXRfcmVzb3VyY2UocGRldiwgSU9SRVNPVVJDRV9NRU0sIDApOworCWJhc2UgPSBkZXZtX2lvcmVtYXBfcmVzb3VyY2UoZGV2LCByZXMpOworCWlmIChJU19FUlIoYmFzZSkpCisJCXJldHVybiBQVFJfRVJSKGJhc2UpOworCisJaXJxID0gcGxhdGZvcm1fZ2V0X2lycShwZGV2LCAwKTsKKwlpZiAoaXJxIDwgMCkKKwkJcmV0dXJuIGlycTsKKworCWNjbGsgPSBkZXZtX2Nsa19nZXQoZGV2LCAiY29yZSIpOworCWlmIChJU19FUlIoY2NsaykpCisJCXJldHVybiBQVFJfRVJSKGNjbGspOworCisJaWNsayA9IGRldm1fY2xrX2dldChkZXYsICJpZmFjZSIpOworCWlmIChJU19FUlIoaWNsaykpCisJCXJldHVybiBQVFJfRVJSKGljbGspOworCisJLyogVGhpcyBpcyBvcHRpb25hbCBwYXJhbWV0ZXIgKi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vcnQgaGFuZCwgdW5zaWduZWQgc2hvcnQgd0FyZWEsIHZvaWQgKnB2QnVmZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCBkd0xlbmd0aCwgc2hvcnQgZVN6KQogewotICAgIFRSQU5TRkVSREVTQyB0ZDsKKyAgICBzdHJ1Y3QgdHJhbnNmZXJfYXJlYV9kZXNjIHRkOwogICAgIHNob3J0IHNFcnIgPSBDaGVja0hhbmRsZShoYW5kKTsKICAgICBpZiAoc0VyciAhPSBVMTRFUlJfTk9FUlJPUikKICAgICAgICAgcmV0dXJuIHNFcnI7CkBAIC0yMjkyLDcgKzIyOTIsNyBAQAogICAgICAgICB0ZC5lU2l6ZSA9IDA7ICAgICAgICAgICAgICAgIC8vIER1bW15IGVsZW1lbnQgc2l6ZQogCiAgICAgICAgIGlmIChEZXZpY2VJb0NvbnRyb2woYUhhbmQxNDAxW2hhbmRdLCh1bnNpZ25lZCBpbnQpVTE0X1NFVFRSQU5TRkVSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZCxzaXplb2YoVFJBTlNGRVJERVNDKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdGQsc2l6ZW9mKHN0cnVjdCB0cmFuc2Zlcl9hcmVhX2Rlc2MpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyV29yayxzaXplb2YoUEFSQU1CTEspLCZkd0J5dGVzLE5VTEwpKQogICAgICAgICB7CiAgICAgICAgICAgICBpZiAoZHdCeXRlcyA+PSBzaXplb2YoUEFSQU1CTEspKSAgICAvLyBtYXliZSBlcnJvciBmcm9tIGRyaXZlcj8KQEAgLTI0OTYsMTQgKzI0OTYsMTQgQEAKICAgICB7CiAgICAgICAgIFBBUkFNQkxLIHJXb3JrOwogICAgICAgICB1bnNpZ25lZCBpbnQgZHdCeXRlczsKLSAgICAgICAgVFJBTlNGRVJERVNDIHR4RGVzYzsKKyAgICAgICAgc3RydWN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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZXMgVGhlIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICAgICAgICAgICAgOiAwIENvbmZpZ3VyZSBBcyBUaW1lciAgICAgIHwKLXwJCQkJCQkJCQkJICAgMSBDb25maWd1cmUgQXMgV2F0Y2hkb2cgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICAgICAgICAgICAgOiBXYXRjaGRvZyBudW1iZXIKLXwJCQkJCSAgZGF0YVsyXSAgICAgICAgICAgIDogVGltZSBiYXNlIFVuaXQgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbM10JCQkgOiBSZWxvYWQgVmFsdWUJCQkgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNF0gICAgICAgICAgICA6IEV4dGVybmFsIFRyaWdnZXIgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTpFbmFibGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA6RGlzYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNV0gICAgICAgICAgICA6RXh0ZXJuYWwgVHJpZ2dlciBMZXZlbAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDAgVHJpZ2dlciBEaXNhYmxlZAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDEgVHJpZ2dlciBFbmFibGVkIChMb3cgbGV2ZWwpCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMCBUcmlnZ2VyIEVuYWJsZWQgKEhpZ2ggTGV2ZWwpCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMSBUcmlnZ2VyIEVuYWJsZWQgKEhpZ2gvTG93IGxldmVsKQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNl0gICAgICAgICAgICA6IEV4dGVybmFsIEdhdGUgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTpFbmFibGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwOkRpc2FibGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzddICAgICAgICAgICAgOiBFeHRlcm5hbCBHYXRlIGxldmVsCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMCBHYXRlIERpc2FibGVkCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMSBHYXRlIEVuYWJsZWQgKExvdyBsZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwIEdhdGUgRW5hYmxlZCAoSGlnaCBMZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzhdICAgICAgICAgICAgOldhcm5pbmcgUmVsYXkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE6IEVOQUJMRQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDogRElTQUJMRQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbOV0gICAgICAgICAgICA6V2FybmluZyBEZWxheSBhdmFpbGFibGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzEwXSAgICAgICAgICAgOldhcm5pbmcgUmVsYXkgVGltZSB1bml0Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxMV0gICAgICAgICAgIDpXYXJuaW5nIFJlbGF5IFRpbWUgUmVsb2FkIHZhbHVlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxMl0gICAgICAgICAgIDpSZXNldCBSZWxheQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IEVOQUJMRQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCA6IERJU0FCTEUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzEzXSAgICAgICAgICAgOkludGVycnVwdAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSA6IEVOQUJMR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oZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogU2V0IHRoZSByZWxvYWQgdmFsdWUgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKiovCisKKwkvKiBTZXQgdGhlIHJlbG9hZCB2YWx1ZSAqLwogCW91dGwoZGF0YVszXSwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyA0KTsKLS8qKioqKioqKioqKioqKioqKioqKiovCi0vKiBTZXQgdGhlIHRpbWUgdW5pdCAqLwotLyoqKioqKioqKioqKioqKioqKioqKi8KKworCS8qIFNldCB0aGUgdGltZSB1bml0ICovCiAJb3V0bChkYXRhWzJdLCBkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDgpOwogCWlmIChkYXRhWzBdID09IEFERElEQVRBX1RJTUVSKSB7CiAKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNldCB0aGUgbW9kZSA6ICAgICAgICAgICAgICovCiAJCS8qIC0gRGlzYWJsZSB0aGUgaGFyZHdhcmUgICAgICovCiAJCS8qIC0gRGlzYWJsZSB0aGUgY291bnRlciBtb2RlICovCkBAIC0yMDYsMTAxICsxNTEsODIgQEAKIAkJLyogLSBEaXNhYmxlIHRoZSByZXNldCAgICAgICAgKi8KIAkJLyogLSBFbmFibGUgdGhlIHRpbWVyIG1vZGUgICAgKi8KIAkJLyogLSBTZXQgdGhlIHRpbWVyIG1vZGUgICAgICAgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJdWlfQ29tbWFuZCA9CiAJCQkodWlfQ29tbWFuZCAmIDB4RkZGNzE5RTJVTCkgfCB1aV9Nb2RlIDw8IDEzVUwgfCAweDEwVUw7CiAKLQl9CQkJLyogaWYgKGRhdGFbMF0gPT0gQURESURBVEFfVElNRVIpICovCi0JZWxzZSB7Ci0JCWlmIChkYXRhWzBdID09IEFERElEQVRBX1dBVENIRE9HKSB7CisJfSBlbHNlIGlmIChkYXRhWzBdID09IEFERElEQVRBX1dBVENIRE9HKSB7CiAKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkvKiBTZXQgdGhlIG1vZGUgOiAgICAgICAgICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSBoYXJkd2FyZSAgICAgKi8KLQkJCS8qIC0gRGlzYWJsZSB0aGUgY291bnRlciBtb2RlICovCi0JCQkvKiAtIERpc2FibGUgdGhlIHdhcm5pbmcgICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSByZXNldCAgICAgICAgKi8KLQkJCS8qIC0gRGlzYWJsZSB0aGUgdGltZXIgbW9kZSAgICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCQkvKiBTZXQgdGhlIG1vZGUgOiAgICAgICAgICAgICAqLworCQkvKiAtIERpc2FibGUgdGhlIGhhcmR3YXJlICAgICAqLworCQkvKiAtIERpc2FibGUgdGhlIGNvdW50ZXIgbW9kZSAqLworCQkvKiAtIERpc2FibGUgdGhlIHdhcm5pbmcgICAgICAqLworCQkvKiAtIERpc2FibGUgdGhlIHJlc2V0ICAgICAgICAqLworCQkvKiAtIERpc2FibGUgdGhlIHRpbWVyIG1vZGUgICAqLwogCi0JCQl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCAmIDB4RkZGODE5RTJVTDsKKwkJdWlfQ29tbWFuZCA9IHVpX0NvbW1hbmQgJiAweEZGRjgxOUUyVUw7CiAKLQkJfSBlbHNlIHsKLQkJCXByaW50aygiXG4gVGhlIHBhcmFtZXRlciBmb3IgVGltZXIvd2F0Y2hkb2cgc2VsZWN0aW9uIGlzIGluIGVycm9yXG4iKTsKLQkJCXJldHVybiAtRUlOVkFMOwotCQl9CisJfSBlbHNlIHsKKwkJZGV2X2VycihkZXYtPmNsYXNzX2RldiwgIlRoZSBwYXJhbWV0ZXIgZm9yIFRpbWVyL3dhdGNoZG9nIHNlbGVjdGlvbiBpcyBpbiBlcnJvclxuIik7CisJCXJldHVybiAtRUlOVkFMOwogCX0KKwogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0JdWlfQ29tbWFuZCA9IDA7CisKIAl1aV9Db21tYW5kID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgdHJpZ2dlciAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgdHJpZ2dlciAqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjg5RlVMOwogCWlmIChkYXRhWzRdID09IEFERElEQVRBX0VOQUJMRSkgewotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJCS8qIFNldCB0aGUgaGFyZHdhcmUgdHJpZ2dlciBsZXZlbCAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzVdIDw8IDUpOwogCX0KIAlvdXRsKHVpX0NvbW1hbmQsIGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCXVpX0NvbW1hbmQgPSAwOworCiAJdWlfQ29tbWFuZCA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIERpc2FibGUgd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0cHV0IGxldmVsICovCiAJdWlfQ29tbWFuZCA9IHVpX0NvbW1hbmQgfCAoZGF0YVs4XSA8PCAyKTsKIAlvdXRsKHVpX0NvbW1hbmQsIGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwogCWlmIChkYXRhWzldID09IEFERElEQVRBX0VOQUJMRSkgewotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KKwogCQkvKiBTZXQgdGhlIHJlbG9hZCB2YWx1ZSAqLwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0bChkYXRhWzExXSwKIAkJCWRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMjQpOwotICAgLyoqKioqKioqKioqKioqKioqKioqKiovCisKIAkJLyogU2V0IHRoZSB0aW1lIHVuaXRlICovCi0gICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0bChkYXRhWzEwXSwKIAkJCWRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMjgpOwogCX0KIAotCXVpX0NvbW1hbmQgPSAwOwogCXVpX0NvbW1hbmQgPSBpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKIAkvKiBEaXNhYmxlIHRoZSBoYXJkd2FyZSBvdXRwdXQgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCAmIDB4RkZGRkY5RjdVTDsKLSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKIAkvKiBTZXQgdGhlIGhhcmR3YXJlIG91dHB1dCBsZXZlbCAqLwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzEyXSA8PCAzKTsKIAlvdXRsKHVpX0NvbW1hbmQsIGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotIC8qKiAgRW5hYmxlIHRoZSB3YXRjaGRvZyBpbnRlcnJ1cHQgICoqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCXVpX0NvbW1hbmQgPSAwOworCisJLyogRW5hYmxlIHRoZSB3YXRjaGRvZyBpbnRlcnJ1cHQgKi8KIAl1aV9Db21tYW5kID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBTZXQgdGhlIGludGVycnVwdCBzZWxlY3Rpb24gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogU2V0IHRoZSBpbnRlcnJ1cHQgc2VsZWN0aW9uICovCiAJdWlfU3RhdHVzID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTYpOwogCiAJdWlfQ29tbWFuZCA9ICh1aV9Db21tYW5kICYgMHhGRkZGRjlGRFVMKSB8IChkYXRhWzEzXSA8PCAxKTsKQEAgLTMxMCw4MiArMjM2LDYzIEBACiB9CiAKIC8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgRnVuY3Rpb24gICBOYW1lICAgOiBpbnQgaV9BUENJMDM1X1N0YXJ0U3RvcFdyaXRlVGltZXJXYXRjaGRvZyAgICAgICAgICAgICAgfAotfAkJCSAgKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IFN0YXJ0IC8gU3RvcCBUaGUgU2VsZWN0ZWQgVGltZXIgLCBvciBXYXRjaGRvZyAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18CQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdIDogMCAtIFN0b3AgU2VsZWN0ZWQgVGltZXIvV2F0Y2hkb2cgICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDEgLSBTdGFydCBTZWxlY3RlZCBUaW1lci9XYXRjaGRvZyAgICB8Ci18CQkJCQkgICAgICAgICAgICAyIC0gVHJpZ2dlciBTZ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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uICAgTmFtZSAgIDogaW50IGlfQVBDSTAzNV9SZWFkVGltZXJXYXRjaGRvZyAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkgIChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBSZWFkIFRoZSBTZWxlY3RlZCBUaW1lciAsIENvdW50ZXIgb3IgV2F0Y2hkb2cgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgIAkJCQkJCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6CWRhdGFbMF0gICAgICAgICAgICA6IHNvZnR3YXJlIHRyaWdnZXIgc3RhdHVzCi18ICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICAgICAgICAgICAgOiBoYXJkd2FyZSB0cmlnZ2VyIHN0YXR1cwotfCAgICAgCSAgCSAgICAgICAgZGF0YVsyXSAgICAgICAgICAgIDogU29mdHdhcmUgY2xlYXIgc3RhdHVzCi18ICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzNdICAgICAgICAgICAgOiBPdmVyZmxvdyBzdGF0dXMKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNF0gICAgICAgICAgICA6IFRpbWVyIGFjdHVhbCB2YWx1ZQotfAotCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiBUUlVFICA6IE5vIGVycm9yIG9jY3VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJICAgICAgICAgICAgOiBGQUxTRSA6IEVycm9yIG9jY3VyLiBSZXR1cm4gdGhlIGVycm9yICAgICAgICAgIHwKLXwJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSov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otCiAJdWlfU3RhdHVzID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTYpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIEdldCB0aGUgc29mdHdhcmUgdHJpZ2dlciBzdGF0dXMgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KIAlkYXRhWzBdID0gKCh1aV9TdGF0dXMgPj4gMSkgJiAxKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogR2V0IHRoZSBoYXJkd2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQlkYXRhWzFdID0gKCh1aV9TdGF0dXMgPj4gMikgJiAxKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIEdldCB0aGUgc29mdHdhcmUgY2xlYXIgc3RhdHVzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQlkYXRhWzJdID0gKCh1aV9TdGF0dXMgPj4gMykgJiAxKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCS8qIEdldCB0aGUgb3ZlcmZsb3cgc3RhdHVzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQlkYXRhWzNdID0gKCh1aV9TdGF0dXMgPj4gMCkgJiAxKTsKLQlpZiAoZGV2cHJpdi0+Yl9UaW1lclNlbGVjdE1vZGUgPT0gQURESURBVEFfVElNRVIpIHsKLQkJZGF0YVs0XSA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDApOwogCi0JfQkJCS8qICAgaWYgIChkZXZwcml2LT5iX1RpbWVyU2VsZWN0TW9kZT09QURESURBVEFfVElNRVIpICovCisJLyogR2V0IHR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AgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYgICAgICA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzICAgICA6IFN1YmRldmljZSBQb2ludGVyICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbiAgICAgICA6IEluc24gU3RydWN0dXJlIFBvaW50ZXIgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18ICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICAgIDogV2FybmluZyBkZWxheSB2YWx1ZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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0ZWQgZm9yIGVhY2ggcG9ydC4gICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgVGhlIGZpcnN0IGV2ZW50IGlzIHJlbGF0ZWQgdG8gdGhlIGZpcnN0IDggY2hhbm5lbHMgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAocG9ydCAxKSBhbmQgdGhlIHNlY29uZCB0byB0aGUgZm9sbG93aW5nIDYgY2hhbm5lbHMgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIChwb3J0IDIpLiBBbiBpbnRlcnJ1cHQgaXMgZ2VuZXJhdGVkIHdoZW4gb25lIG9yIGJvdGggICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZXZlbnRzIGhhdmUgb2NjdXJyZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkgIGRhdGFbMF0gICAgICAgICAgICA6TnVtYmVyIG9mIHRoZSBpbnB1dCBwb3J0IG9uICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaCB0aGUgZXZlbnQgd2lsbCB0YWtlIHBsYWNlICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgxIG9yIDIpCi18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IFRoZSBldmVudCBsb2dpYyBmb3IgcG9ydCAxIGhhcyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJlZSBwb3NzaWJpbGl0aWVzICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOjAgIEFQQ0kxNTAwX0FORCAgICAgICA6VGhpcyBsb2dpYyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rcyAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBpbnB1dHMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aCBhbiBBTkQgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dpYy4gICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSBBUENJMTUwMF9PUiAgICAgICAgOlRoaXMgbG9naWMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3MgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgaW5wdXRzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1IgbG9naWMuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgQVBDSTE1MDBfT1JfUFJJT1JJVFkgICAgICAgIHwKLXwJCQkJCQkJCTpUaGlzIGxvZ2ljICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtzICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGlucHV0cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGEgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1IgbG9naWMuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnB1dCAxICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhcyB0aGUgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGVzdCAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmlvcml0eSAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsIGFuZCAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgICA4ICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgc21hbGxlc3R8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgdGhlIHNlY29uZCBwb3J0IHRoZSB1c2VyIGhhc3wKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgcG9zc2liaWxpdHk6ICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBDSTE1MDBfT1IgICAgICAgIDpUaGlzIGxvZ2ljICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtzICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGlucHV0cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGEgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvbGFyaXR5ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1IgbG9naWMgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIGRhdGFbMl0gICAgICAgICAgICAgIDogVGhlc2UgOC1jaGFyYWN0ZXIgd29yZCBmb3IgcG9ydDF8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmQgNi1jaGFyYWN0ZXIgd29yZCBmb3IgcG9ydCAyIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdpdmUgdGhlIG1hc2sgb2YgdGhlIGV2ZW50LiAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWFjaCBwbGFjZSBnaXZlcyB0aGUgc3RhdGUgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0aGUgaW5wdXQgY2hhbm5lbHMgYW5kIGNhbiAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhdmUgb25lIG9mIHRoZXNlIHNpeCBjaGFyYWN0ZXJzfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgIDogVGhpcyBpbnB1dCBtdXN0IGJlIG9uIDAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgOiBUaGlzIGlucHV0IG11c3QgYmUgb24gMSAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICA6IFRoaXMgaW5wdXQgcmVhY3RzIHRvICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSBmYWxsaW5nIGVkZ2UgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgOiBUaGlzIGlucHV0IHJlYWN0cyB0byBhICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ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LDEwIEBACiAJaW50IGlfUGF0dGVyblRyYW5zaXRpb25Db3VudCA9IDAsIGlfUmVnVmFsdWU7CiAJaW50IGk7CiAKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogRGlzYWJsZXMgIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKIAlpZiAoZGF0YVswXSA9PSAxKSB7CkBAIC0yNTksNyArMTc4LDggQEAKIAkJCWlfTWF4Q2hhbm5lbCA9IDY7CiAJCX0JCS8qICBpZihkYXRhWzBdPT0yKSAqLwogCQllbHNlIHsKLQkJCXByaW50aygiXG5UaGUgc3BlY2lmaWVkIHBvcnQgZXZlbnQgIGRvZXMgbm90IGV4aXN0XG4iKTsKKwkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCSJUaGUgc3BlY2lmaWVkIHBvcnQgZXZlbnQgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qIGVsc2UgaWYoZGF0YVswXT09MikgKi8K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sxXSA9PSBBUENJMTUwMF9PUiB8fAogCQkJZGF0YVsxXSA9PSBBUENJMTUwMF9PUl9QUklPUklUWSkgewotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdHMgaWYgYSB0cmFuc2l0aW9uIHdhcyBkZWNsYXJlZCAqLwogCQkJLyogZm9yIGEgT1IgUFJJT1JJVFkgbG9naWMgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpZiAoZGF0YVsxXSA9PSBBUENJMTUwMF9PUl9QUklPUklUWQogCQkJCSYmIGlfUGF0dGVyblRyYW5zaXRpb24gIT0gMCkgewotCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCS8qIFRyYW5zaXRpb24gZXJyb3Igb24gYW4gT1IgUFJJT1JJVFkgbG9naWMgKi8KLQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQlwcmludGsoIlxuVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBPUiBQUklPUklUWSBsb2dpY1xuIik7CisJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCSJUcmFuc2l0aW9uIGVycm9yIG9uIGFuIE9SIFBSSU9SSVRZIGxvZ2ljXG4iKTsKIAkJCQlyZXR1cm4gLUVJTlZBTDsKIAkJCX0JLyogIGlmIChkYXRhWzFdPT0gQVBDSTE1MDBfT1JfUFJJT1JJVFkgJiYgaV9QYXR0ZXJuVHJhbnNpdGlvbiAhPSAwKSAqLwogCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFRlc3RzIGlmIG1vcmUgdGhhbiBvbmUgdHJhbnNpdGlvbiAqLwogCQkJLyogd2FzIGRlY2xhcmVkIGZvciBhbiBBTkQgbG9naWMgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJaWYgKGRhdGFbMV0gPT0gQVBDSTE1MDBfQU5EKSB7CiAJCQkJZm9yIChpX0NvdW50ID0gMDsgaV9Db3VudCA8IDg7IGlfQ291bnQrKykgewpAQCAtMzYwLDI5ICsyNzQsMjEgQEAKIAkJCQl9CS8qIGZvciAoaV9Db3VudCA9IDA7IGlfQ291bnQgPCA4OyBpX0NvdW50KyspICovCiAKIAkJCQlpZiAoaV9QYXR0ZXJuVHJhbnNpdGlvbkNvdW50ID4gMSkgewotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCS8qIFRyYW5zaXRpb24gZXJyb3Igb24gYW4gQU5EIGxvZ2ljICAgICAqLwotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJCXByaW50aygiXG4gVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBBTkQgbG9naWNcbiIpOworCQkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJCSJUcmFuc2l0aW9uIGVycm9yIG9uIGFuIEFORCBsb2dpY1xuIik7CiAJCQkJCXJldHVybiAtRUlOVkFMOwogCQkJCX0JLyogIGlmIChpX1BhdHRlcm5UcmFuc2l0aW9uQ291bnQgPiAxKSAqLwogCQkJfQkvKiAgaWYgKGRhdGFbMV09PSBBUENJMTUwMF9BTkQpICovCiAKLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkvKioqKioqKioqKioqKioqKioqLwogCQkJLyogRGlzYWJsZSBQb3J0IEEgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YigweEYwLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIHBvbGFyaXR5IHJlZ2lzdGVyIG9mIHBvcnQgMSAgICAqLwotCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfUEFUVEVSTl9QT0xBUklUWSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMzkwLDIwICsyOTYsMTYgQEAKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcGF0dGVybiBtYXNrIHJlZ2lzdGVyIG9mICAgICAgKi8KIAkJCS8qIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1BBVFRFUk5fTUFTSywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJb3V0YihpX1BhdHRlcm5NYXNrLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHRyYW5zaXRpb24gcmVnaXN0ZXIgICovCiAJCQkvKiBvZiBwb3J0IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfUEFUVEVSTl9UUkFOU0lUSU9OLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC00MTEsMTAgKzMxMyw4IEBACiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIG1hc2sgICAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9TUEVDSUZJQ0FUSU9OLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC00MjIsMTcgKzMyMiwxMyBAQAogCQkJCWluYihkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gbWFzayAgICAqLwogCQkJLyogcmVnaXN0ZXIgb2YgcG9ydCAxICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFBvcnQgQSBuZXcgbW9kZSAgICAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHhGOSkgfCBkYXRhWzFdIHwgMHg5OwogCQkJb3V0YihpX1JlZ1ZhbHVlLApAQCAtNDQxLDUzICszMzcsNDAgQEAKIAogCQkJaV9FdmVudDFTdGF0dXMgPSAxOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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8KIAogCWlmIChkYXRhWzBdID09IDIpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIGV2ZW50IGxvZ2ljICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCWlmIChkYXRhWzFdID09IEFQQ0kxNTAwX09SKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEaXNhYmxlIFBvcnQgQiAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoMHg3NCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gbWFzayAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgQiAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0k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dHRlcm5UcmFuc2l0aW9uIHwgMHhDMCk7CiAKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCAyICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1BBVFRFUk5fUE9MQVJJVFksCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCW91dGIoaV9QYXR0ZXJuUG9sYXJpdHksCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcGF0dGVybiB0cmFuc2l0aW9uIHJlZ2lzdGVyICAgICovCiAJCQkvKiBvZiBwb3J0IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfUEFUVEVSTl9UUkFOU0lUSU9OLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQlvdXRiKGlfUGF0dGVyblRyYW5zaXRpb24sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcGF0dGVybiBNYXNrIHJlZ2lzdGVyICAgICovCiAJCQkvKiBvZiBwb3J0IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX01BU0ssCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKQEAgLTU0NiwyMCArNDE5LDE2IEBACiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IDIgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCWlfUmVnVmFsdWUgPQogCQkJCWluYihkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IDIgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTU2OSwyMyArNDM4LDIwIEBACiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKIAkJCWlfRXZlbnQyU3RhdHVzID0gMTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkvKiBFbmFibGUgUG9ydCBCICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAKIAkJCW91dGIoMHhGNCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQl9CQkvKiAgIGlmIChkYXRhWzFdID09IEFQQ0kxNTAwX09SKSAqLwogCQllbHNlIHsKLQkJCXByaW50aygiXG5UaGUgY2hvaWNlIGZvciBpbnRlcnJ1cHQgb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cnVjdCBjb21lZGlfZGV2aWNlICpkZXYgICAgICA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgfAotfAkJICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgdWlfQ2hhbm5lbCA6IENoYW5uZWwgbnVtYmVyIHRvIHJlYWQgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgICA6MCBTdGFydCBpbnB1dCBldmVudAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSBTdG9wIGlucHV0IGV2ZW50Ci18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICAgICAgIDpObyBvZiBwb3J0ICgxIG9yIDIpCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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XRhWzFdID09IDIpIHsKLQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdCBpZiBwb3J0IDEgc2VsZWN0ZWQgKi8KLQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpZiAoZGF0YVsxXSA9PSAxKSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBldmVudCBpbml0aWFsaXNlZCAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCWlmIChpX0V2ZW50MVN0YXR1cyA9PSAxKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIERpc2FibGUgUG9ydCBBICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RjAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgICAgICAqLwogCQkJCQkvKiBwb3J0IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBBbGxvd3MgdGhlIHBhdHRlcm4gaW50ZXJydXB0ICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4QzAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRW5hY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dXJuIC1FSU5WQUw7CiAJCQkJfQkvKiBlbHNlIGlmKGlfRXZlbnQxU3RhdHVzPT0xKSAqLwogCQkJfQkvKiBpZiAoZGF0YVsxXT09MSkgKi8KIAkJCWlmIChkYXRhWzFdID09IDIpIHsKIAogCQkJCWlmIChpX0V2ZW50MlN0YXR1cyA9PSAxKSB7Ci0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHg3NCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEFsbG93cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhDMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBFbmFibGUgUG9ydCBCICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGNCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAogCQkJCQkvKiBTZWxlY3RzIHRo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XJyb3JcbiIpOworCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJIlRoZSBwb3J0IHBhcmFtZXRlciBpcyBpbiBlcnJvclxuIik7CiAJCQlyZXR1cm4gLUVJTlZBTDsKIAkJfQkJLyogZWxzZSBpZiAoZGF0YVsxXSA9PSAxIHx8IGRhdGFbMF0gPT0gMikgKi8KIAogCQlicmVhazsKIAogCWNhc2UgU1RPUDoKLQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogVGVzdHMgdGhlIHBvcnQgbnVtYmVyICovCi0JCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKGRhdGFbMV0gPT0gMSB8fCBkYXRhWzFdID09IDIpIHsKLQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdCBpZiBwb3J0IDEgc2VsZWN0ZWQgKi8KLQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpZiAoZGF0YVsxXSA9PSAxKSB7Ci0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBldmVudCBpbml0aWFsaXNlZCAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCWlmIChpX0V2ZW50MVN0YXR1cyA9PSAxKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIERpc2FibGUgUG9ydCBBICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RjAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgICAgICAqLwogCQkJCQkvKiBwb3J0IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBJbmhpYml0cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhFMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBFbmFibGUgUG9ydCBBICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGNCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCQkJaV9FdmVudDFJbnRlcnJ1cHRTdGF0dXMgPSAwOwogCQkJCX0JLyogIGlmKGlfRXZlbnQxU3RhdHVzPT0xKSAqLwogCQkJCWVsc2UgewotCQkJCQlwcmludGsoIlxuRXZlbnQgMSBub3QgaW5pdGlhbGlzZWRcbiIpOworCQkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJCSJFdmVudCAxIG5vdCBpbml0aWFsaXNlZFxuIik7CiAJCQkJCXJldHVybiAtRUlOVkFMOwogCQkJCX0JLyogZWxzZSBpZihpX0V2ZW50MVN0YXR1cz09MSkgKi8KIAkJCX0JLyogaWYgKGRhdGFbMV09PTEpICovCiAJCQlpZiAoZGF0YVsxXSA9PSAyKSB7Ci0JCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFRlc3QgaWYgZXZlbnQgaW5pdGlhbGlzZWQgKi8KLQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJaWYgKGlfRXZlbnQyU3RhdHVzID09IDEpIHsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCSAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEIgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweDc0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgICAgICAqLwogCQkJCQkvKiBwb3J0IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogSW5oaWJpdHMgdGhlIHBhdHRlcm4gaW50ZXJydXB0ICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RTAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRW5hYmxlIFBvcnQgQiAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RjQsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQkJCWlfRXZlbnQySW50ZXJydXB0U3RhdHVzID0gMDsKIAkJCQl9CS8qICBpZihpX0V2ZW50MlN0YXR1cz09MSkgKi8KIAkJCQllbHNlIHsKLQkJCQkJcHJpbnRrKCJcbkV2ZW50IDIgbm90IGluaXRpYWxpc2VkXG4iKTsKKwk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0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IFRSVUUgIDogTm8gZXJyb3Igb2NjdXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICA6IEZBTFNFIDogRXJyb3Igb2NjdXIuIFJldHVybiB0aGUgZXJyb3IgICAgICAgICAgfAotfAkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotKi8KLXN0YXRpYyBpbnQgaV9BUENJMTUwMF9Jbml0aWFsaXNhdGlvbihzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCSAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkJICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCi0JCQkJICAgICB1bnNpZ25lZCBpbnQgKmRhdGEpCisgKiBSZXR1cm4gdGhlIHN0YXR1cyBvZiB0aGUgZGlnaXRhbCBpbnB1dAorICovCitzdGF0aWMgaW50IGFwY2kxNTAwX2RpX3JlYWQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywKKwkJCSAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCisJCQkgICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7CiAJaW50IGlfRHVtbXlSZWFkID0gMDsKIAotICAgIC8qKioqKioqKioqKioqKioqKiovCiAJLyogU29mdHdhcmUgcmVzZXQgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqLwogCWlfRHVtbXlSZWFkID0gaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9EdW1teVJlYWQgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC05MDIsMTYgKzY3MywxMiBAQAogCW91dGIoMSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiBjb250cm9sIHJlZ2lzdGVyICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweEY0LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1NQRUNJRklDQVRJT04sCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoMHgxMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC05NDMsOSArNzEwLDcgQEAKIAkvKiBEZWxldGVzIHRoZSByZWdpc3RlciAqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoMHgxMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC05NzUsOSArNzQwLDcgQEAKIAkvKiBEZWxldGVzIHRoZSByZWdpc3RlciAqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgZGF0YSBwYXRoIHBvbGFyaXR5IHJlZ2lzdGVy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tPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDIgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBJUCBhbmQgSVVTICovCkBAIC0xMDE2LDkgKzc3NSw3IEBACiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlYWN0aXZhdGVzIFRpbWVyIDIgaW50ZXJydXB0IG1hbmFnZW1lbnQ6ICAgICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgSVAg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KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogQ29uZmlndXJlcyB0aGUgZGlnaXRhbCBvdXRwdXQgbWVtb3J5IGFuZCB0aGUgZGlnaXRhbAotfCAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQgZXJyb3IgaW50ZXJydXB0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuICAgICAgOnBvaW50ZXIgdG8gaW5zbiBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICA6MTpNZW1vcnkgb24gICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDA6TWVtb3J5IG9mZiAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgOjEgRW5hYmxlIHRoZSB2b2x0YWdlIGVycm9yIGludGVycnVwdAotfAkJCQkJCQkgICA6MCBEaXNhYmxlIHRoZSB2b2x0YWdlIGVycm9yIGludGVycnVwdCAJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IFRSVUUgIDogTm8gZXJyb3Igb2NjdXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICA6IEZBTFNFIDogRXJyb3Igb2NjdXIuIFJldHVybiB0aGUgZXJyb3IgICAgICAgICAgfAotfAkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS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jb21lZGlfZGV2aWNlICpkZXYgICAgICA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgIDpwb2ludGVyIHRvIHN1YmRldmljZSBzdHJ1Y3R1cmUKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuICAgICAgOnBvaW50ZXIgdG8gaW5zbiBzdHJ1Y3R1cmUgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgdG8gcmVhZCBzdGF0dXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICA6IDIgICAgIEFQQ0kxNTAwXzFfOF9LSFoKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQVBDSTE1MDBfM182X0tIWiAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICBBUENJMTUwMF8xMTVfS0haCi18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICAgICAgOiAwICAgICBDb3VudGVyMS9UaW1lcjEKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIENvdW50ZXIyL1RpbWVyMgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgQ291bnRlcjMvV2F0Y2hkb2cKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIFRpbWVyL1dhdGNoZG9nCi18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbM10gICAgICAgICAgICAgICAgOiAgICAgICAgIFRoaXMgcGFyYW1ldGVyIGhhcyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHdvIG1lYW5pbmdzLiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBJZiB0aGUgY291bnRlci90aW1lciAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzIHVzZWQgYXMgYSBjb3VudGVyICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGxpbWl0IHZhbHVlIG9mICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgY291bnRlciBpcyBnaXZlbiAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gSWYgdGhlIGNvdW50ZXIvdGltZXIgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcyB1c2VkIGFzIGEgdGltZXIsICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBkaXZpZGVyIGZhY3RvciAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIHRoZSBvdXRwdXQgaXMgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnaXZlbi4KLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNF0gICAgICAgICAgICAgICAgIDogMCAgICBBUENJMTUwMF9DT05USU5VT1VTCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgQVBDSTE1MDBfU0lOR0xFCi18ICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzVdICAgICAgICAgICAgICAgICA6IDAgICAgU29mdHdhcmUgVHJpZ2dlcgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgIEhhcmR3YXJlIFRyaWdnZXIKLXwKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNl0gICAgICAgICAgICAgICAgICA6MCAgICBTb2Z0d2FyZSBnYXRlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgSGFyZHdhcmUgZ2F0ZQotfCAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs3XSAgICAgICAgICAgICAgICAgIDowICAgIEludGVycnVwdCBEaXNhYmxlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgSW50ZXJydXB0IEVuYWJsZQotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IFRSVUUgIDogTm8gZXJyb3Igb2NjdXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgIC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CQl8fCBkYXRhWzddID09IEFQQ0kxNTAwX0RJU0FCTEUpIHsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbW9kZSByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjFfTU9ERV9TUEVDSUZJQ0FUSU9OLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgbW9kZSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfVGltZXJDb3VudGVyTW9kZSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjFfVElNRV9DU1RfTE9XLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBsb3cgdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjFfVElNRV9DU1RfSElHSCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGhpZ2ggdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlkYXRhWzNdID0gZGF0YVszXSA+PiA4OwogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGNvbmZpZ3VyYXRpb24gcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBSZWFkcyB0aGUgcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBFbmFibGVzIHRpbWVyL2NvdW50ZXIgMSBhbmQgdHJpZ2dlcnMgdGltZXIvY291bnRlciAxICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiA9CiAJCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiB8IDB4NDA7CiAKLQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfTWFzdGVyQ29uZmlndXJhdGlvbiwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDEgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIERpc2FibGUgdGltZXIvY291bnRlciAxICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKDB4MCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZHMgcmVnaXN0ZXIgb2YgICAgICovCiAJCQkJLyogdGltZXIvY291bnRlciAxICAgICAgICAgICAgICAgICAgICAgICovCi0JCQkJCSA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0FCTEUpIHsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbW9kZSByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfTU9ERV9TUEVDSUZJQ0FUSU9OLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgbW9kZSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfVGltZXJDb3VudGVyTW9kZSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfVElNRV9DU1RfTE9XLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBsb3cgdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfVElNRV9DU1RfSElHSCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGhpZ2ggdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlkYXRhWzNdID0gZGF0YVszXSA+PiA4OwogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGNvbmZpZ3VyYXRpb24gcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBSZWFkcyB0aGUgcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBFbmFibGVzIHRpbWVyL2NvdW50ZXIgMiBhbmQgdHJpZ2dlcnMgdGltZXIvY291bnRlciAyICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiA9CiAJCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiB8IDB4MjA7CiAKLQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfTWFzdGVyQ29uZmlndXJhdGlvbiwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDIgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIERpc2FibGUgdGltZXIvY291bnRlciAyICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKDB4MCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZHMgcmVnaXN0ZXIgb2YgICAgICovCiAJCQkJLyogdGltZXIvY291bnRlciAyICAgICAgICAgICAgICAgICAgICAgICovCi0JCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKChkYXRhWzNdID49IDApICYmIChkYXRhWzNdIDw9IDY1NTM1KSkgewogCQkJaWYgKGRhdGFbN10gPT0gQVBDSTE1MDBfRU5BQkxFCiAJCQkJfHwgZGF0YVs3XSA9PSBBUENJMTUwMF9ESVNBQkxFKSB7CiAKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgcmVnaXN0ZXIgb2Ygd2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX01PREVfU1BFQ0lGSUNBVElPTiwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgbmV3IG1vZGUgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihpX1RpbWVyQ291bnRlck1vZGUsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29uc3RhbnQgcmVnaXN0ZXIgb2Ygd2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX1RJTUVfQ1NUX0xPVywKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgbG93IHZhbHVlICAqLwotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKGRhdGFbM10sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29uc3RhbnQgcmVnaXN0ZXIgb2Ygd2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX1RJTUVfQ1NUX0hJR0gsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBoaWdoIHZhbHVlICAqLwotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJZGF0YVszXSA9IGRhdGFbM10gPj4gODsKIAkJCQlvdXRiKGRhdGFbM10sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIHJlZ2lzdGVyICovCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogUmVhZHMgdGhlIHJlZ2lzdGVyICovCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiA9CiAJCQkJCWluYihkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogRW5hYmxlcyB3YXRjaGRvZy9jb3VudGVyIDMgYW5kIHRyaWdnZXJzIHdhdGNoZG9nL2NvdW50ZXIgMyAqLwotCQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gPQogCQkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gfCAweDEwOwogCi0JCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGNvbmZpZ3VyYXRpb24gcmVnaXN0ZXIgKi8KLQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgbmV3IGNvbmZpZ3VyYXRpb24gKi8KLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihpX01hc3RlckNvbmZpZ3VyYXRpb24sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFRlc3QgaWYgQ09VTlRFUiAqLwotCQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKi8KIAkJCQlpZiAoZGF0YVsyXSA9PSBBUENJMTUwMF9DT1VOVEVSKSB7CiAKLQkJCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIHJlZ2lzdGVyIG9mICAgKi8KIAkJCQkJLyogd2F0Y2hkb2cvY291bnRlciAzICAgICAgICAgICAgICAgICovCi0JCQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIERpc2FibGUgdGhlICB3YXRjaGRvZy9jb3VudGVyIDMgYW5kIHN0YXJ0cyBpdCAqLwotCQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweDAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgcmVnaXN0ZXIgb2YgICAqLwogCQkJCQkvKiB3YXRjaGRvZy9jb3VudGVyIDMgICAgICAgICAgICAgICAgKi8KLQkJCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBUcmlnZ2VyIHRoZSAgd2F0Y2hkb2cvY291bnRlciAzIGFuZCBzdGFydHMgaXQgKi8KLQkJCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweDIsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0xODU4LDEyICsxNDU4LDE0IEBACiAKIAkJCX0JLyogaWYoZGF0YVs3XT09IEFQQ0kxNTAwX0VOQUJMRSB8fGRhdGFbN109PSBBUENJMTUwMF9ESVNBQkxFKSAqLwogCQkJZWxzZSB7Ci0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bnNuICAgICAgOnBvaW50ZXIgdG8gaW5zbiBzdHJ1Y3R1cmUgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgdG8gcmVhZCBzdGF0dXMgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMF0gICAgICAgICAgICAgICAgOiAwICAgICBDb3VudGVyMS9UaW1lcjEKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIENvdW50ZXIyL1RpbWVyMgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgQ291bnRlcjMvV2F0Y2hkb2cKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgICAgICA6IDAgICAgIHN0YXJ0Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBzdG9wCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBUcmlnZ2VyCi18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMl0gICAgICAgICAgICAgICAgOiAwICAgICBDb3VudGVyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBUaW1lci9XYXRjaGRvZwotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICA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lndXJlZFxuIik7CisJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCSJDb3VudGVyL1RpbWVyMiBub3QgY29uZmlndXJlZFxuIik7CiAJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQl9CiAJCQlicmVhazsKIAogCQljYXNlIFNUT1A6CiAKLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU3RvcCB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTIwNTEsMjMgKzE2MTYsMTcgQEAKIAkJY2FzZSBUUklHR0VSOgogCQkJaWYgKGlfVGltZXJDb3VudGVyMkluaXQgPT0gMSkgewogCQkJCWlmIChpX1RpbWVyQ291bnRlcjJFbmFibGVkID09IDEpIHsKLQkJCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZXQgVHJpZ2dlciBhbmQgZ2F0ZSAqLwotCQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQkJaV9Db21tYW5kQW5kU3RhdHVzVmFsdWUgPSAweDY7CiAJCQkJfQkvKiBpZiggaV9UaW1lckNvdW50ZXIyRW5hYmxlZD09MSkgKi8KIAkJCQllbHNlIHsKLQkJCQkJCSAgIC8qKioqKioqKioqKio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LAorCQkJCQkiV2F0Y2hkb2cvQ291bnRlcjMgbm90IGNvbmZpZ3VyZWRcbiIpOwogCQkJCXJldHVybiAtRUlOVkFMOwogCQkJfQogCQkJYnJlYWs7CiAKIAkJY2FzZSBTVE9QOgogCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFN0b3AgV2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZHMgYW5kIHN0YXR1cyByZWdpc3RlciAqLwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yMTQwLDIzICsxNjk0LDE3IEBACiAJCQljYXNlIDA6CS8qIHRyaWdnZXJpbmcgY291bnRlciAzICovCiAJCQkJaWYgKGlfV2F0Y2hkb2dDb3VudGVyM0luaXQgPT0gMSkgewogCQkJCQlpZiAoaV9XYXRjaGRvZ0NvdW50ZXIzRW5hYmxlZCA9PSAxKSB7Ci0JCQkJCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCQkvKiBTZXQgVHJpZ2dlciBhbmQgZ2F0ZSAqLwotCQkJCQkJCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJCQlpX0NvbW1hbmRBbmRTdGF0dXNWYWx1ZSA9IDB4NjsKIAkJCQkJfQkvKiBpZiggaV9XYXRjaGRvZ0NvdW50ZXIzRW5hYmxlZD09MSkgKi8KIAkJCQkJZWxz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LS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBSZWFkIFRoZSBXYXRjaGRvZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogICBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2ICAgICAgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICAgOiBEYXRhIFBvaW50ZXIgdG8gcmVhZCBzdGF0dXMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIxL1RpbWVyMQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQ291bnRlcjIvVGltZXIyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBDb3VudGVyMy9XYXRjaGRvZwotfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstL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KioqKioqKioqKioqKioqKioqKioqKi8KIAlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweEY5KSB8IEFQQ0kxNTAwX09SOwogCiAJb3V0YihpX1JlZ1ZhbHVlLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBBdXRob3Jpc2VzIHRoZSBpbnRlcnJ1cHQgb24gdGhlIGJvYXJkICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHhDMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHBvbGFyaXR5IHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfUEFUVEVSTl9QT0xBUklUWSwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihpX0NvbnN0YW50LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgcGF0dGVybiB0cmFuc2l0aW9uIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX1RSQU5TSVRJT04sCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoaV9Db25zdGFudCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIHBhdHRlcm4gbWFzayByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfUEFUVEVSTl9NQVNLLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKGlfQ29uc3RhbnQsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEEgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlpX1JlZ1ZhbHVlID0gaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgcG9ydCBBICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCAgQiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPm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GV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgdGltZXIgMSAqLwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJb3V0YihpX1JlZ1ZhbHVlLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDIgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlpX1JlZ1ZhbHVlID0gaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgdGltZXIgMiAqLwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJb3V0YihpX1JlZ1ZhbHVlLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAzICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIHZvaWQgdl9BUENJMTUwMF9JbnRlcnJ1cHQoaW50IGlycSwgdm9pZCAqZCkKK3N0YXRpYyB2b2lkIGFwY2kxNTAwX2ludGVycnVwdChpbnQgaXJxLCB2b2lkICpkKQogewogCiAJc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA9IGQ7CkBAIC0yNjQyLDQ0ICsyMDYzLDI4IEBACiAJaW50IGlfUmVnVmFsdWUgPSAwOwogCWlfSW50ZXJydXB0TWFzayA9IDA7CiAKLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogUmVhZCB0aGUgYm9hcmQgaW50ZXJydXB0IHN0YXR1cyAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAl1aV9JbnRlcnJ1cHRTdGF0dXMgPSBpbmwoZGV2cHJpdi0+aV9Jb2Jhc2VBbWNjICsgMHgzOCk7CiAKLSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBUZXN0IGlmIGJvYXJkIGdlbmVyYXRlZCBhIGludGVycnVwdCAqLwotICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCWlmICgodWlfSW50ZXJydXB0U3RhdHVzICYgMHg4MDAwMDApID09IDB4ODAwMDAwKSB7Ci0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBEaXNhYmxlIGFsbCBJbnRlcnJ1cHQgKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsZGV2cHJpdi0+aW9iYXNlK0FQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOyAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBEaXNhYmxlcyAgdGhlIG1haW4gaW50ZXJydXB0IG9uIHRoZSBib2FyZCAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBvdXRiKDB4MDAsZGV2cHJpdi0+aW9iYXNlK0FQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOyAqLwogCi0gICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEEgKi8KLSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlfUmVnVmFsdWUgPQogCQkJaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSB7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgcG9ydCBBICovCi0JICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAkJCW91dGIoaV9SZWdWYWx1ZSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwpAQCAtMjY5Myw5ICsyMDk4LDcgQEAKIAkJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBpbnRlcnJ1cHQgdmVjdG9yIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfSU5URVJSVVBUX0NPTlRST0wsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjcxMSw0NSArMjExNCwzMiBAQAogCQkJfQkvKiBlbHNlaWYoaV9Mb2dpYz09QVBDSTE1MDBfT1JfUFJJT1JJVFkpICovCiAJCX0JCS8qICBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwogCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHBvcnQgQiAqLwotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCQkJb3V0YihpX1JlZ1ZhbHVlLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQlwcmludGsoIlxuXG5cbiIpOwotCSAgICAgLyoqKioqKioqKioqKioqKiovCiAJCQkvKiBSZWFkcyBwb3J0IEIgKi8KLQkgICAgIC8qKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9CiAJCQkJaW5iKCh1bnNpZ25lZCBpbnQpIGRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfUE9SVF9CKTsKIAogCQkJaV9SZWdWYWx1ZSA9IGlfUmVnVmFsdWUgJiAweEMwOwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFRlc3RzIGlmIHRoaXMgaXMgYW4gZXh0ZXJuYWwgZXJyb3IgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCWlmIChpX1JlZ1ZhbHVlKSB7CiAJCQkJLyogRGlzYWJsZSB0aGUgaW50ZXJydXB0ICovCi0JCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0bCgweDAsIGRldnByaXYtPmlfSW9iYXNlQW1jYyArIDB4MzgpOwogCiAJCQkJaWYgKGlfUmVnVmFsdWUgJiAweDgwKSB7CkBAIC0yNzY3LDQ2ICsyMTU3LDM0IEBACiAJCQl9CS8qICBpZiAoaV9SZWdWYWx1ZSkgKi8KIAkJfQkJLyogaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgKi8KIAotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAxICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlfUmVnVmFsdWUgPQogCQkJaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSB7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAxICovCi0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjFfQ01EX1NUQVRVUywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgdGltZXIgMSAqLwotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJCQlvdXRiKGlfUmVnVmFsdWUsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCWlfSW50ZXJydXB0TWFzayA9IGlfSW50ZXJydXB0TWFzayB8IDQ7CiAJCX0JCS8qICBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAyICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlfUmVnVmFsdWUgPQogCQkJaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSB7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YX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QVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDMgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAzICovCi0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAkJCW91dGIoaV9SZWdWYWx1ZSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwpAQCAtMjg0NCw0MiArMjIxNiwyMyBAQAogCQl9CQkvKiAgaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgKi8KIAogCQlzZW5kX3NpZyhTSUdJTywgZGV2cHJpdi0+dHNrX0N1cnJlbnQsIDApOwkvKiAgc2VuZCBzaWduYWwgdG8gdGhlIHNhbXBsZSAqLwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIEVuYWJsZSBhbGwgSW50ZXJydXB0cyAqLwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCiAKLQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIEF1dGhvcml6ZXMgdGhlIG1haW4gaW50ZXJydXB0IG9uIHRoZSBib2FyZCAqLwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJb3V0YigweEQwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAl9CQkJLyogICBpZiAoKHVpX0ludGVycnVwdFN0YXR1cyAmIDB4ODAwMDAwKSA9PSAweDgwMDAwMCkgKi8KIAllbHNlIHsKLQkJcHJpbnRrKCJcbkludGVycnVwdCBmcm9tIHVua25vd24gc291cmNlXG4iKTsKKwkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkiSW50ZXJydXB0IGZyb20gdW5rbm93biBzb3VyY2VcbiIpOwogCiAJfQkJCS8qIGVsc2UgaWYgKCh1aV9JbnRlcnJ1cHRTdGF0dXMgJiAweDgwMDAwMCkgPT0gMHg4MDAwMDApICovCiAJcmV0dXJuOwogfQogCi0vKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW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c3RlciAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoMHhGNCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9TUEVDSUZJQ0FUSU9OLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKDB4MTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjk0OSw5ICsyMjk2LDcgQEAKIAkvKiBEZWxldGVzIHRoZSByZWdpc3RlciAqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoMHgxMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yOTgxLDkgKzIzMjYsNyBAQAogCS8qIERlbGV0ZXMgdGhlIHJlZ2lzdGVyICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBkYXRhIHBhdGggcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCBDICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9DX0RBVEFfUENJVENIX1BPTEFSSVRZLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiBIaWdoIGxldmVsIG9mIHBvcnQgQyBtZWFucyAxICovCkBAIC0yOTk4LDkgKzIzNDEsNyBAQAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiBEZWxldGVzIGl0ICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGN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50ZXJydXB0IG1hbmFnZW1lbnQ6ICAgICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgSVAgYW5kIElVUyAqLwpAQCAtMzAzNCw3MSArMjM3MSw0MyBAQAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiBEZWFjdGl2YXRlcyBpbnRlcnJ1cHQgbWFuYWdlbWVudCBvZiB0aW1lciAzOiAgICAgICAgICAgICovCiAJb3V0YigweEUwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiBEZWxldGVzIGFsbCBpbnRlcnJ1cHRzICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiByZXNldCBhbGwgdGhlIGRpZ2l0YWwgb3V0cHV0cyAqLwogCW91dHcoMHgwLCBkZXZwcml2LT5pX0lvYmFzZUFkZG9uICsgQVBDSTE1MDBfRElHSVRBTF9PUCk7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERpc2FibGUgdGhlIGJvYXJkIGludGVycnVwdCAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBEZWFjdGl2YXRlcyBhbGwgaW50ZXJydXB0cyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBEZWFjdGl2YXRlcyBhbGwgaW50ZXJydXB0cyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDB4MDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAxICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjFfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGVhY3RpdmF0ZXMgYWxsIGludGVycnVwdHMgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweDAwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzKi8KLS8qK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gICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tKy0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgIERhdGUgICB8ICAgQXV0aG9yICB8ICAgICAgICAgIERlc2NyaXB0aW9uIG9mIHVwZGF0ZXMgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tKy0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi0KLS8qKioqKioqKiogICAgICBEZWZpbml0aW9ucyBmb3IgQVBDSS0xNTY0IGNhcmQgICoqKioqLworICogQ29weXJpZ2h0IChDKSAyMDA0LDIwMDUgIEFEREktREFUQSBHbWJIIGZvciB0aGUgc291cmNlIGNvZGUgb2YgdGhpcyBtb2R1bGUuCisgKgorICoJQURESS1EQVRBIEdtYkgKKyAqCURpZXNlbHN0cmFzc2UgMworICoJRC03NzgzMyBPdHRlcnN3ZWllcgorICoJVGVsOiArMTkoMCk3MjIzLzk0OTMtMAorICoJRmF4OiArNDkoMCk3MjIzLzk0OTMtOTIKKyAqCWh0dHA6Ly93d3cuYWRkaS1kYXRhLmNvbQorICoJaW5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ogc3RhdGljIHVuc2lnbmVkIGludCB1aV9JbnRlcnJ1cHREYXRhLCB1aV9UeXBlOwogCiAvKgotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uICAgTmFtZSAgIDogaW50IGlfQVBDSTE1NjRfQ29uZmlnRGlnaXRhbElucHV0ICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkgIChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmVzIHRoZSBkaWdpdGFsIGlucHV0IFN1YmRldmljZSAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJ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LSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzFdICAgICAgICAgICAgOiAxIEVuYWJsZSAgVkNDICBJbnRlcnJ1cHQgIHwKLXwJCQkJCQkJCQkJICAgMCBEaXNhYmxlIFZDQyAgSW50ZXJydXB0ICB8Ci18CQkJCQkgIGRhdGFbMl0gICAgICAgICAgICA6IDEgRW5hYmxlICBDQyAgSW50ZXJydXB0ICAgfAotfAkJCQkJCQkJCQkgICAwIERpc2FibGUgQ0MgIEludGVycnVwdCAgIHwKLXwJCQkJCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJC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QgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCSAgZGF0YVswXSAgICAgICAgICAgIDogMCBDb25maWd1cmUgQXMgVGltZXIgICAgICB8Ci18CQkJCQkJCQkJCSAgIDEgQ29uZmlndXJlIEFzIENvdW50ZXIgICAgfAotfAkJCQkJCQkJCQkgICAyIENvbmZpZ3VyZSBBcyBXYXRjaGRvZyAgIHwKLXwJCQkJCSAgZGF0YVsxXSAgICAgICAgICAgIDogMSBFbmFibGUgIEludGVycnVwdCAgICAgICB8Ci18CQkJCQkJCQkJCSAgIDAgRGlzYWJsZSBJbnRlcnJ1cHQgCSAgICAgfAotfAkJCQkJICBkYXRhWzJdICAgICAgICAgICAgOiBUaW1lIFVuaXQgICAgICAgICAgICAgICAgIHwKLXwJCQkJCSAgZGF0YVszXQkJCSA6IFJlbG9hZCBWYWx1ZQkJCSAgICAgfAotfAkJCQkJICBkYXRhWzRdICAgICAgICAgICAgOiBUaW1lciBNb2RlICAgICAgICAgICAgIAkgfAotfAkJCQkJICBkYXRhWzVdCQkJIDogVGltZXIgQ291bnRlciBXYXRjaGRvZyBOdW1iZXJ8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzZdICAgICAgICAgICAgOiAgQ291bnRlciBEaXJlY3Rpb24KLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6CS0tCQkJCQkJCQ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fc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBTdGFydCAvIFN0b3AgVGhlIFNlbGVjdGVkIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgOiBEYXRhIFBvaW50ZXIgY29udGFpbnMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYXRpb24gcGFyYW1ldGVycyBhcyBiZWxvdyB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCSAgZGF0YVswXSAgICAgICAgICAgIDogMCBUaW1lciAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJCQkJCSAgIDEgQ291bnRlciAgICAgICAgICAgICAgICAgfAotfAkJCQkJCQkJCQkgICAyIFdhdGNoZG9nICAgICAgICAJCSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CQkJCQkgICAgICAgICBkYXRhWzFdICAgICAgICAgICAgOiAxIFN0YXJ0ICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCQkJCQkJICAgMCBTdG9wICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyIFRyaWdnZXIgICAgICAgICAgICAgCSB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsZWFyIChPbmx5IENvdW50ZXIpICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6CS0tCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiBUUlVFICA6IE5vIGVycm9yIG9jY3VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJICAgICAgICAgICAgOiBGQUxTRSA6IEVycm9yIG9jY3VyLiBSZXR1cm4gdGhlIGVycm9yICAgICAgICAgIHwKLXwJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTE1NjRfU3RhcnRTdG9wV3JpdGVUaW1lckNvdW50ZXJXYXRjaGRvZyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkJCSBzdH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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJZGF0YVsxXSA9ICh1bnNpZ25lZCBjaGFyKSAoKHVsX0NvbW1hbmQxID4+IDEpICYgMSk7CiAKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogR2V0IHRoZSBoYXJkd2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlkYXRhWzJdID0gKHVuc2lnbmVkIGNoYXIpICgodWxfQ29tbWFuZDEgPj4gMikgJiAxKTsKIAotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogR2V0IHRoZSBzb2Z0d2FyZSBjbGVhciBzdGF0dXMgKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCWRhdGFbM10gPSAodW5zaWduZWQgY2hhcikgKCh1bF9Db21tYW5kMSA+PiAzKSAmIDEpOwogCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBHZXQgdGhlIG92ZXJmbG93IHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJZGF0YVs0XSA9ICh1bnNpZ25lZCBjaGFyKSAoKHVsX0NvbW1hbmQxID4+IDApICYgMSk7Ci0JfQkJCS8qICBlbHNlICBpZiAgKGRldnByaXYtPmJfVGltZXJTZWxlY3RNb2RlPT1BRERJREFUQV9DT1VOVEVSKSAqLwotCWVsc2UgaWYgKChkZXZwcml2LT5iX1RpbWVyU2VsZWN0TW9kZSAhPSBBRERJREFUQV9USU1FUikKKwl9IGVsc2UgaWYgKChkZXZwcml2LT5iX1RpbWVyU2VsZWN0TW9kZSAhPSBBRERJREFUQV9USU1FUikKIAkJJiYgKGRldnByaXYtPmJfVGltZXJTZWxlY3RNb2RlICE9IEFERElEQVRBX1dBVENIRE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ZWxlY3RlZCBieSBqdW1wZXJpbmcgcGlucyBvbiB0aGUgSS9PIGNvbm5lY3Rvci4KKyAqCisgKgkgICAgUmFuZ2UgICAgICBDaGFuICMgICBKdW1wZXIgcGlucyAgICAgICAgT3V0cHV0CisgKgktLS0tLS0tLS0tLS0tICAtLS0tLS0gIC0tLS0tLS0tLS0tLS0gIC0tLS0tLS0tLS0tLS0tLS0tCisgKgkgICAwIHRvIDVWICAgICAgIDAgICAgICAgIDIxIHRvIDIyICAgICAgMjQKKyAqCSAgICAgICAgICAgICAgICAgMSAgICAgICAgMTUgdG8gMTYgICAgICAxOAorICoJICAgMCB0byAxMFYgICAgICAwICAgICAgICAyMCB0byAyMiAgICAgIDI0CisgKgkgICAgICAgICAgICAgICAgIDEgICAgICAgIDE0IHRvIDE2ICAgICAgMTgKKyAqCSAgICArLy01ViAgICAgICAgMCAgICAgICAgMjEgdG8gMjIgICAgICAyMworICoJICAgICAgICAgICAgICAgICAxICAgICAgICAxNSB0byAxNiAgICAgIDE3CisgKgkgICAgKy8tMTBWICAgICAgIDAgICAgICAgIDIwIHRvIDIyICAgICAgMjMKKyAqCSAgICAgICAgICAgICAgICAgMSAgICAgICAgMTQgdG8gMTYgICAgICAxNworICoJICA0IHRvIDIwbUEgICAgICAwICAgICAgICAyMSB0byAyMiAgICAgIDI1CisgKgkgICAgICAgICAgICAgICAgIDEgICAgICAgIDE1IHRvIDE2ICAgICAgMTkKKyAqCUFDIHJlZmVyZW5jZSAgICAgMCAgICAgIEluIG9uIHBpbiAyMiAgICAyNCAoMi1xdWFkcmFudCkKKyAqCSAgICAgICAgICAgICAgICAgICAgICAgIEluIG9uIHBpbiAyMiAgICAyMyAoNC1xdWFkcmFudCkKKyAqCSAgICAgICAgICAgICAgICAgMSAgICAgIEluIG9uIHBpbiAxNiAgICAxOCAoMi1xdWFkcmFudCkKKyAqCSAgICAgICAgICAgICAgICAgICAgICAgIEluIG9uIHBpbiAxNiAgICAxNyAoNC1xdWFkcmFudCkK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CBmMjI0ODI1Li5lNTU5M2Y4IDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvZHluYV9wY2kxMHh4LmMKKysrIGIvZHJpdmVycy9zdGFnaW5nL2NvbWVkaS9kcml2ZXJzL2R5bmFfcGNpMTB4eC5jCkBAIC01NywxOCArNTcsMjcgQEAKIAl1bnNpZ25lZCBsb25nIEJBRFIzOwogfTsKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKiBSRUFEIFdSSVRFIEZVTkNUSU9OUyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBkeW5hX3BjaTEweHhfYWlfZW9jKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCisJCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCisJCQkgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgIHVuc2lnbmVkIGxvbmcgY29udGV4dCkKK3sKKwl1bnNpZ25lZCBpbnQgc3RhdHVzOwogCi0vKiBhbmFsb2cgaW5wdXQgY2FsbGJhY2sgKi8KKwlzdGF0dXMgPSBpbndfcChkZXYtPmlvYmFzZSk7CisJaWYgKHN0YXR1cyAmICgxIDw8IDE1KSkKKwkJcmV0dXJuIDA7CisJcmV0dXJuIC1FQlVTWTsKK30KKwogc3RhdGljIGludCBkeW5hX3BjaTEweHhfaW5zbl9yZWFkX2FpKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCiAJCQlzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywKIAkJCXN0cnVjdCBjb21lZGlf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MgPSBkZXYtPnJlYWRfc3ViZGV2OwogCXN0cnVjdCBwY2w4MTJfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKIAogCWlmICghZGV2LT5hdHRhY2hlZCkgewotCQljb21lZGlfZXJyb3IoZGV2LCAic3B1cmlvdXMgaW50ZXJydXB0Iik7CisJCXBjbDgxMl9haV9jbGVhcl9lb2MoZGV2KTsKIAkJcmV0dXJuIElSUV9IQU5ETEVEOwogCX0KKwogCWlmIChkZXZwcml2LT5haV9kbWEpCi0JCXJldHVybiBpbnRlcnJ1cHRfcGNsODEyX2FpX2RtYShpcnEsIGQpOworCQlwY2w4MTJfaGFuZGxlX2RtYShkZXYsIHMpOwogCWVsc2UKLQkJcmV0dXJuIGludGVycnVwdF9wY2w4MTJfYWlfaW50KGlycSwgZCk7CisJCXBjbDgxMl9oYW5kbGVfZW9jKGRldiwgcyk7CisKKwlwY2w4MTJfYWlfY2xlYXJfZW9jKGRldik7CisKKwljZmNfaGFuZGxlX2V2ZW50cyhkZXYsIHMpOworCXJldHVybiBJUlFfSEFORExFRDsKIH0KIAotLyoKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotKi8KIHN0YXRpYyBpbnQgcGNsODEyX2FpX3BvbGwoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMpCiB7CiAJc3RydWN0IHBjbDgxMl9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwpAQCAtOTc5LDcyICs5OTQsNiBAQAogCXJldHVybiBzLT5hc3luYy0+YnVmX3dyaXRlX2NvdW50IC0gcy0+YXN5bmMtPmJ1Zl9yZWFkX2NvdW50OwogfQogCi0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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X2NoYW5saXN0W2ldID0gQ1JfQ0hBTihjaGFubGlzdFtpXSk7Ci0JCW91dGIobXV4b25lY2hhbltDUl9DSEFOKGNoYW5saXN0W2ldKV0sIGRldi0+aW9iYXNlICsgUENMODE4X01VWCk7CS8qIHNlbGVjdCBjaGFubmVsICovCi0JCW91dGIoQ1JfUkFOR0UoY2hhbmxpc3RbaV0pLCBkZXYtPmlvYmFzZSArIFBDTDgxOF9SQU5HRSk7CS8qIHNlbGVjdCBnYWluICovCi0JfQotCi0JdWRlbGF5KDEpOwotCi0JLyogc2VsZWN0IGNoYW5uZWwgaW50ZXJ2YWwgdG8gc2NhbiAqLwotCW91dGIoZGV2cHJpdi0+YWN0X2NoYW5saXN0WzBdIHwgKGRldnByaXYtPmFjdF9jaGFubGlzdFtzZWdsZW4gLQotCQkJCQkJCSAgICAgICAxXSA8PCA0KSwKLQkgICAgIGRldi0+aW9iYXNlICsgUENMODE4X01VWCk7Ci19Ci0KLS8qCi09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSBDaGVjayBpZiBib2FyZCBpcyBzd2l0Y2hlZCB0byBTRSAoMSkgb3IgRElGRigwKSBtb2RlCi0qLwogc3RhdGljIGludCBjaGVja19zaW5nbGVfZW5kZWQodW5zaWduZWQgaW50IHBvcnQpCiB7Ci0JaWYgKGluYihwb3J0ICsgUENMODE4X1NUQVRVUykgJiAweDIwKQorCWlmIChpbmIocG9ydCArIFBDTDgxOF9TVEFUVVNfUkVHKSAmIFBDTDgxOF9TVEFUVVNfTVVYKQogCQlyZXR1cm4gMTsKIAlyZXR1cm4gMDsKIH0KIAotLyoKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotKi8KIHN0YXRpYyBpbnQgYWlfY21kdGVzdChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZG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IgKHVfaW50MzJfdCAqcCwgdV9pbnQzMl90IHYpCitwY2lfd3JpdGVfMzIodV9pbnQzMl90ICpwLCB1X2ludDMyX3QgdikKIHsKICNpZmRlZiBGTE9XX0RFQlVHCi0gICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX0RFQlVHKQotICAgICAgICBwcl9pbmZvKCJwY2lfd3JpdGU6ICV4ID0gJXhcbiIsICh1X2ludDMyX3QpIHAsIHYpOworCWlmIChjeHQxZTFfbG9nX2xldmVsID49IExPR19ERUJVRykKKwkJcHJfaW5mbygicGNpX3dyaXRlOiAleCA9ICV4XG4iLCAodV9pbnQzMl90KSBwLCB2KTsKICNlbmRpZgotICAgICpwID0gY3B1X3RvX2xlMzIgKHYpOwotICAgIEZMVVNIX1BDSV9XUklURSAoKTsgICAgICAgICAgICAgLyogVGhpcyByb3V0aW5lIGlzIGNhbGxlZCBmcm9tIHJvdXRpbmVzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB3aGljaCBkbyBtdWx0aXBsZSByZWdpc3RlciB3cml0ZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdoaWNoIHRoZW1zZWx2ZXMgbmVlZCBmbHVzaGluZyBiZXR3ZWVuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB3cml0ZXMgaW4gb3JkZXIgdG8gZ3VhcmFudGVlIHdyaXRlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBvcmRlcmluZy4gIEl0IGlzIGxlc3MgY29kZS1jdW1iZXJzb21lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0byBmbHVzaCBoZXJlLWluIHRoZW4gdG8gaW52ZXN0aWdhdGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFuZCBjb2RlIHRoZSBtYW55IG90aGVyIHJlZ2lzdGVyCi0gICAgICAgICAg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ICAgICAgbWRlbGF5ICh1c2VjIC8gMTAwMCk7Ci0gICAgICAgIC8qIG5vdyBkZWxheSByZXNpZHVhbCAqLwotICAgICAgICB0bXAgPSAodXNlYyAvIDEwMDApICogMTAwMDsgLyogcm91bmQgKi8KLSAgICAgICAgdG1wID0gdXNlYyAtIHRtcDsgICAgICAgICAgIC8qIHJlc2lkdWFsICovCi0gICAgICAgIGlmICh0bXApCi0gICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB3YWl0IG9uIHJlc2lkdWFsICovCi0gICAgICAgICAgICB1ZGVsYXkgKHRtcCk7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UKLSAgICB7Ci0gICAgICAgIHVkZWxheSAodXNlYyk7Ci0gICAgfQorCWlmICh1c2VjID49IDEwMDApIHsKKwkJbWRlbGF5KHVzZWMgLyAxMDAwKTsKKwkJLyogbm93IGRlbGF5IHJlc2lkdWFsICovCisJCXRtcCA9ICh1c2VjIC8gMTAwMCkgKiAxMDAwOyAvKiByb3VuZCAqLworCQl0bXAgPSB1c2VjIC0gdG1wOyAgICAgICAgICAgLyogcmVzaWR1YWwgKi8KKwkJaWYgKHRtcCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdhaXQgb24gcmVzaWR1YWwgKi8KKwkJCXVkZWxheSh0bXApOworCQl9CisJfSBlbHNlIHsKKwkJdWRlbGF5KHVzZWMpOworCX0KIH0KIAogLyogZHVtbXkgc2hvcnQgZGVsYXkgcm91dGluZSBjYWxsZWQgYXMgYSBzdWJyb3V0aW5lIHNvIHRoYXQgY29tcGlsZXIKQEAgLTE2MSw5NiArMTU5LDk1IEBACiAgKi8KIAogdm9pZAotT1NfdXdhaXRfZHVtbXkgKHZvaWQpCitPU191d2FpdF9kdW1teSh2b2lkKQogewogI2lmbmRlZiBVU0VfTUFYX0lOVF9ERUxBWQotICAgIGR1bW15Kys7CisJZHVtbXkrKzsKICNlbHNlCi0gICAgdWRlbGF5ICgxKTsKKwl1ZGVsYXkoMSk7CiAjZW5kaWYKIH0KIAogCiB2b2lkCi1PU19zZW1faW5pdCAodm9pZCAqc2VtLCBpbnQgc3RhdGUpCitPU19zZW1faW5pdCh2b2lkICpzZW0sIGludCBzdGF0ZSkKIHsKLSAgICBzd2l0Y2ggKHN0YXRlKQotICAgIHsKLSAgICAgICAgY2FzZSBTRU1fVEFLRU46Ci0JCXNlbWFfaW5pdCgoc3RydWN0IHNlbWFwaG9yZSAqKSBzZW0sIDApOwotICAgICAgICBicmVhazsKLSAgICBjYXNlIFNFTV9BVkFJTEFCTEU6CisJc3dpdGNoIChzdGF0ZSkgeworCWNhc2UgU0VNX1RBS0VOOgorCSAgICBzZW1hX2luaXQoKHN0cnVjdCBzZW1hcGhvcmUgKikgc2VtLCAwKTsKKwkgICAgYnJlYWs7CisJY2FzZSBTRU1fQVZBSUxBQkxFOgogCSAgICBzZW1hX2luaXQoKHN0cnVjdCBzZW1hcGhvcmUgKikgc2VtLCAxKTsKLSAgICAgICAgYnJlYWs7Ci0gICAgZGVmYXVsdDogICAgICAgICAgICAgICAgICAgICAgICAvKiBvdGhlcndpc2UsIHNldCBzZW0uY291bnQgdG8gc3RhdGUncwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdmFsdWUgKi8KLSAgICAgICAgc2VtYV9pbml0IChzZW0sIHN0YXRlKTsKLSAgICAgICAgYnJlYWs7Ci0gICAgfQorCSAgICBicmVhazsKKwlkZWZhdWx0OiAgICAgICAgICAgICAgICAgICAgICAgIC8qIG90aGVyd2lzZSwgc2V0IHNlbS5jb3VudCB0byBzdGF0ZSdzCisJCQkJCSogdmFsdWUgKi8KKwkgICAgc2VtYV9pbml0KHNlbSwgc3RhdGUpOworCSAgICBicmVhazsKKwl9CiB9CiAKIAogaW50Ci1zZF9saW5lX2lzX29rICh2b2lkICp1c2VyKQorc2RfbGluZV9pc19vayh2b2lkICp1c2VyKQogewotICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2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RfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3JlczhCKTsgICAgIC8qIDB4MjJDICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgODoKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBMCk7ICAgICAvKiAweDI4MCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDk6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzQTEpOyAgICAgLyogMHgyODQgKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSAxMDoKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBMik7ICAgICAvKiAweDI4OCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDExOgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0EzKTsgICAgIC8qIDB4MjhDICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgMTI6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzQTQpOyAgICAgLyogMHgyOTAgKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSAxMzoKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBNSk7ICAgICAvKiAweDI5NCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDE0OgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0E2KTsgICAgIC8qIDB4Mjk4ICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgMTU6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzQTcpOyAgICAgLyogMHgyOUMgKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSAxNjoKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXM3NCk7ICAgICAvKiAweDFEMCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDE3OgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlczc1KTsgICAgIC8qIDB4MUQ0ICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgMTg6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzNzYpOyAgICAgLyogMHgxRDggKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSAxOToKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXM3Nyk7ICAgICAvKiAweDFEQyAqLwotICAgICAgICBicmVhazsKLSAgICB9CisJc3dpdGNoICh4KSB7CisJZGVmYXVsdDoKKwljYXNlIDA6CisJICAgIGRhdGEgPSBwY2lfcmVhZF8zMigodV9pbnQzMl90ICopICZjb21ldC0+X19yZXMyNCk7ICAgICAvKiAweDkwICovCisJICAgIGJyZWFrOworCWNhc2UgMToKKwkgICAgZGF0YSA9IHBjaV9yZWFkXzMyKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3JlczI1KTsgICAgIC8qIDB4OTQgKi8KKwkgICAgYnJlYWs7CisJY2FzZSAyOgorCSAgICBkYXRhID0gcGNpX3JlYWRfMzIoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjYpOyAgICAgLyogMHg5OCAqLworCSAgICBicmVhazsKKwljYXNlIDM6CisJICAgIGRhdGEgPSBwY2l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oImVlcHJvbVswMF06ICAlMDJ4ICUwMnggJTAyeCAlMDJ4ICAlMDJ4ICUwMnggJTAyeCAlMDJ4XG4iLAotICAgICAgICAgICAgICAgICoodWNwICsgMCksICoodWNwICsgMSksICoodWNwICsgMiksICoodWNwICsgMyksICoodWNwICsgNCksICoodWNwICsgNSksICoodWNwICsgNiksICoodWNwICsgNykpOwotICAgICAgICBwcl9pbmZvKCJlZXByb21bMDhdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKLSAgICAgICAgICAgICAgICAqKHVjcCArIDgpLCAqKHVjcCArIDkpLCAqKHVjcCArIDEwKSwgKih1Y3AgKyAxMSksICoodWNwICsgMTIpLCAqKHVjcCArIDEzKSwgKih1Y3AgKyAxNCksICoodWNwICsgMTUpKTsKLSAgICAgICAgcHJfaW5mbygiZWVwcm9tWzE2XTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCi0gICAgICAgICAgICAgICAgKih1Y3AgKyAxNiksICoodWNwICsgMTcpLCAqKHVjcCArIDE4KSwgKih1Y3AgKyAxOSksICoodWNwICsgMjApLCAqKHVjcCArIDIxKSwgKih1Y3AgKyAyMiksICoodWNwICsgMjMpKTsKLSAgICAgICAgcHJfaW5mbygiZWVwcm9tWzI0XTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCi0gICAgICAgICAgICAgICAgKih1Y3AgKyAyNCksICoodWNwICsgMjUpLCAqKHVjcCArIDI2KSwgKih1Y3AgKyAyNyksICoodWNwICsgMjgpLCAqKHVjcCArIDI5KSwgKih1Y3AgKyAzMCksICoodWNwICsgMzEpKTsKLSAgICAgICAgcHJfaW5mbygiZWVwcm9tWzMyXTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCi0gICAgICAgICAgICAgICAgKih1Y3AgKyAzMiksICoodWNwICsgMzMpLCAqKHVjcCArIDM0KSwgKih1Y3AgKyAzNSksICoodWNwICsgMzYpLCAqKHVjcCArIDM3KSwgKih1Y3AgKyAzOCksICoodWNwICsgMzkpKTsKLSAgICAgICAgcHJfaW5mbygiZWVwcm9tWzQwXTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCi0gICAgICAgICAgICAgICAgKih1Y3AgKyA0MCksICoodWNwICsgNDEpLCAqKHVjcCArIDQyKSwgKih1Y3AgKyA0MyksICoodWNwICsgNDQpLCAqKHVjcCArIDQ1KSwgKih1Y3AgKyA0NiksICoodWNwICsgNDcpKTsKLSAgICB9CisJCXByX2luZm8oImVlcHJvbVswMF06ICAlMDJ4ICUwMnggJTAyeCAlMDJ4ICAlMDJ4ICUwMnggJTAyeCAlMDJ4XG4iLAorCQkJKih1Y3AgKyAwKSwgKih1Y3AgKyAxKSwgKih1Y3AgKyAyKSwgKih1Y3AgKyAzKSwKKwkJCSoodWNwICsgNCksICoodWNwICsgNSksICoodWNwICsgNiksICoodWNwICsgNykpOworCQlwcl9pbmZvKCJlZXByb21bMDhdOiAgJTAyeCAlMDJ4ICUwMnggJTAyeCAgJTAyeCAlMDJ4ICUwMnggJTAyeFxuIiwKKwkJCSoodWNwICsgOCksICoodWNwICsgOSksICoodWNwICsgMTApLCAqKHVjcCArIDExKSwKKwkJCSoodWNwICsgMTIpLCAqKHVjcCArIDEzKSwgKih1Y3AgKyAxNCksICoodWNwICsgMTUpKTsKKwkJcHJfaW5mbygiZWVwcm9tWzE2XTogICUwMnggJTAyeCAlMDJ4ICUwMnggICUwMnggJTAyeCAlMDJ4ICUwMnhcbiIsCisJCQkqKHVjcCArIDE2KSwgKih1Y3AgKyAxNyksICoodWNwICsgMTgpLCAqKHVjcCArIDE5KSwKKwkJCSoodWNwICsgMjApLCAqKHVjcCArIDIxKSwgKih1Y3AgKyAyMiksICoodWNwICsgMjMpKTsKKw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hcCh2b2lkKQogewotICAgIGhkd19pbmZvX3QgKmhpOwotICAgIGludCAgICAgICAgIGk7CisJaGR3X2luZm9fdCAqaGk7CisJaW50ICAgICAgICAgaTsKIAotICAgIGZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCi0gICAgewotICAgICAgICBpZiAoaGktPnBjaV9zbG90ID09IDB4ZmYpCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgaWYgKGhpLT5hZGRyX21hcHBlZFswXSkKLSAgICAgICAgewotICAgICAgICAgICAgaW91bm1hcCAoKHZvaWQgKikgKGhpLT5hZGRyX21hcHBlZFswXSkpOwotICAgICAgICAgICAgcmVsZWFzZV9tZW1fcmVnaW9uICgobG9uZykgaGktPmFkZHJbMF0sIGhpLT5sZW5bMF0pOwotICAgICAgICAgICAgaGktPmFkZHJfbWFwcGVkWzBdID0gMDsKLSAgICAgICAgfQotICAgICAgICBpZiAoaGktPmFkZHJfbWFwcGVkWzFdKQotICAgICAgICB7Ci0gICAgICAgICAgICBpb3VubWFwICgodm9pZCAqKSAoaGktPmFkZHJfbWFwcGVkWzFdKSk7Ci0gICAgICAgICAgICByZWxlYXNlX21lbV9yZWdpb24gKChsb25nKSBoaS0+YWRkclsxXSwgaGktPmxlblsxXSk7Ci0gICAgICAgICAgICBoaS0+YWRkcl9tYXBwZWRbMV0gPSAwOwotICAgICAgICB9Ci0gICAgfQorCWZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspIHsKKwkJaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmKQorCQkJYnJlYWs7CisJCWlmIChoaS0+YWRkcl9tYXBwZWRbMF0pIHsKKwkJCWlvdW5tYXAoKHZvaWQgKikoaGktPmFkZHJfbWFwcGVkWzBdKSk7CisJCQlyZWxlYXNlX21lbV9yZWdpb24oKGxvbmcpIGhpLT5hZGRyWzBdLCBoaS0+bG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oZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIG1hdGNoIHdpdGggYm9hcmQncyBmaXJzdCBmb3VuZCBpbnRlcmZhY2UsIG90aGVyd2lzZSB0aGlzIGlzIGZpcnN0Ci0gICAgICAgICAqIGZvdW5kCi0gICAgICAgICAqLwotICAgICAgICBpZiAoKGhpLT5wY2lfc2xvdCA9PSAweGZmKSB8fCAgIC8qIG5ldyBib2FyZCAqLwotICAgICAgICAgICAgKChoaS0+cGNpX3Nsb3QgPT0gc2xvdCkgJiYgKGhpLT5idXMgPT0gcGRldi0+YnVzKSkpCi0gICAgICAgICAgICBicmVhazsgICAgICAgICAgICAgICAgICAvKiBmb3VuZCBmb3ItbG9vcCBleGl0ICovCi0gICAgfQotICAgIGlmIChpID09IE1BWF9CT0FSRFMpICAgICAgICAgICAgLyogbm8gbWF0Y2ggaW4gYWJvdmUgbG9vcCBtZWFucyBNQVgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGV4Y2VlZGVkICovCi0gICAgewotICAgICAgICBwcl93YXJuaW5nKCJleGNlZWRlZCBudW1iZXIgb2YgYWxsb3dlZCBkZXZpY2VzICg+JWQpP1xuIiwgTUFYX0JPQVJEUyk7Ci0gICAgICAgIHJldHVybiAwOwotICAgIH0KLSAgICBpZiAocGRldi0+YnVzKQotICAgICAgICBoaS0+cGNpX2J1c25vID0gcGRldi0+YnVzLT5udW1iZXI7Ci0gICAgZWxzZQotICAgICAgICBoaS0+cGNpX2J1c25vID0gMDsgICAgICAgICAgLyogZGVmYXVsdCBmb3Igc3lzdGVtIFBDSSBpbmNvbnNpc3RlbmN5ICovCi0gICAgaGktPnBjaV9zbG90ID0gc2xvdDsKLSAgICBwY2lfcmVhZF9jb25maWdfYnl0ZSAocGRldiwgUENJX0lOVEVSUlVQVF9QSU4sICZoaS0+cGNpX3BpbltmdW5dKTsKLSAgICBwY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yCisJCSogYm9hcmQgKi8KKwkJKmNwID0gMDsgICAgICAgICAgICAgICAgICAgIC8qIHRlcm1pbmF0aW9uICovCisJfQorCisJcmV0dXJuIDE7CiB9CiAKLQotc3RhdHVzX3QgICAgX19pbml0Ci1jNGh3X2F0dGFjaF9hbGwgKHZvaWQpCitzdGF0dXNfdCBfX2luaXQKK2M0aHdfYXR0YWNoX2FsbCh2b2lkKQogewotICAgIGhkd19pbmZvX3QgKmhpOwotICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2ID0gTlVMTDsKLSAgICBpbnQgICAgICAgICBmb3VuZCA9IDAsIGksIGo7CisJaGR3X2luZm9fdCAqaGk7CisJc3RydWN0IHBjaV9kZXYgKnBkZXYgPSBOVUxMOworCWludCAgICAgICAgIGZvdW5kID0gMCwgaSwgajsKIAotICAgIGVycm9yX2ZsYWcgPSAwOwotICAgIHByZXBfaGR3X2luZm8gKCk7Ci0gICAgLyoqKiBzY2FuIFBDSSBidXMgZm9yIGFsbCBwb3NzaWJsZSBib2FyZHMgKi8KLSAgICB3aGlsZSAoKHBkZXYgPSBwY2lfZ2V0X2RldmljZSAoUENJX1ZFTkRPUl9JRF9DT05FWEFOVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBDSV9ERVZJQ0VfSURfQ044NDc0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGRldikpKQotICAgIHsKLSAgICAgICAgaWYgKGM0X2hkd19pbml0IChwZGV2LCBmb3VuZCkpCi0gICAgICAgICAgICBmb3VuZCsrOwotICAgIH0KLSAgICBpZiAoIWZvdW5kKQotICAgIHsKLSAgICAgICAgcHJfd2FybmluZygiTm8gYm9hcmRzIGZvdW5kXG4iKTsKLSAgICAgICAgcmV0dXJuIC1FTk9ERVY7Ci0gICAgfQotICAgIC8qIHNhbml0eSBjaGVjayBmb3IgY29uc2lzdGVudCBoYXJkd2FyZSBmb3VuZCAqLwotICAgIGZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCi0gICAgewotICAgICAgICBpZiAoaGktPnBjaV9zbG90ICE9IDB4ZmYgJiYgKCFoaS0+YWRkclswXSB8fCAhaGktPmFkZHJbMV0pKQotICAgICAgICB7Ci0gICAgICAgICAgICBwcl93YXJuaW5nKCIlczogc29tZXRoaW5nIHZlcnkgd3Jvbmcgd2l0aCBwY2lfZ2V0X2RldmljZVxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUpOwotICAgICAgICAgICAgcmV0dXJuIC1FSU87Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgLyogYnJpbmcgYm9hcmQncyBtZW1vcnkgcmVnaW9ucyBvbi9saW5lICovCi0gICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChoaS0+cGNpX3Nsb3QgPT0gMHhmZikKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMjsgaisrKQotICAgICAgICB7Ci0JICAgIGlmICghcmVxdWVzdF9tZW1fcmVnaW9uIChoaS0+YWRkcltqXSwgaGktPmxlbltqXSwgaGktPmRldm5hbWUpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBtZW1vcnkgaW4gdXNlLCBhZGRyPTB4JWx4LCBsZW49MHglbHggP1xuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpLT5kZXZuYW1lLCBoaS0+YWRkcltqXSwgaGktPmxlbltqXSk7Ci0gICAgICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaGktPmFkZHJfbWFwcGVkW2pdID0gKHVuc2lnbmVkIGxvbmcpIGlvcmVtYXAgKGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKLSAgICAgICAgICAgIGlmICghaGktPmFkZHJfbWFwcGVkW2pdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBpb3JlbWFwIGZhaWxzLCBhZGRyPTB4JWx4LCBsZW49MHglbHggP1xuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpLT5kZXZuYW1lLCBoaS0+YWRkcltqXSwgaGktPmxlbltqXSk7Ci0gICAgICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOwotICAgICAgICAgICAgfQorCWVycm9yX2ZsYWcgPSAwOworCXByZXBfaGR3X2luZm8oKTsKKwkvKioqIHNjYW4gUENJIGJ1cyBmb3IgYWxsIHBvc3NpYmxlIGJvYXJkcyAqLworCXdoaWxlICgocGRldiA9IHBjaV9nZXRfZGV2aWNlKFBDSV9WRU5ET1JfSURfQ09ORVhBTlQsCisJCQkJICAgICAgUENJX0RFVklDRV9JRF9DTjg0NzQsCisJCQkJICAgICAgcGRldikpKSB7CisJCWlmIChjNF9oZHdfaW5pdChwZGV2LCBmb3VuZCkpCisJCQlmb3VuZCsrOworCX0KKworCWlmICghZm91bmQpIHsKKwkJcHJfd2FybmluZygiTm8gYm9hcmRzIGZvdW5kXG4iKTsKKwkJcmV0dXJuIC1FTk9ERVY7CisJfQorCisJLyogc2FuaXR5IGNoZWNrIGZvciBjb25zaXN0ZW50IGhhcmR3YXJlIGZvdW5kICovCisJZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykgeworCQlpZiAoaGktPnBjaV9zbG90ICE9IDB4ZmYgJiYgKCFoaS0+YWRkclswXSB8fCAhaGktPmFkZHJbMV0pKSB7CisJCQlwcl93YXJuaW5nKCIlczogc29tZXRoaW5nIHZlcnkgd3Jvbmcgd2l0a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gICAgICAgY2xlYW51cF9kZXZzICgpOwotICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOwotICAgICAgICAgICAgcmV0dXJuIC1FSU87Ci0gICAgICAgIH0KLSAgICAgICAgcGNpX3NldF9tYXN0ZXIgKGhpLT5wZGV2WzBdKTsKLSAgICAgICAgcGNpX3NldF9tYXN0ZXIgKGhpLT5wZGV2WzFdKTsKLSAgICAgICAgaWYgKCEoaGktPm5kZXYgPSBjNF9hZGRfZGV2IChoaSwgaSwgKGxvbmcpIGhpLT5hZGRyX21hcHBlZFswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobG9uZykgaGktPmFkZHJfbWFwcGVkWzFdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpLT5wZGV2WzBdLT5pcnEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPnBkZXZbMV0tPmlycSkpKQotICAgICAgICB7Ci0gICAgICAgICAgICBkcnZyX3N0YXRlID0gU0JFX0RSVlJfRE9XTjsKLSAgICAgICAgICAgIGNsZWFudXBfaW9yZW1hcCAoKTsKLSAgICAgICAgICAgIC8qIE5PVEU6IGM0X2FkZF9kZXYoKSBkb2VzIGl0cyBvd24gZGV2aWNlIGNsZWFudXAgKi8KKwkvKiBIYXZlIG5vdyBtZW1vcnkgbWFwcGVkIGFsbCBib2FyZHMuICBOb3cgYWxsb3cgYm9hcmQncyBhY2Nlc3MgdG8gc3lzdGVtICovCisJZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykgeworCQlpZiAoaGktPnBjaV9zbG90ID09IDB4ZmYpCisJCQlicmVhazsKKwkJaWYgKHBjaV9lbmFibGVfZGV2aWNlKGhpLT5wZGV2WzBdKSB8fAorCQkgICAgcGNpX2VuYWJsZV9kZXZpY2UoaGktPnBkZXZbMV0pKSB7CisJCQlkcnZyX3N0YXRlID0g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50ICB3YW5jZmdfc2V0X3RzaW9jKHdjZmdfdCAqLCBzdHJ1Y3Qgd2FuYzF0M190c19wYXJhbSAqKTsKICNlbmRpZgogCiAjZW5kaWYgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKiogX0lOQ19MSUJTQkVXX0hfICoqKi8KZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvbGludXguYyBiL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvbGludXguYwppbmRleCA0YTA4ZTE2Li5iMDJmNWFkZSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9saW51eC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy9jeHQxZTEvbGludXguYwpAQCAtMzEsNyArMzEsNyBAQAogI2luY2x1ZGUgInBtY2M0X3ByaXZhdGUuaCIKICNpbmNsdWRlICJzYmVwcm9jLmgiCiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqIEVycm9yIG91dCBlYXJseSBpZiB3ZSBoYXZlIGNvbXBpbGVyIHRyb3VibGUuCiAgKgogICogICAoVGhpcyBzZWN0aW9uIGlzIGluY2x1ZGVkIGZyb20gdGhlIGtlcm5lbCdzIGluaXQvbWFpbi5jIGFzIGEgZnJpZW5kbHkKQEAgLTUwLDQzICs1MCw0MiBAQAogI3dhcm5pbmcgZ2NjLTQuMS4wIGlzIGtub3duIHRvIG1pc2NvbXBpbGUgdGhlIGtlcm5lbC4gIEEgZGlmZmVyZW50IGNvbXBpbGVyIHZlcnNpb24gaXMgcmVjb21tZW5kZWQuCiAjZW5kaWYKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNkZWZpbmUgQ0hBTk5BTUUgImhkbGMiCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogZm9yd2FyZCByZWZlcmVuY2VzICovCi1zdGF0dXNfdCAgICBjNF9jaGFuX3dvcmtfaW5pdCAobXBpX3QgKiwgbWNoX3QgKik7Ci12b2lkICAgICAgICBtdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0ICh2b2lkICopOwotc3RhdHVzX3QgX19pbml0IGM0X2luaXQgKGNpX3QgKiwgdV9jaGFyICosIHVfY2hhciAqKTsKLXN0YXR1c190IF9faW5pdCBjNF9pbml0MiAoY2lfdCAqKTsKLWNpX3QgICAgICAgKl9faW5pdCBjNF9uZXcgKHZvaWQgKik7Ci1pbnQgX19pbml0ICBjNGh3X2F0dGFjaF9hbGwgKHZvaWQpOwotdm9pZCBfX2luaXQgaGR3X3NuX2dldCAoaGR3X2luZm9fdCAqLCBpbnQpOworc3RhdHVzX3QgICAgYzRfY2hhbl93b3JrX2luaXQobXBpX3QgKiwgbWNoX3QgKik7Cit2b2lkICAgICAgICBtdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0KHZvaWQgKik7CitzdGF0dXNfdCBfX2luaXQgYzRfaW5pdChjaV90ICosIHVfY2hhciAqLCB1X2NoYXIgKik7CitzdGF0dXNfdCBfX2luaXQgYzRfaW5pdDIoY2lfdCAqKTsKK2NpX3QgICAgICAgKl9faW5pdCBjNF9uZXcodm9pZCAqKTsKK2ludCBfX2luaXQgIGM0aHdfYXR0YWNoX2FsbCh2b2lkKTsKK3ZvaWQgX19pbml0IGhkd19zbl9nZXQoaGR3X2luZm9fdCAqLCB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F4X21ydV9kZWZhdWx0ID0gTVVTWUNDX01SVTsKIG1vZHVsZV9wYXJhbShjeHQxZTFfbWF4X21ydSwgaW50LCAwNDQ0KTsKIAogaW50ICAgICAgICAgY3h0MWUxX21heF9tdHUgPSBNVVNZQ0NfTVRVOwpAQCAtMTI3LDMzICsxMjYsMjMgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLXZvaWQgICAgICAgKgotZ2V0dXNlcmJ5Y2hhbiAoaW50IGNoYW5udW0pCit2b2lkICoKK2dldHVzZXJieWNoYW4oaW50IGNoYW5udW0pCiB7Ci0gICAgbWNoX3QgICAgICAqY2g7CisJbWNoX3QgICAgICAqY2g7CiAKLSAgICBjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSk7Ci0gICAgcmV0dXJuIGNoID8gY2gtPnVzZXIgOiBOVUxMOworCWNoID0gYzRfZmluZF9jaGFuKGNoYW5udW0pOworCXJldHVybiBjaCA/IGNoLT51c2VyIDogTlVMTDsKIH0KIAogCi1jaGFyICAgICAgICoKLWdldF9oZGxjX25hbWUgKGhkbGNfZGV2aWNlICpoZGxjKQorY2hhciAqCitnZXRfaGRsY19uYW1lKGhkbGNfZGV2aWNlICpoZGxjKQogewotICAgIHN0cnVjdCBjNF9wcml2ICpwcml2ID0gaGRsYy0+cHJpdjsKLSAgICBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ID0gZ2V0dXNlcmJ5Y2hhbiAocHJpdi0+Y2hhbm51bSk7CisJc3RydWN0IGM0X3ByaXYgKnByaXYgPSBoZGxjLT5wcml2OworCXN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBnZXR1c2VyYnljaGFuKHByaXYtPmNoYW5udW0pOwogCi0gICAgcm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mV0OworCWhkbGNfZGV2aWNlICpoZGxjID0gZGV2X3RvX2hkbGMobmRldik7CisJY29uc3Qgc3RydWN0IGM0X3ByaXYgKnByaXYgPSBoZGxjLT5wcml2OworCWludCAgICAgICAgIHJldDsKIAotICAgIGlmICgocmV0ID0gaGRsY19vcGVuIChuZGV2KSkpCi0gICAgewotICAgICAgICBwcl9pbmZvKCJoZGxjX29wZW4gZmFpbHVyZSwgZXJyICVkLlxuIiwgcmV0KTsKLSAgICAgICAgcmV0dXJuIHJldDsKLSAgICB9Ci0gICAgaWYgKChyZXQgPSBjNF9jaGFuX3VwIChwcml2LT5jaSwgcHJpdi0+Y2hhbm51bSkpKQotICAgICAgICByZXR1cm4gLXJldDsKLSAgICB0cnlfbW9kdWxlX2dldCAoVEhJU19NT0RVTEUpOwotICAgIG5ldGlmX3N0YXJ0X3F1ZXVlIChuZGV2KTsKLSAgICByZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIG5vIGVycm9yID0gc3VjY2VzcyAqLworCXJldCA9IGhkbGNfb3BlbihuZGV2KTsKKwlpZiAocmV0KSB7CisJCXByX2luZm8oImhkbGNfb3BlbiBmYWlsdXJlLCBlcnIgJWQuXG4iLCByZXQpOworCQlyZXR1cm4gcmV0OworCX0KKworCXJldCA9IGM0X2NoYW5fdXAocHJpdi0+Y2ksIHByaXYtPmNoYW5udW0pOworCWlmIChyZXQgPCAwKQorCQlyZXR1cm4gcmV0OworCXRyeV9tb2R1bGVfZ2V0KFRISVNfTU9EVUxFKTsKKwluZXRpZl9zdGFydF9xdWV1ZShuZGV2KTsKKwlyZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIG5vIGVycm9yID0gc3VjY2VzcyAqLwogfQogCiAKIHN0YXRpYyBpbnQKLWNoYW5fY2xvc2UgKHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2KQorY2hhbl9jbG9zZShzdHJ1Y3QgbmV0X2RldmljZSAqbmRldikKIHsKLSAgICBoZGxjX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ZXRfZGV2aWNlICpuZGV2LCB1bnNpZ25lZCBzaG9ydCBmb29fMSwKKwkJIHVuc2lnbmVkIHNob3J0IGZvb18yKQogewotICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAvKiBvdXIgZHJpdmVyIGhhcyBub3RoaW5nIHRvIGRvIGhlcmUsIHNob3cncwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBvdmVyLCBnbyBob21lICovCisJLyogb3VyIGRyaXZlciBoYXMgbm90aGluZyB0byBkbyBoZXJlLCBzaG93J3MKKwkgKiBvdmVyLCBnbyBob21lCisJICovCisJcmV0dXJuIDA7CiB9CiAKIAogc3RhdGljIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICoKLWNoYW5fZ2V0X3N0YXRzIChzdHJ1Y3QgbmV0X2RldmljZSAqbmRldikKK2NoYW5fZ2V0X3N0YXRzKHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2KQogewotICAgIG1jaF90ICAgICAgKmNoOwotICAgIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICpuc3RhdHM7Ci0gICAgc3RydWN0IHNiZWNvbV9jaGFuX3N0YXRzICpzdGF0czsKLSAgICBpbnQgICAgICAgICBjaGFubnVtOworCW1jaF90ICAgICAgKmNoOworCXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICpuc3RhdHM7CisJc3RydWN0IHNiZWNvbV9jaGFuX3N0YXRzICpzdGF0czsKKwlpbnQgICAgICAgICBjaGFubnVtOwogCi0gICAgewotICAgICAgICBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKKwl7CisJCXN0cnVjdCBjNF9wcml2ICpwcml2OwogCi0gICAgICAgIHByaXYgPSAoc3RydWN0IGM0X3ByaXYgKikgZGV2X3RvX2hkbGMgKG5kZXYpLT5wcml2OwotICAgICAgICBjaGFubnVtID0gcHJpdi0+Y2hhbm51bTsKLSAgICB9CisJCXByaXYgPSAoc3RydWN0IGM0X3ByaXYgKilkZXZfdG9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GV4aXN0cyAqLworCWlmIChjNF9maW5kX2NoYW4oY3AtPmNoYW5udW0pKQorCQlyZXR1cm4gTlVMTDsgICAgICAgICAgICAgICAgICAgLyogY2hhbm5lbCBhbHJlYWR5IGV4aXN0cyAqLwogCi0gICAgewotICAgICAgICBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKKwl7CisJCXN0cnVjdCBjNF9wcml2ICpwcml2OwogCi0gICAgICAgIC8qIGFsbG9jYXRlIHRoZW4gZmlsbCBpbiBwcml2YXRlIGRhdGEgc3RydWN0dXJlICovCi0gICAgICAgIHByaXYgPSBPU19rbWFsbG9jIChzaXplb2YgKHN0cnVjdCBjNF9wcml2KSk7Ci0gICAgICAgIGlmICghcHJpdikKLSAgICAgICAgewotICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IG5vIG1lbW9yeSBmb3IgbmV0X2RldmljZSAhXG4iLCBjaS0+ZGV2bmFtZSk7Ci0JICAgIHJldHVybiBOVUxMOwotICAgICAgICB9Ci0gICAgICAgIGRldiA9IGFsbG9jX2hkbGNkZXYgKHByaXYpOwotICAgICAgICBpZiAoIWRldikKLSAgICAgICAgewotICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IG5vIG1lbW9yeSBmb3IgaGRsY19kZXZpY2UgIVxuIiwgY2ktPmRldm5hbWUpOwotICAgICAgICAgICAgT1Nfa2ZyZWUgKHByaXYpOwotCSAgICByZXR1cm4gTlVMTDsKLSAgICAgICAgfQotICAgICAgICBwcml2LT5jaSA9IGNpOwotICAgICAgICBwcml2LT5jaGFubnVtID0gY3AtPmNoYW5udW07Ci0gICAgfQorCQkvKiBhbGxvY2F0ZSB0aGVuIGZpbGwgaW4gcHJpdmF0ZSBkYXRhIHN0cnVjdHVyZSAqLworCQlwcml2ID0gT1Nfa21hbGxvYyhzaXplb2Yoc3RydWN0IGM0X3ByaXYpKTsKKwkJaWYgKCFwcml2KSB7CisJCQlwcl93YXJuaW5nKCIlczogbm8gbWVtb3J5IGZvciBuZXRfZGV2aWNlICFcbiIsCisJCQkJICAgY2ktPmRldm5hbWUpOworCQkJcmV0dXJuIE5VTEw7CisJCX0KKwkJZGV2ID0gYWxsb2NfaGRsY2Rldihwcml2KTsKKwkJaWYgKCFkZXYpIHsKKwkJCXByX3dhcm5pbmcoIiVzOiBubyBtZW1vcnkgZm9yIGhkbGNfZGV2aWNlICFcbiIsCisJCQkJICAgY2ktPmRldm5hbWUpOworCQkJT1Nfa2ZyZWUocHJpdik7CisJCQlyZXR1cm4gTlVMTDsKKwkJfQorCQlwcml2LT5jaSA9IGNpOworCQlwcml2LT5jaGFubnVtID0gY3AtPmNoYW5udW07CisJfQogCi0gICAgaGRsYyA9IGRldl90b19oZGxjIChkZXYpOworCWhkbGMgPSBkZXZfdG9faGRsYyhkZXYpOwogCi0gICAgZGV2LT5iYXNlX2FkZHIgPSAwOyAgICAgICAgICAgICAvKiBub3QgSS9PIG1hcHBlZCAqLwotICAgIGRldi0+aXJxID0gbmRldi0+aXJxOwotICAgIGRldi0+dHlwZSA9IEFSUEhSRF9SQVdIRExDOwotICAgICpkZXYtPm5hbWUgPSAwOyAgICAgICAgICAgICAgICAgLyogZGVmYXVsdCBpZmNvbmZpZyBuYW1lID0gImhkbGMiICovCisJZGV2LT5iYXNlX2FkZHIgPSAwOyAgICAgICAgICAgICAvKiBub3QgSS9PIG1hcHBlZCAqLworCWRldi0+aXJxID0gbmRldi0+aXJxOworCWRldi0+dHlwZSA9IEFSUEhSRF9SQVdIRExDOworCSpkZXYtPm5hbWUgPSAwOyAgICAgICAgICAgICAgICAgLyogZGVmYXVsdCBpZmNvbmZpZyBuYW1lID0gImhkbGMiICovCiAKLSAgICBoaSA9IChoZHdfaW5mb190ICopIGNpLT5oZHdfaW5mbzsKLSAgICBpZiAoaGktPm1mZ19pbmZvX3N0cyA9PSBFRVBST01fT0spCi0gICAgewotICAgICAgICBzd2l0Y2ggKGhpLT5wcm9tZm10KQotICAgICAgICB7Ci0gICAgICAgIGNhc2UgUFJPTV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Y2NfaXNyX3RxLnJvdXRpbmUgPSAodm9pZCAqKSh1bnNpZ25lZCBsb25nKW11c3ljY19pbnRyX2JoX3Rhc2tsZXQ7CisJY2ktPmNpX211c3ljY19pc3JfdHEuZGF0YSA9IGNpOwogI2VuZGlmCiAKIAotICAgIGlmIChyZWdpc3Rlcl9uZXRkZXYgKG5kZXYpIHx8Ci0gICAgICAgIChjNF9pbml0IChjaSwgKHVfY2hhciAqKSBmMCwgKHVfY2hhciAqKSBmMSkgIT0gU0JFX0RSVlJfU1VDQ0VTUykpCi0gICAgewotICAgICAgICBPU19rZnJlZSAobmV0ZGV2X3ByaXYobmRldikpOwotICAgICAgICBPU19rZnJlZSAobmRldik7Ci0gICAgICAgIGVycm9yX2ZsYWcgPSBFTk9ERVY7Ci0JcmV0dXJuIE5VTEw7Ci0gICAgfQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICogIGludCByZXF1ZXN0X2lycSh1bnNpZ25lZCBpbnQgaXJxLAotICAgICAqICAgICAgICAgICAgICAgICAgdm9pZCAoKmhhbmRsZXIpKGludCwgdm9pZCAqLCBzdHJ1Y3QgcHRfcmVncyAqKSwKLSAgICAgKiAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3MsIGNvbnN0IGNoYXIgKmRldl9uYW1lLCB2b2lkICpkZXZfaWQpOwotICAgICAqICB3aGVyZWluOgotICAgICAqICBpcnEgICAgICAtPiBUaGUgaW50ZXJydXB0IG51bWJlciB0aGF0IGlzIGJlaW5nIHJlcXVlc3RlZC4KLSAgICAgKiAgaGFuZGxlciAgLT4gUG9pbnRlciB0byBoYW5kbGluZyBmdW5jdGlvbiBiZWluZyBpbnN0YWxsZWQuCi0gICAgICogIGZsYWdzICAgIC0+IEEgYml0IG1hc2sgb2Ygb3B0aW9ucyByZWxhdGVkIHRvIGludGVycnVwdCBtYW5hZ2VtZW50LgotICAgICAqICBkZXZfbmFtZSAtPiBTdHJpbmcgdXNlZCBpbiAvcHJvYy9pbnRlcnJ1cHRzIHRvIHNob3cgb3duZXIgb2YgaW50ZXJydXB0LgotICAgICAqICBkZXZfaWQgICAtPiBQb2ludGVyIChmb3Igc2hhcmVkIGludGVycnVwdCBsaW5lcykgdG8gcG9pbnQgdG8gaXRzIG93bgotICAgICAqICAgICAgICAgICAgICBwcml2YXRlIGRhdGEgYXJlYSAodG8gaWRlbnRpZnkgd2hpY2ggZGV2aWNlIGlzIGludGVycnVwdGluZykuCi0gICAgICoKLSAgICAgKiAgZXh0ZXJuIHZvaWQgZnJlZV9pcnEodW5zaWduZWQgaW50IGlycSwgdm9pZCAqZGV2X2lkKTsKLSAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJaWYgKHJlZ2lzdGVyX25ldGRldihuZGV2KSB8fAorCQkoYzRfaW5pdChjaSwgKHVfY2hhciAqKSBmMCwgKHVfY2hhciAqKSBmMSkgIT0gU0JFX0RSVlJfU1VDQ0VTUykpIHsKKwkJT1Nfa2ZyZWUobmV0ZGV2X3ByaXYobmRldikpOworCQlPU19rZnJlZShuZGV2KTsKKwkJZXJyb3JfZmxhZyA9IC1FTk9ERVY7CisJCXJldHVybiBOVUxMOworCX0KKwkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCSAqICBpbnQgcmVxdWVzdF9pcnEodW5zaWduZWQgaW50IGlycSwKKwkgKiAgICAgICAgICAgICAgICAgIHZvaWQgKCpoYW5kbGVyKShpbnQsIHZvaWQgKiwgc3RydWN0IHB0X3JlZ3MgKiksCisJICogICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzLCBjb25zdCBjaGFyICpkZXZfbmFtZSwgdm9pZCAqZGV2X2lkKTsKKwkgKiAgd2hlcmVpbjoKKwkgKiAgaXJxICAgICAgLT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VVMgY291bGQgbm90IGdldCBpcnE6ICVkXG4iLCBoaS0+ZGV2bmFtZSwgaXJxMSk7CisJCXVucmVnaXN0ZXJfbmV0ZGV2KG5kZXYpOworCQlmcmVlX2lycShpcnEwLCBuZGV2KTsKKwkJT1Nfa2ZyZWUobmV0ZGV2X3ByaXYobmRldikpOworCQlPU19rZnJlZShuZGV2KTsKKwkJZXJyb3JfZmxhZyA9IC1FSU87CisJCXJldHVybiBOVUxMOworCX0KICNlbmRpZgogCi0gICAgLyogc2V0dXAgYm9hcmQgaWRlbnRpZmljYXRpb24gaW5mb3JtYXRpb24gKi8KKwkvKiBzZXR1cCBib2FyZCBpZGVudGlmaWNhdGlvbiBpbmZvcm1hdGlvbiAqLwogCi0gICAgewotICAgICAgICB1X2ludDMyX3QgICB0bXA7CisJeworCQl1X2ludDMyX3QgICB0bXA7CiAKLSAgICAgICAgaGR3X3NuX2dldCAoaGksIGJyZG5vKTsgICAgIC8qIGFsc28gc2V0cyBQUk9NIGZvcm1hdCB0eXBlIChwcm9tZm10KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZm9yIGxhdGVyIHVzYWdlICovCisJCS8qIGFsc28gc2V0cyBQUk9NIGZvcm1hdCB0eXBlIChwcm9tZm10KSBmb3IgbGF0ZXIgdXNhZ2UgKi8KKwkJaGR3X3NuX2dldChoaSwgYnJkbm8pOwogCi0gICAgICAgIHN3aXRjaCAoaGktPnByb21mbXQpCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMToKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUxICopIChoaS0+bWZnX2luZm8ucGZ0MS5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMjoKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTIgKikgKGhpLT5tZmdfaW5mby5wZnQyLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGNpLT5icmRfaWQgPSAwOwotICAgICAgICAgICAgbWVtc2V0IChuZGV2LT5kZXZfYWRkciwgMCwgNik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQorCQlzd2l0Y2ggKGhpLT5wcm9tZm10KSB7CisJCWNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisJCQltZW1jcHkobmRldi0+ZGV2X2FkZHIsCisJCQkgICAgICAgKEZMRF9UWVBFMSAqKSAoaGktPm1mZ19pbmZvLnBmdDEuU2VyaWFsKSwgNik7CisJCQkvKiB1bmFsaWduZWQgZGF0YSBhY3F1aXNpdGlvbiAqLworCQkJbWVtY3B5KCZ0bXAsIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLklkKSwgNCk7C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ChqID0gMDsgaiA8IGNpLT5tYXhfcG9ydDsgaisrKQotICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBNVVNZQ0NfTkNIQU5TOyBrKyspCi0gICAgICAgICAgICAgICAgICAgIGlmICgobmRldiA9IGNpLT5wb3J0W2pdLmNoYW5ba10tPnVzZXIpKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAwKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQorCWZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspIHsKKwkJaWYgKGhpLT5uZGV2KSB7ICAgICAgICAgIC8qIGEgYm9hcmQgaGFzIGJlZW4gYXR0YWNoZWQgKi8KKwkJCWNpID0gKGNpX3QgKikobmV0ZGV2X3ByaXYoaGktPm5kZXYpKTsKKwkJCWZvciAoaiA9IDA7IGogPCBjaS0+bWF4X3BvcnQ7IGorKykKKwkJCQlmb3IgKGsgPSAwOyBrIDwgTVVTWUNDX05DSEFOUzsgaysrKSB7CisJCQkJCW5kZXYgPSBjaS0+cG9ydFtqXS5jaGFuW2tdLT51c2VyOworCQkJCQlpZiAobmRldikKKwkJCQkJCWRvX2RlbHVzZXIobmRldiwgMCk7CisJCQkJfQorCQl9CisJfQogfQogCiAKIHN0YXRpYyB2b2lkIF9fZXhpdAotYzRfbW9kX3JlbW92ZSAodm9pZCkKK2M0X21vZF9yZW1vdmUodm9pZCkKIHsKIAljbGVhbnVwX2hkbGMoKTsgICAgICAgICAgICAvKiBkZWxldGUgYW55IG1pc3NlZCBjaGFubmVscyAqLwogCWNsZWFudXBfZGV2cygpOwpAQCAtMTE3MSwxMyArMTE0OCwxMyBAQAogCXByX2luZm8oIlNCRSAtIGRyaXZlciByZW1vdmVkLlxuIik7CiB9CiAKLW1vZHVsZV9pbml0IChjNF9tb2RfaW5pdCk7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ElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgU0RfU0VNX1RBS0UgKCZjaS0+c2VtX3dkYnVzeSwgIl93ZF8iKTsgICAgICAvKiBvbmx5IDEgdGhydSBoZXJlLCBwZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCkBAIC05MTUsNyArOTE2LDcgQEAKICAgICBpbnQgICAgICAgICBpOwogCiAgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CiAgICAgcHAgPSAmY2ktPnBvcnRbcG9ydG51bV0ucDsKQEAgLTkyNywxNSArOTI4LDE1IEBACiAgICAgICAgICAgICAgICAgcG9ydG51bSwgZTFtb2RlLCBwaS0+b3BlbmNoYW5zKTsKICAgICB9CiAgICAgaWYgKHBpLT5vcGVuY2hhbnMpCi0gICAgICAgIHJldHVybiBFQlVTWTsgICAgICAgICAgICAgICAvKiBncm91cCBuZWVkcyBpbml0aWFsaXphdGlvbiBvbmx5IGZvcgorICAgICAgICByZXR1cm4gLUVCVVNZOyAgICAgICAgICAgICAgIC8qIGdyb3VwIG5lZWRzIGluaXRpYWxpemF0aW9uIG9ubHkgZm9yCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaXJzdCBjaGFubmVsIG9mIGEgZ3JvdXAgKi8KIAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gYzRfd3FfcG9ydF9pbml0IChwaSkpKSAgICAgICAvKiBjcmVhdGUvaW5pdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd29ya3F1ZXVlX3N0cnVjdCAqLwotICAgIC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JldDsKIAotICAgICAgICBpZiAoKHJldCA9IGM0X3drX2NoYW5faW5pdCAocGksIGNoKSkpCi0gICAgICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IGM0X3drX2NoYW5faW5pdChwaSwgY2gpOworCWlmIChyZXQpCisJCXJldHVybiByZXQ7CiAgICAgfQogCiAgICAgLyogc2F2ZSBvZmYgaW50ZXJmYWNlIGFzc2lnbm1lbnRzIHdoaWNoIGJvdW5kIGEgYm9hcmQgKi8KQEAgLTEwNzksOCArMTA4MSwxMCBAQAogewogICAgIG1jaF90ICAgICAgKmNoOwogCi0gICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKLSAgICAgICAgcmV0dXJuIEVOT0VOVDsKKwljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwlpZiAoIWNoKQorCQlyZXR1cm4gLUVOT0VOVDsKKwogICAgIGlmIChjaC0+c3RhdGUgPT0gVVApCiAgICAgICAgIG11c3ljY19jaGFuX2Rvd24gKChjaV90ICopIDAsIGNoYW5udW0pOwogICAgIGNoLT5zdGF0ZSA9IFVOQVNTSUdORUQ7CkBAIC0xMDk1LDggKzEwOTksOSBAQAogewogICAgIG1jaF90ICAgICAgKmNoOwogCi0gICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKLSAgICAgICAgcmV0dXJuIEVOT0VOVDsKKwljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwlpZiAoIWNoKQorCQlyZXR1cm4gLUVOT0VOVDsKIAogICAgIG1lbXNldCAoJmNoLT5zLCAwLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9zdGF0cykpOwogICAgIHJldHVybiAwOwpAQCAtMTEwOSwxOSArMTExNCwyMCBAQAogICAgIG1jaF90ICAgICAgKmNoOwogICAgIGludCAgICAgICAgIGksIHggPSAwOwogCi0gICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKLSAgICAgICAgcmV0dXJuIEVOT0VOVDsKKwljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwlpZiAoIWNoKQorCQlyZXR1cm4gLUVOT0VOVDsKIAogI2lmIDEKICAgICBpZiAoY2gtPnAuY2FyZCAhPSBwLT5jYXJkIHx8CiAgICAgICAgIGNoLT5wLnBvcnQgIT0gcC0+cG9ydCB8fAogICAgICAgICBjaC0+cC5jaGFubnVtICE9IHAtPmNoYW5udW0pCi0gICAgICAgIHJldHVybiBFSU5WQUw7CisgICAgICAgIHJldHVybiAtRUlOVkFMOwogI2VuZGlmCiAKICAgICBpZiAoIShjaC0+dXAtPmdyb3VwX2lzX3NldCkpCiAgICAgewotICAgICAgICByZXR1cm4gRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCisgICAgICAgIHJldHVybiAtRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZXF1aXJlZCBwcmlvciB0byBmaXJzdCBncm91cCdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTRVRfQ0hBTiBjb21tYW5kICovCiAgICAgfQpAQCAtMTE0MywxMCArMTE0OSwxMiBAQAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gbXVzeWNjX2NoYW5fZG93biAoKGNpX3QgKikgMCwgY2hhbm51bSkpKQotICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgaWYgKChyZXQgPSBjNF9jaGFuX3VwIChjaC0+dXAtPnVwLCBjaGFubnVtKSkpCi0gICAgICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IG11c3ljY19jaGFuX2Rvd24oKGNpX3QgKikwLCBjaGFubnVtKTsKKwlpZiAocmV0KQorCQlyZXR1cm4gcmV0OworCXJldCA9IGM0X2NoYW5fdXAoY2gtPnVwLT51cCwgY2hhbm51bSk7CisJaWYgKHJldCkKKwkJcmV0dXJuIHJldDsKICAgICAgICAgc2RfZW5hYmxlX3htaXQgKGNoLT51c2VyKTsgIC8qIHJlLWVuYWJsZSB0byBjYXRjaCBmbG93IGNvbnRyb2xsZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNoYW5uZWwgKi8KICAgICB9CkBAIC0xMTU5LDggKzExNjcsMTAgQEAKIHsKICAgICBtY2hfdCAgICAgICpjaDsKIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICAqcCA9IGNoLT5wOwogICAgIHJldHVybiAwOwogfQpAQCAtMTE3MCw4ICsxMTgwLDEwIEBACiB7CiAgICAgbWNoX3QgICAgICAqY2g7CiAKLSAgICBpZiAoIShjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSkpKQotICAgICAgICByZXR1cm4gRU5PRU5UOworCWNoID0gYzRfZmluZF9jaGFuKGNoYW5udW0pOworCWlmICghY2gpCisJCXJldHVybiAtRU5PRU5UOworCiAgICAgKnAgPSBjaC0+czsKICAgICBwLT50eF9wZW5kaW5nID0gYXRvbWljX3JlYWQgKCZjaC0+dHhfcGVuZGluZyk7CiAgICAgcmV0dXJuIDA7CkBAIC0xMjQwLDggKzEyNTIsMTAgQEAKICAgICB1X2ludDMyX3QgICB0bXA7ICAgICAgICAgICAgLyogZm9yIG9wdGltaXppbmcgY29udmVyc2lvbiBhY3Jvc3MgQkUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGxhdGZvcm0gKi8KIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICBpZiAoY2gtPnN0YXRlID09IFVQKQogICAgIHsKICAgICAgICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCkBAIC0xMjY0LDcgKzEyNzgsNyBAQAogICAgICAgICAgICAgICAgIHByX2luZm8oIisgYXNrNCAleCwgY3VycmVudGx5ICV4XG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnAuYml0bWFza1tpXSwgcGktPnRzbVtpXSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gRUlOVkFMOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CiAgICAgICAgIH0KICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKICAgICAgICAgICAgIGlmIChjaC0+cC5iaXRtYXNrW2ldICYgKDEgPDwgaikpCkBAIC0xMjc3LDcgKzEyOTEsNyBAQAogICAgICAgICAvKiBpZiggY3h0MWUxX2xvZ19sZXZlbCA+PSBMT0dfV0FSTikgICovCiAgICAgICAgIHByX2luZm8oIiVzOiBjNF9jaGFuX3VwWyVkXSBFTk9CVUZTIChubyBUaW1lU2xvdHMgYXNzaWduZWQpXG4iLAogICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBjaGFubnVtKTsKLSAgICAgICAgcmV0dXJuIEVOT0JVRlM7ICAgICAgICAgICAgIC8qIHRoaXMgc2hvdWxkIG5vdCBoYXBwZW4gKi8KKyAgICAgICAgcmV0dXJuIC1FTk9CVUZTOyAgICAgICAgICAgICAvKiB0aGlzIHNob3VsZCBub3QgaGFwcGVuICovCiAgICAgfQogICAgIGFkZHIgPSBjNF9maWZvX2FsbG9jIChwaSwgZ2NoYW4sICZuYnVmKTsKICAgICBjaC0+c3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tLS0tLS0tLS0tLQorICAgICBBY2NlbGVwb3J0IFhlbSAgICAgICAgICAgNCAtIDY0ICAgICAgICAgICAgICAoRUlBMjMyICYgRUlBNDIyKQorICAgICBBY2NlbGVwb3J0IFhyICAgICAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IFhyIDkyMCAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IEMvWCAgICAgICAgICAgOCAtIDEyOCAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IEVQQy9YICAgICAgICAgOCAtIDIyNCAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IFhyLzQyMiAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBNDIyKQorICAgICBBY2NlbGVwb3J0IDJyLzkyMCAgICAgICAgMiAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IDRyLzkyMCAgICAgICAgNCAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IDhyLzkyMCAgICAgICAgOCAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorCisgICAgIElCTSA4LVBvcnQgQXN5bmNocm9ub3VzIFBDSSBBZGFwdGVyICAgICAgICAgIChFSUEyMzIpCisgICAgIElCTSAxMjgtUG9ydCBBc3luY2hyb25vdXMgUENJIEFkYXB0ZXIgICAgICAgIChFSUEyMzIgJiBFSUE0MjIpCisqLworCitzdGF0aWMgc3RydWN0IHBjaV9kZXZpY2VfaWQgZGdhcF9wY2lfdGJsW10gPSB7CisJeyBESUdJX1ZJRCwgUENJX0RFVl9YRU1fRElELCAgICAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICAwIH0sCisJeyBESUdJX1ZJRCwgUENJX0RFVl9DWF9ESUQsICAgICAgIFBDSV9BTllfSUQsIFBDSV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KioKKyAqCisgKiBEcml2ZXIgbG9hZC91bmxvYWQgZnVuY3Rpb25zCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIGluaXRfbW9kdWxlKCkKKyAqCisgKiBNb2R1bGUgbG9hZC4gIFRoaXMgaXMgd2hlcmUgaXQgYWxsIHN0YXJ0cy4KKyAqLworc3RhdGljIGludCBkZ2FwX2luaXRfbW9kdWxlKHZvaWQpCit7CisJaW50IHJjID0gMDsKKworCXByX2luZm8oIiVzLCBEaWdpIEludGVybmF0aW9uYWwgUGFydCBOdW1iZXIgJXNcbiIsIERHX05BTUUsIERHX1BBUlQpOworCisJcmMgPSBkZ2FwX3N0YXJ0KCk7CisJaWYgKHJjKQorCQlyZXR1cm4gcmM7CisKKwlyYyA9IGRnYXBfaW5pdF9wY2koKTsKKwlpZiAocmMpCisJCWdvdG8gZXJyX2NsZWFudXA7CisKKwlyYyA9IGRnYXBfY3JlYXRlX2RyaXZlcl9zeXNmaWxlcygmZGdhcF9kcml2ZXIpOworCWlmIChyYykKKwkJZ290byBlcnJfY2xlYW51cDsKKworCWRnYXBfZHJpdmVyX3N0YXRlID0gRFJJVkVSX1JFQURZOworCisJcmV0dXJuIDA7CisKK2Vycl9jbGVhbnVwOgorCisJZGdhcF9jbGVhbnVwX21vZHVsZSgpOworCisJcmV0dXJuIHJjOworfQorbW9kdWxlX2luaXQoZGdhcF9pbml0X21vZHVsZSk7CisKKy8qCisgKiBTdGFydCBvZiBkcml2ZXIuCisgKi8KK3N0YXRpYyBpbnQgZGdhcF9zdGFydCh2b2lkKQoreworCWludCByYyA9IDA7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlzdHJ1Y3QgZGV2aWNlICpkZXZpY2U7CisKKwkvKgorCSAqIG1ha2Ugc3VyZSB0aGF0IHRoZSBnbG9iYWxzIGFyZQorCSAqIGluaXQnZCBiZWZvcmUgd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XNlICsgUENJX0lPX09GRlNFVCksIDB4MjAwMDAwKTsKKwlpZiAoIWJyZC0+cmVfbWFwX3BvcnQpIHsKKwkJcmVsZWFzZV9tZW1fcmVnaW9uKGJyZC0+bWVtYmFzZSwgMHgyMDAwMDApOworCQlyZWxlYXNlX21lbV9yZWdpb24oYnJkLT5tZW1iYXNlICsgUENJX0lPX09GRlNFVCwgMHgyMDAwMDApOworCQlpb3VubWFwKGJyZC0+cmVfbWFwX21lbWJhc2UpOworCQlyZXR1cm4gLUVOT01FTTsKKwl9CisKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIEZ1bmN0aW9uOgorKgorKiAgICBkZ2FwX3BvbGxfaGFuZGxlcgorKgorKiBBdXRob3I6CisqCisqICAgIFNjb3R0IEggS2lsYXUKKyoKKyogUGFyYW1ldGVyczoKKyoKKyogICAgZHVtbXkgLS0gaWdub3JlZAorKgorKiBSZXR1cm4gVmFsdWVzOgorKgorKiAgICBub25lCisqCisqIERlc2NyaXB0aW9uOgorKgorKiAgICBBcyBlYWNoIHRpbWVyIGV4cGlyZXMsIGl0IGRldGVybWluZXMgKGEpIHdoZXRoZXIgdGhlICJ0cmFuc21pdCIKKyogICAgd2FpdGVyIG5lZWRzIHRvIGJlIHdva2VuIHVwLCBhbmQgKGIpIHdoZXRoZXIgdGhlIHBvbGxlciBuZWVkcyB0bworKiAgICBiZSByZXNjaGVkdWxlZC4KKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQgZGdhcF9wb2xsX2hhbmRsZXIodWxvbmcgZHVtbXkpCit7CisJaW50IGk7CisJc3RydWN0IGJvYXJkX3QgKmJyZDsKKwl1bnNpZ25lZCBsb25nIGxvY2tfZmxhZ3M7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ioqKioqKioqKioqKioqCisgKgorICogVXRpbGl0eSBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogZGdhcF9tc19zbGVlcCgpCisgKgorICogUHV0IHRoZSBkcml2ZXIgdG8gc2xlZXAgZm9yIHggbXMncworICoKKyAqIFJldHVybnMgMCBpZiB0aW1lZCBvdXQsICEwIChzaG93aW5nIHNpZ25hbCkgaWYgaW50ZXJydXB0ZWQgYnkgYSBzaWduYWwuCisgKi8KK3N0YXRpYyBpbnQgZGdhcF9tc19zbGVlcCh1bG9uZyBtcykKK3sKKwljdXJyZW50LT5zdGF0ZSA9IFRBU0tfSU5URVJSVVBUSUJMRTsKKwlzY2hlZHVsZV90aW1lb3V0KChtcyAqIEhaKSAvIDEwMDApOworCXJldHVybiBzaWduYWxfcGVuZGluZyhjdXJyZW50KTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFRUWSBJbml0aWFsaXphdGlvbi9DbGVhbnVwIEZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBkZ2FwX3R0eV9yZWdpc3RlcigpCisgKgorICogSW5pdCB0aGUgdHR5IHN1YnN5c3RlbSBmb3IgdGhpcyBib2FyZC4KKyAqLworc3RhdGljIGludCBkZ2FwX3R0eV9yZWdpc3RlcihzdHJ1Y3QgYm9hcmRfdCAqYnJkKQoreworCWludCByYyA9IDA7CisKKwlicmQtPlNlcmlhbERyaXZlciA9IGFsbG9jX3R0eV9kcml2ZXIoTUFYUE9SVFMpOworCisJc25wcmludGYoYnJkLT5TZXJpYWxOYW1lLCBNQVhUVFlOQU1FTEVOLCAidHR5X2R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mPSB+U05JRkZfV0FJVF9EQVRBOworCQkJCXdha2VfdXBfaW50ZXJydXB0aWJsZSgmY2gtPmNoX3NuaWZmX3dhaXQpOworCQkJfQorCQl9CisKKwkJLyoKKwkJICogSWYgdGhlIHVzZXIgc2VudCB1cyB0b28gbXVjaCBkYXRhIHRvIHB1c2ggaW50byBvdXIgdG1wYnVmLAorCQkgKiB3ZSBuZWVkIHRvIGtlZXAgbG9vcGluZyBhcm91bmQgb24gYWxsIHRoZSBkYXRhLgorCQkgKi8KKwkJaWYgKHRvb19tdWNoX2RhdGEpIHsKKwkJCXAgPSB0bXBidWY7CisJCQl0bXBidWZsZW4gPSAwOworCQl9CisKKwl9IHdoaWxlICh0b29fbXVjaF9kYXRhKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9pbnB1dCAtIFByb2Nlc3MgcmVjZWl2ZWQgZGF0YS4KKyAqCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3N0YXRpYyB2b2lkIGRnYXBfaW5wdXQoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCXN0cnVjdCBic190CSpiczsKKwlzdHJ1Y3QgdHR5X3N0cnVjdCAqdHA7CisJc3RydWN0IHR0eV9sZGlzYyAqbGQ7CisJdWludAlybWFzazsKKwl1aW50CWhlYWQ7CisJdWludAl0YWlsOworCWludAlkYXRhX2xlbjsKKwl1bG9uZwlsb2NrX2ZsYWdzOworCXVsb25nICAgbG9ja19mbGFnczI7CisJaW50IGZsaXBfbGVuOworCWludCBsZW4gPSAwOworCWludCBuID0gMDsKKw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JbGVuID0gdHR5X2J1ZmZlcl9yZXF1ZXN0X3Jvb20odHAtPnBvcnQsIGxlbik7CisJCXR0eV9pbnNlcnRfZmxpcF9zdHJpbmcodHAtPnBvcnQsIGNoLT5jaF9iZC0+ZmxpcGJ1ZiwgbGVuKTsKKwl9CisKKwlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZjaC0+Y2hfbG9jaywgbG9ja19mbGFnczIpOworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmJkLT5iZF9sb2NrLCBsb2NrX2ZsYWdzKTsKKworCS8qIFRlbGwgdGhlIHR0eSBsYXllciBpdHMgb2theSB0byAiZWF0IiB0aGUgZGF0YSBub3cgKi8KKwl0dHlfZmxpcF9idWZmZXJfcHVzaCh0cC0+cG9ydCk7CisKKwlpZiAobGQpCisJCXR0eV9sZGlzY19kZXJlZihsZCk7CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRGV0ZXJtaW5lcyB3aGVuIENBUlJJRVIgY2hhbmdlcyBzdGF0ZSBhbmQgdGFrZXMgYXBwcm9wcmlhdGUKKyAqIGFjdGlvbi4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBkZ2FwX2NhcnJpZXIoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCisJaW50IHZpcnRfY2FycmllciA9IDA7CisJaW50IHBoeXNfY2FycmllciA9IDA7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyAhPSBER0FQX0NIQU5ORUxfTUFHSUMpCisJCXJldHVybjsKKworCWJkID0gY2gtPmNoX2JkOworCisJaWYgKCFiZCB8fCBiZC0+bWFnaWMgIT0gREdBUF9CT0FSRF9NQUdJQykKKwkJcmV0dXJuOworCisJLy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Y2tfaXJxcmVzdG9yZSgmYmQtPmJkX2xvY2ssIGxvY2tfZmxhZ3MpOworCWlmICh3YWl0cXVldWVfYWN0aXZlKCZ0dHktPndyaXRlX3dhaXQpKQorCQl3YWtlX3VwX2ludGVycnVwdGlibGUoJnR0eS0+d3JpdGVfd2FpdCk7CisJdHR5X3dha2V1cCh0dHkpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBUaGUgSU9DVEwgZnVuY3Rpb24gYW5kIGFsbCBvZiBpdHMgaGVscGVycworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIGRnYXBfdHR5X2lvY3RsKCkKKyAqCisgKiBUaGUgdXN1YWwgYXNzb3J0bWVudCBvZiBpb2N0bCdzCisgKi8KK3N0YXRpYyBpbnQgZGdhcF90dHlfaW9jdGwoc3RydWN0IHR0eV9zdHJ1Y3QgKnR0eSwgdW5zaWduZWQgaW50IGNtZCwKKwkJdW5zaWduZWQgbG9uZyBhcmcpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCXN0cnVjdCBjaGFubmVsX3QgKmNoOworCXN0cnVjdCB1bl90ICp1bjsKKwlpbnQgcmM7CisJdTE2CWhlYWQgPSAwOworCXVsb25nICAgbG9ja19mbGFncyA9IDA7CisJdWxvbmcgICBsb2NrX2ZsYWdzMiA9IDA7CisJdm9pZCBfX3VzZXIgKnVhcmcgPSAodm9pZCBfX3VzZXIgKikgYXJnOworCisJaWYgKCF0dHkgfHwgdHR5LT5tYWdpYyAhPSBUVFlfTUFHSUMpCisJCXJldHVybiAtRU5PREVWOworCisJdW4gPSB0dHktPmRyaXZlcl9kYXRhOworCWlmICghdW4gfHwgdW4tPm1hZ2ljICE9IERHQVBfVU5JVF9NQUdJQykKKwkJcmV0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tfZmxhZ3MpOworCQl9CisKK291dDoKKwkJLyoKKwkJICogSWYgYm9hcmQgaXMgZG9pbmcgaW50ZXJydXB0cywgQUNLIHRoZSBpbnRlcnJ1cHQuCisJCSAqLworCQlpZiAoYmQgJiYgYmQtPmludHJfcnVubmluZykKKwkJCXJlYWRiKGJkLT5yZV9tYXBfcG9ydCArIDIpOworCisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmJkLT5iZF9sb2NrLCBsb2NrX2ZsYWdzKTsKKwkJcmV0dXJuOworCX0KKworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmJkLT5iZF9sb2NrLCBsb2NrX2ZsYWdzKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWRiIC0gU2VuZHMgYSAyIGJ5dGUgY29tbWFuZCB0byB0aGUgRkVQLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBjbWQgICAgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUxICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgZmlyc3QgYnl0ZSB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUyICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgc2Vjb25kIGJ5dGUgdG8gYmUgc2VudC4KKyAqICAgICAgICAgICAgICBuY21kcyAgIC0gV2FpdCB1bnRpbCBuY21kcyBvciBmZXdlciBjbWRzIGFyZSBsZWZ0CisgKiAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBjbWQgYnVmZmVyIGJlZm9yZSByZXR1cm5pbmcuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWR3IC0gU2VuZHMgYSAxIHdvcmQgY29tbWFuZCB0byB0aGUgRkVQLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBjbWQgICAgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIHdvcmQgICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgd29yZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIG5jbWRzICAgLSBXYWl0IHVudGlsIG5jbWRzIG9yIGZld2VyIGNtZHMgYXJlIGxlZnQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGNtZCBidWZmZXIgYmVmb3JlIHJldHVybmluZy4KKyAqCisgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIGRnYXBfY21kdyhzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdWNoYXIgY21kLCB1MTYgd29yZCwgdWludCBuY21kcykKK3sKKwljaGFyCQkqdmFkZHIgPSBOVUxMOworCXN0cnVjdCBjbV90CSpjbV9hZGRyID0gTlVMTDsKKwl1aW50CQljb3VudDsKKwl1aW50CQluOworCXUxNgkJaGVhZDsKKwl1MTYJCXRhaWw7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyAhPSBER0FQX0NIQU5ORUxfTUFHSUMpCisJCXJldHVybjsKKworCS8qCisJICogQ2hlY2sgaWYgYm9hcmQgaXMgc3RpbGwgYWxpdmUuCisJICovCisJaWYgKGNoLT5jaF9i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wkgKiBwb2ludGVyIHRvIGxpbWl0IHRoZSBudW1iZXIgb2Ygb3V0c3RhbmRpbmcKKwkgKiBjb21tYW5kcyB0byB0aGUgRkVQLiAgIElmIHRoZSB0aW1lIHNwZW50IHdhaXRpbmcKKwkgKiBpcyBvdXRsYW5kaXNoLCBkZWNsYXJlIHRoZSBGRVAgZGVhZC4KKwkgKi8KKwlmb3IgKGNvdW50ID0gZGdhcF9jb3VudCA7OykgeworCisJCWhlYWQgPSByZWFkdygmKGNtX2FkZHItPmNtX2hlYWQpKTsKKwkJdGFpbCA9IHJlYWR3KCYoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWR3X2V4dCAtIFNlbmRzIGEgZXh0ZW5kZWQgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCisgKgorICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgorICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAorICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGdhcF9jbWR3X2V4dChzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdTE2IGNtZCwgdTE2IHdvcmQsIHVpbnQgbmNtZHMpCit7CisJY2hhcgkJKnZhZGRyID0gTlVMTDsKKwlzdHJ1Y3QgY21fdAkqY21fYWRkciA9IE5VTEw7CisJdWludAkJY291bnQ7CisJdWludAkJbjsKKwl1MTYJCWhlYWQ7CisJdTE2CQl0YWlsOworCisJaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQorCQlyZXR1cm47CisKKwkvKgorCSAqIENoZWNrIGlmIGJvYXJkIGlzIHN0aWxsIGFsaXZlLgorCSAqLworCWlmIChjaC0+Y2hfYmQtPnN0YXRlID09IEJPQVJEX0ZBSUxFRCkKKwkJcmV0dXJuOworCisJLyoKKwkgKiBNYWtlIHN1cmUgdGhlIHBvaW50ZXJzIGFyZSBpbiByYW5nZSBiZWZvcmUKKwkgKiB3cml0aW5nIHRvIHRoZSBGRVAgbWVtb3J5LgorCSAqLworCXZhZGRyID0gY2gtPmNoX2JkLT5yZV9tYXBfbWVtYmFzZTsKKwlpZiAoIXZhZGRyKQorCQlyZXR1cm47CisKKwljbV9hZGRyID0gKHN0cnVjdCBjbV90ICopICh2YWRkciArIENNREJVRik7CisJaGVhZCA9IHJlYWR3KCYoY21fYWRkci0+Y21faGVhZCkpOworCisJLyoKKwkgKiBGb3JnZXQgaXQgaWYgcG9pbnRlcnMgb3V0IG9mIHJhbmdlLgorCSAqLworCWlmIChoZWFkID49IChDTURNQVggLSBDTURTVEFSVCkgfHwgKGhlYWQgJiAwMykpIHsKKwkJY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VyIHRvIGxpbWl0IHRoZSBudW1iZXIgb2Ygb3V0c3RhbmRpbmcKKwkgKiBjb21tYW5kcyB0byB0aGUgRkVQLiAgIElmIHRoZSB0aW1lIHNwZW50IHdhaXRpbmcKKwkgKiBpcyBvdXRsYW5kaXNoLCBkZWNsYXJlIHRoZSBGRVAgZGVhZC4KKwkgKi8KKwlmb3IgKGNvdW50ID0gZGdhcF9jb3VudCA7OykgeworCisJCWhlYWQgPSByZWFkdygmKGNtX2FkZHItPmNtX2hlYWQpKTsKKwkJdGFpbCA9IHJlYWR3KCYoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF93bW92ZSAtIFdyaXRlIGRhdGEgdG8gRkVQIGJ1ZmZlci4KKyAqCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKiAgICAgICAgICAgICAgYnVmICAgICAtIFBvaXRlciB0byBjaGFyYWN0ZXJzIHRvIGJlIG1vdmVkLgorICogICAgICAgICAgICAgIGNudCAgICAgLSBOdW1iZXIgb2YgY2hhcmFjdGVycyB0byBtb3ZlLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZ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AqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIGludCBkZ2FwX3BhcmFtKHN0cnVjdCB0dHlfc3RydWN0ICp0dHkpCit7CisJc3RydWN0IGt0ZXJtaW9zICp0czsKKwlzdHJ1Y3QgYm9hcmRfdCAqYmQ7CisJc3RydWN0IGNoYW5uZWxfdCAqY2g7CisJc3RydWN0IGJzX3QgICAqYnM7CisJc3RydWN0IHVuX3QgICAqdW47CisJdTE2CWhlYWQ7CisJdTE2CWNmbGFnOworCXUxNglpZmxhZzsKKwl1Y2hhcgltdmFsOworCXVjaGFyCWhmbG93OworCisJaWYgKCF0dHkgfHwgdHR5LT5tYWdpYyAhPSBUVFlfTUFHSUMpCisJCXJldHVybiAtRU5YSU87CisKKwl1biA9IChzdHJ1Y3QgdW5fdCAqKSB0dHktPmRyaXZlcl9kYXRhOworCWlmICghdW4gfHwgdW4tPm1hZ2ljICE9IERHQVBfVU5JVF9NQUdJQykKKwkJcmV0dXJuIC1FTlhJTzsKKworCWNoID0gdW4tPnVuX2NoOworCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUdJQykKKwkJcmV0dXJuIC1FTlhJTzsKKworCWJkID0gY2gtPmNoX2JkOworCWlmICghYmQgfHwgYmQtPm1hZ2ljICE9IERHQVBfQk9BUkRfTUFHSUMpCisJCXJldHVybiAtRU5YSU87CisKKwlicyA9IGNoLT5jaF9iczsKKwlpZiAoIWJzKQorCQlyZXR1cm4gLUVOWElPOworCisJdHMgPSAmdHR5LT50ZXJtaW9zOworCisJLyoKKwkgKiBJZiBiYXVkIHJhdGUgaXMgemVybywgZmx1c2ggcXVldWVzLCBhbmQgc2V0IG12YWwgdG8gZHJvcCBEVFIuCisJICovCisJaWYgKChjaC0+Y2hfY19jZmxhZyAmIChDQkFVRCkpID09IDApIHsKKworCQkvKiBmbHVzaCByeCAqLworCQloZ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yAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZiBfX0RHQVBfRFJJVkVSX0gKKyNkZWZpbmUgX19ER0FQX0RSSVZFUl9ICisKKyNpbmNsdWRlIDxsaW51eC90eXBlcy5oPiAgICAgICAgLyogVG8gcGljayB1cCB0aGUgdmFyaW9ucyBMaW51eCB0eXBlcyAqLworI2luY2x1ZGUgPGxpbnV4L3R0eS5oPiAgICAgICAgICAvKiBUbyBwaWNrIHVwIHRoZSB2YXJpb3VzIHR0eSBzdHJ1Y3RzL2RlZmluZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4gICAgLyogRm9yIGlycXJldHVybl90IHR5cGUgKi8KKworI2lmbmRlZiBUUlVFCisjIGRlZmluZSBUUlVFIDEKKyNlbmRpZgorCisjaWZuZGVmIEZBTFNFCisjIGRlZmluZSBGQUxTRSAwCisjZW5kaWYKKworLyogUmVxdWlyZWQgZm9yIG91ciBzaGFyZWQgaGVhZGVycyEgKi8KK3R5cGVkZWYgdW5zaWduZWQgY2hhcgkJdWNoYXI7CisKKyNpZiAhZGVmaW5lZChUVFlfRkxJUEJVRl9TSVpFKQorIyBkZWZpbmUgVFRZX0ZMSVBCVUZfU0laRSA1MTIKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIERyaXZlciBkZWZpbmVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBEcml2ZXIgaWRlbnRpZmljYXRpb24KKyAqLworI2RlZmluZQlER19OQU1FCQkiZGdhcC0xLjMtMTYiCisjZGVmaW5lCURHX1BBUlQJCSI0MDAwMjM0N19DIgorI2RlZmluZ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NSTkwgfCBJWE9OKQorI2RlZmluZQlERUZBVUxUX09GTEFHUwkoT1BPU1QgfCBPTkxDUikKKyNkZWZpbmUJREVGQVVMVF9DRkxBR1MJKEI5NjAwIHwgQ1M4IHwgQ1JFQUQgfCBIVVBDTCB8IENMT0NBTCkKKyNkZWZpbmUJREVGQVVMVF9MRkxBR1MJKElTSUcgfCBJQ0FOT04gfCBFQ0hPIHwgRUNIT0UgfCBFQ0hPSyB8IFwKKwkJCUVDSE9DVEwgfCBFQ0hPS0UgfCBJRVhURU4pCisKKyNpZm5kZWYgX1BPU0lYX1ZESVNBQkxFCisjZGVmaW5lICAgX1BPU0lYX1ZESVNBQkxFICdcMCcKKyNlbmRpZgorCisjZGVmaW5lIFNOSUZGX01BWAk2NTUzNgkJLyogU25pZmYgYnVmZmVyIHNpemUgKDJebikgKi8KKyNkZWZpbmUgU05JRkZfTUFTSwkoU05JRkZfTUFYIC0gMSkJLyogU25pZmYgd3JhcCBtYXNrICovCisKKyNkZWZpbmUgVlBEU0laRSAoNTEyKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIEZFUCBtZW1vcnkgb2Zmc2V0cworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1RBUlQgICAgICAgICAgIDB4MDAwNEwgICAgICAgICAvKiBFeGVjdXRpb24gc3RhcnQgYWRkcmVzcyAgICAgICovCisKKyNkZWZpbmUgQ01EQlVGICAgICAgICAgIDB4MGQxMEwgICAgICAgICAvKiBDb21tYW5kIChjbV90KSBzdHJ1Y3R1cmUgb2Zmc2V0ICovCisjZGVmaW5lIENNRFNUQVJUICAgICAgICAweDA0MDBMICAgICAgICAgLyogU3RhcnQgb2YgY29tbWFuZCBidWZmZXIgICAgICAqLworI2RlZmluZSBDTURNQVggICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIEVuZCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICAgKi8KKworI2RlZmluZSBFVkJVRiAgICAgICAgICAgMHgwZDE4TCAgICAgICAgIC8qIEV2ZW50IChldl90KSBzdHJ1Y3R1cmUgICAgICAgKi8KKyNkZWZpbmUgRVZTVEFSVCAgICAgICAgIDB4MDgwMEwgICAgICAgICAvKiBTdGFydCBvZiBldmVudCBidWZmZXIgICAgICAgICovCisjZGVmaW5lIEVWTUFYICAgICAgICAgICAweDBjMDBMICAgICAgICAgLyogRW5kIG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgICAqLworI2RlZmluZSBGRVA1X1BMVVMgICAgICAgMHgwRTQwICAgICAgICAgIC8qIEFTQ0lJICc1JyBhbmQgQVNDSUkgJ0EnIGlzIGhlcmUgICovCisjZGVmaW5lIEVDU19TRUcgICAgICAgICAweDBFNDQgICAgICAgICAgLyogU2VnbWVudCBvZiB0aGUgZXh0ZW5kZWQgY2hhbm5lbCBzdHJ1Y3R1cmUgKi8KKyNkZWZpbmUgTElORV9TUEVFRCAgICAgIDB4MTAgICAgICAgICAgICAvKiBPZmZzZXQgaW50byBFQ1NfU0VHIGZvciBsaW5lIHNwZWVkICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZmVwIGhhcyBleHRlbmRlZCBjYXBhYmlsaXRpZXMgKi8KKworLyogQklPUyBNQUdJQyBTUE9UUyAqLworI2RlZmluZSBFUlJPUiAgICAgICAgICAgMHgwQzE0TAkJLyogQklPUyBlcnJvciBjb2RlICAgICAgICAgICAgICAqLworI2RlZmluZSBTRVFVRU5DRQkweDBDMTJMCQkvKiBCSU9TIHNlcXVlbmNlIGluZGljYXRvciAgICAgICovCisjZGVmaW5lIFBPU1RBUkVBCTB4MEMwMEwJCS8qIFBPU1QgY29tcGxldGUgbWVzc2FnZSBhcmVhICAgKi8KKworLyogRkVQIE1BR0lDIFNQT1RTICovCisjZGVmaW5lIEZFUFNUQVQgICAgICAgICBQT1NUQVJFQSAgICAgICAgLyogT1MgaGVyZSB3aGVuIEZFUCBjb21lcyB1cCAgICAqLworI2RlZmluZSBOQ0hBTiAgICAgICAgICAgMHgwQzAyTCAgICAgICAgIC8qIG51bWJlciBvZiBwb3J0cyBGRVAgc2VlcyAgICAgKi8KKyNkZWZpbmUgUEFOSUMgICAgICAgICAgIDB4MEMxMEwgICAgICAgICAvKiBQQU5JQyBhcmVhIGZvciBGRVAgICAgICAgICAgICovCisjZGVmaW5lIEtNRU1FTSAgICAgICAgICAweDBDMzBMICAgICAgICAgLyogTWVtb3J5IGZvciBLTUUgdXNlICAgICAgICAgICAqLworI2RlZmluZSBDT05GSUcgICAgICAgICAgMHgwQ0QwTCAgICAgICAgIC8qIENvbmNlbnRyYXRvciBjb25maWd1cmF0aW9uIGluZm8gKi8KKyNkZWZpbmUgQ09ORklHU0laRSAgICAgIDB4MDAzMCAgICAgICAgICAvKiBjb25maWd1cmF0aW9uIGluZm8gc2l6ZSAgICAgICovCisjZGVmaW5lIERPV05SRVEgICAgICAgICAweDBEMDAgICAgICAgICAgLyogRG93bmxvYWQgcmVxdWVzdCBidWZmZXIgcG9pbnRlciAqLworCisjZGVmaW5lIENIQU5CVUYgICAgICAgICAweDEwMDBMICAgICAgICAgLyogQXN5bmMgY2hhbm5lbCAoYnNfdCkgc3RydWN0cyAqLworI2RlZmluZSBGRVBPU1NJWkUgICAgICAgMHgxRkZGICAgICAgICAgIC8qIDhLIEZFUE9TICAgICAgICAgICAgICAgICAgICAgKi8KKworI2RlZmluZSBYRU1QT1JUUyAgICAweEMwMgkvKgorCQkJCSAqIE9mZnNldCBpbiBib2FyZCBtZW1vcnkgd2hlcmUgRkVQNSBzdG9yZXMKKwkJCQkgKiBob3cgbWFueSBwb3J0cyBpdCBoYXMgZGV0ZWN0ZWQuCisJCQkJICogTk9URTogRkVQNSByZXBvcnRzIDY0IHBvcnRzIHdoZW4gdGhlIHVzZXIKKwkJCQkgKiBoYXMgdGhlIGNhYmxlIGluIEVCSSBPVVQgaW5zdGVhZCBvZiBFQkkgSU4uCisJCQkJICovCisKKyNkZWZpbmUgRkVQQ0xSICAgICAgMHgwMAorI2RlZmluZSBGRVBNRU0gICAgICAweDAyCisjZGVmaW5lIEZFUFJTVCAgICAgIDB4MDQKKyNkZWZpbmUgRkVQSU5UICAgICAgMHgwOAorI2RlZmluZSBGRVBNQVNLICAgICAweDBlCisjZGVmaW5lIEZFUFdJTiAgICAgIDB4ODAKKworI2RlZmluZSBMT1dNRU0gICAgICAweDAxMDAKKyNkZWZpbmUgSElHSE1FTSAgICAgMHg3ZjAwCisKKyNkZWZpbmUgRkVQVElNRU9VVCAyMDAwMDAKKworI2RlZmluZSBFTkFCTEVfSU5UUgkJMHgwZTA0CQkvKiBFbmFibGUgaW50ZXJydXB0cyBmbGFnICovCisjZGVmaW5lIEZFUFBPTExfTUlOCQkxCQkvKiBtaW5pbXVtIG9mIDEgbWlsbGlzZWNvbmQgKi8KKyNkZWZpbmUgRkVQUE9MTF9NQVgJCTIwCQkvKiBtYXhpbXVtIG9mIDIwIG1pbGxpc2Vjb25kcyAqLworI2RlZmluZSBGRVBQT0xMCQkJMHgwYzI2CQkvKiBGZXAgZXZlbnQgcG9sbCBpbnRlcnZhbCAqLworCisjZGVmaW5lCUlBTFRQSU4JCQkweDAwODAJCS8qIElucHV0IGZsYWcgdG8gc3dhcCBEU1IgPC0+IERDRCAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBGRVAgc3VwcG9ydGVkIGZ1bmN0aW9ucworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1JMT1cJCTB4ZTAJCS8qIFNldCByZWNlaXZlIGxvdyB3YXRlcgkqLworI2R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9mbGFncwkJKi8KKyNkZWZpbmUgU0hGTE9XCQkweGY0CQkvKiBTZXQgaGFyZHdhcmUgaGFuZHNoYWtlCSovCisjZGVmaW5lIFNDRkxBRwkJMHhmNQkJLyogU2V0IFVOSVggY2ZsYWdzCQkqLworI2RlZmluZSBTVk5FWFQJCTB4ZjYJCS8qIFNldCBWTkVYVCBjaGFyYWN0ZXIJCSovCisjZGVmaW5lIFNQSU5URkMJCTB4ZmMJCS8qIFJlc2VydmVkCQkJKi8KKyNkZWZpbmUgU0NPTU1PREUJMHhmZAkJLyogU2V0IFJTMjMyLzQyMiBtb2RlCQkqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCU1vZGVzIGZvciBTQ09NTU9ERQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgTU9ERV8yMzIJMHgwMAorI2RlZmluZSBNT0RFXzQyMgkweDAxCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBFdmVudCBmbGFncy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIElGQlJFQUsgICAgICAgICAweDAxICAgICAgICAgICAgLyogQnJlYWsgcmVjZWl2ZWQgICAgICAgICAgICAgICAqLworI2RlZmluZSBJRlRMVyAgICAgICAgICAgMHgwMiAgICAgICAgICAgIC8qIFRyYW5zbWl0IGxvdyB3YXRlciAgICAgICAgICAgKi8KKyNkZWZpbmUgSUZURU0gICAgICAgICAgIDB4MDQgICAgICAgICAgICAvKiBUcmFuc21pdHRlciBlbXB0eSAgICAgICAgICAgICovCisjZGVmaW5lIElGREFUQSAgICAgICAgICAweDA4ICAgICAgICAgICAgLyogUmVjZWl2ZSBkYXRhIHByZXNlbnQgICAgICAgICAqLworI2RlZmluZSBJRk1PREVNICAgICAgICAgMHgyMCAgICAgICAgICAgIC8qIE1vZGVtIHN0YXR1cyBjaGFuZ2UgICAgICAgICAgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBNb2RlbSBmbGFncworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgICAgICAgZGVmaW5lICBETV9SVFMgICAgICAgICAgMHgwMiAgICAvKiBSZXF1ZXN0IHRvIHNlbmQgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fQ0QgICAgICAgICAgIDB4ODAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RTUiAgICAgICAgICAweDIwICAgIC8qIERhdGEgc2V0IHJlYWR5ICAgICAgICAgICAgICAgKi8KKyMgICAgICAgZGVmaW5lICBETV9DVFMgICAgICAgICAgMHgxMCAgICAvKiBDbGVhciB0byBzZW5kICAgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fUkkgICAgICAgICAgIDB4NDAgICAgLyogUmluZyBpbmRpY2F0b3IgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RUUiAgICAgICAgICAweDAxICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICAgICAgICAgKi8KKworLyoKKyAqIGRlZmluZXMgZnJvbSBkZ2FwX2NvbmYuaAorICovCisjZGVmaW5lIE5VTExOT0RFIDAJCS8qIGhlYWRlciBub2RlLCBub3QgdXNlZCAqLworI2RlZmluZSBCTk9ERSAxCQkJLyogQm9hcmQgbm9kZSAqLworI2RlZmluZSBMTk9ERSAyCQkJL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lORUVEX0NPTkNFTlRSQVRPUiwKKwlSRVFVRVNURURfQ09OQ0VOVFJBVE9SCit9OworCisKKworLyoKKyAqIE1vZGVtIGxpbmUgY29uc3RhbnRzIGFyZSBkZWZpbmVkIGFzIG1hY3JvcyBiZWNhdXNlIERTUiBhbmQKKyAqIERDRCBhcmUgc3dhcGFibGUgdXNpbmcgdGhlIGRpdHR5IGFsdHBpbiBvcHRpb24uCisgKi8KKyNkZWZpbmUgRF9DRChjaCkgICAgICAgIGNoLT5jaF9jZCAgICAgICAvKiBDYXJyaWVyIGRldGVjdCAgICAgICAqLworI2RlZmluZSBEX0RTUihjaCkgICAgICAgY2gtPmNoX2RzciAgICAgIC8qIERhdGEgc2V0IHJlYWR5ICAgICAgICovCisjZGVmaW5lIERfUlRTKGNoKSAgICAgICBETV9SVFMgICAgICAgICAgLyogUmVxdWVzdCB0byBzZW5kICAgICAgKi8KKyNkZWZpbmUgRF9DVFMoY2gpICAgICAgIERNX0NUUyAgICAgICAgICAvKiBDbGVhciB0byBzZW5kICAgICAgICAqLworI2RlZmluZSBEX1JJKGNoKSAgICAgICAgRE1fUkkgICAgICAgICAgIC8qIFJpbmcgaW5kaWNhdG9yICAgICAgICovCisjZGVmaW5lIERfRFRSKGNoKSAgICAgICBETV9EVFIgICAgICAgICAgLyogRGF0YSB0ZXJtaW5hbCByZWFkeSAgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFN0cnVjdHVyZXMgYW5kIGNsb3NlbHkgcmVsYXRlZCBkZWZpbmVzLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qCisgKiBBIHN0cnVjdHVyZSB0byBob2xkIGEgc3RhdGlzdGljcyBjb3VudGVyLiAgV2UgYWxzbworICogY29tcHV0ZSBtb3ZpbmcgYXZlcmFnZXMgZm9yIHRoaXMgY291bnRlci4KKyAqLworc3RydWN0IG1hY291bnRlciB7CisJdTMyCQljbnQ7CS8qIFRvdGFsIGNvdW50ICovCisJdWxvbmcJCWFjY3VtOwkvKiBBY3V1bXVsYXRvciBwZXIgcGVyaW9kICovCisJdWxvbmcJCXNtYTsJLyogU2ltcGxlIG1vdmluZyBhdmVyYWdlICovCisJdWxvbmcJCWVtYTsJLyogRXhwb25lbnRpYWwgbW92aW5nIGF2ZXJhZ2UgKi8KK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRGV2aWNlIGZsYWcgZGVmaW5pdGlvbnMgZm9yIGJkX2ZsYWdzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJQkRfRkVQNVBMVVMJMHgwMDAxICAgICAgICAgIC8qIFN1cHBvcnRzIEZFUDUgUGx1cyBjb21tYW5kcyAqLworI2RlZmluZSBCRF9IQVNfVlBECTB4MDAwMgkJLyogQm9hcmQgaGFzIFZQRCBpbmZvIGF2YWlsYWJsZSAqLworCisvKgorICoJUGVyLWJvYXJkIGluZm9ybWF0aW9uCisgKi8KK3N0cnVjdCBib2FyZF90IHsKKwlpbnQJCW1hZ2ljOwkJLyogQm9hcmQgTWFnaWMgbnVtYmVyLiAgKi8KKwlpbnQJCWJvYXJkbnVtOwkvKiBCb2FyZCBudW1iZXI6IDAtMyAqLworCWludAkJZmlyc3RtaW5vcjsJLyogRmlyc3QgbWlub3IsIGUuZy4gMCwgMzAsIDYwICovCisKKwlpbnQJCXR5cGU7CQkvKiBUeXBlIG9mIGJvYXJkICovCisJY2hhcgkJKm5hbWU7CQkvKiBQcm9kdWN0IE5hbWUgKi8KKwlzdHJ1Y3QgcGNpX2RldgkqcGRldjsJCS8qIFBvaW50ZXI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ubG9hZCAqLworfTsKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFVuaXQgZmxhZyBkZWZpbml0aW9ucyBmb3IgdW5fZmxhZ3MuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBVTl9JU09QRU4JMHgwMDAxCQkvKiBEZXZpY2UgaXMgb3BlbgkJKi8KKyNkZWZpbmUgVU5fQ0xPU0lORwkweDAwMDIJCS8qIExpbmUgaXMgYmVpbmcgY2xvc2VkCQkqLworI2RlZmluZSBVTl9JTU0JCTB4MDAwNAkJLyogU2VydmljZSBpbW1lZGlhdGVseQkJKi8KKyNkZWZpbmUgVU5fQlVTWQkJMHgwMDA4CQkvKiBTb21lIHdvcmsgdGhpcyBjaGFubmVsCSovCisjZGVmaW5lIFVOX0JSRUFLSQkweDAwMTAJCS8qIElucHV0IGJyZWFrIHJlY2VpdmVkCQkqLworI2RlZmluZSBVTl9QV0FJVAkweDAwMjAJCS8qIFByaW50ZXIgd2FpdGluZyBmb3IgdGVybWluYWwJKi8KKyNkZWZpbmUgVU5fVElNRQkJMHgwMDQwCQkvKiBXYWl0aW5nIG9uIHRpbWUJCSovCisjZGVmaW5lIFVOX0VNUFRZCTB4MDA4MAkJLyogV2FpdGluZyBvdXRwdXQgcXVldWUgZW1wdHkJKi8KKyNkZWZpbmUgVU5fTE9XCQkweDAxMDAJCS8qIFdhaXRpbmcgb3V0cHV0IGxvdyB3YXRlciBtYXJrKi8KKyNkZWZpbmUgVU5fRVhDTF9PUEVOCTB4MDIwMAkJLyogT3BlbiBmb3IgZXhjbHVzaXZlIHVzZQkqLworI2RlZmluZSBVTl9XT1BFTgkweDA0MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX1dJT0NUTAkweDA4MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX0hBTkdVUAkweDgwMDAJCS8qIENhcnJpZXIgbG9zdAkJCSovCisKK3N0cnVjdCBkZXZpY2U7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFN0cnVjdHVyZSBmb3IgdGVybWluYWwgb3IgcHJpbnRlciB1bml0LgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCB1bl90IHsKKwlpbnQJbWFnaWM7CQkvKiBVbml0IE1hZ2ljIE51bWJlci4JCQkqLworCXN0cnVjdAljaGFubmVsX3QgKnVuX2NoOworCXUzMgl1bl90aW1lOworCXUzMgl1bl90eXBlOworCXUzMgl1bl9vcGVuX2NvdW50OwkvKiBDb3VudGVyIG9mIG9wZW5zIHRvIHBvcnQJCSovCisJc3RydWN0IHR0eV9zdHJ1Y3QgKnVuX3R0eTsvKiBQb2ludGVyIHRvIHVuaXQgdHR5IHN0cnVjdHVyZQkqLworCXUzMgl1bl9mbGFnczsJLyogVW5pdCBmbGFncwkJCQkqLworCXdhaXRfcXVldWVfaGVhZF90IHVuX2ZsYWdzX3dhaXQ7IC8qIFBsYWNlIHRvIHNsZWVwIHRvIHdhaXQgb24gdW5pdCAqLworCXUzMgl1bl9kZXY7CQkvKiBNaW5vciBkZXZpY2UgbnVtYmVyCQkJKi8KKwl0Y2ZsYWdfdCB1bl9vZmxhZzsJLyogb2ZsYWdzIGJlaW5nIGRvbmUgb24gYm9hcmQJCSovCisJdGNmbGFnX3QgdW5fbGZsYWc7CS8qIGxmbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLworCXN0cnVjdCBkZXZpY2UgKnVuX3N5c2ZzOworfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBEZXZpY2UgZmxhZyBkZWZpbml0aW9ucyBmb3IgY2hfZmxhZ3MuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBDSF9QUk9OICAgICAgICAgMHgwMDAxICAgICAgICAgIC8qIFByaW50ZXIgb24gc3RyaW5nICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX09VVCAgICAgICAgICAweDAwMDIgICAgICAgICAgLyogRGlhbC1vdXQgZGV2aWNlIG9wZW4gICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfU1RPUCAgICAgICAgIDB4MDAwNCAgICAgICAgICAvKiBPdXRwdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDSF9TVE9QSSAgICAgICAgMHgwMDA4ICAgICAgICAgIC8qIElucHV0IGlzIHN0b3BwZWQgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX0NEICAgICAgICAgICAweDAwMTAgICAgICAgICAgLyogQ2FycmllciBpcyBwcmVzZW50ICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfRkNBUiAgICAgICAgIDB4MDAyMCAgICAgICAgICAvKiBDYXJyaWVyIGZvcmNlZCBvbiAgICAgICAgICAgICAgICAqLworCisjZGVmaW5lIENIX1JYQkxPQ0sgICAgICAweDAwODAgICAgICAgICAgLyogRW5hYmxlIHJ4IGJsb2NrZWQgZmxhZyAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfV0xPVyAgICAgICAgIDB4MDEwMCAgICAgICAgICAvKiBUZXJtIHdhaXRpbmcgbG93IGV2ZW50ICAgICAgICAgICAqLworI2RlZmluZSBDSF9XRU1QVFkgICAgICAgMHgwMjAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBlbXB0eSBldmVudCAgICAgICAgICovCisjZGVmaW5lIENIX1JFTkFCTEUgICAgICAweDA0MDAgICAgICAgICAgLyogQnVmZmVyIGp1c3QgZW1wdGllZCAgICAgICAgICAqLworI2RlZmluZSBDSF9SQUNUSVZFICAgICAgMHgwODAwICAgICAgICAgIC8qIFByb2Nlc3MgYWN0aXZlIGluIHh4cmVhZCgpICAgKi8KKyNkZWZpbmUgQ0hfUldBSVQgICAgICAgIDB4MTAwMCAgICAgICAgICAvKiBQcm9jZXNzIHdhaXRpbmcgaW4geHhyZWFkKCkgICovCisjZGVmaW5lIENIX0JBVUQwCTB4MjAwMAkJLyogVXNlZCBmb3IgY2hlY2tpbmcgQjAgdHJhbnNpdGlvbnMgKi8KKyNkZWZpbmUgQ0hfSEFOR1VQICAgICAgIDB4ODAwMAkJLyogSGFuZ3VwIHJlY2VpdmVkICAgICAgICAgICAgICAgICAgKi8KKworLyoKKyAqIERlZmluaXRpb25zIGZvciBjaF9zbmlmZl9mbGFncworICovCisjZGVmaW5lIFNOSUZGX09QRU4JMHgxCisjZGVmaW5lIFNOSUZGX1dBSVRfREFUQQkweDIKKyNkZWZpbmUgU05JRkZfV0FJVF9TUEFDRSAweDQKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKioqCURlZmluaXRpb25zIGZvciBEaWdpIGRpdHR5KDEpIGNvbW1hbmQuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIG1vZHVsZSBwcm92aWRlcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc3BlY2lhbCBEaWdpCisgKiBzZXJpYWwgbGluZSBlbmhhbmNlbWVudHMgd2hpY2ggYXJlIG5vdCBzdGFuZGFyZCBVTkl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I2RlZmluZSBESUdJX1JUU19UT0dHTEUJMHg4MDAwCQkvKiBTdXBwb3J0IFJUUyBUb2dnbGUJCSovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoZXNlIG9wdGlvbnMgYXJlIG5vdCBzdXBwb3J0ZWQgb24gdGhlIGNvbXhpLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJRElHSV9DT01YSQkoRElHSV9GQVNUfERJR0lfQ09PS3xEU1JQQUNFfERDRFBBQ0V8RFRSUEFDRSkKKworI2RlZmluZSBESUdJX1BMRU4JMjgJCS8qIFN0cmluZyBsZW5ndGgJCSovCisjZGVmaW5lCURJR0lfVFNJWgkxMAkJLyogVGVybWluYWwgc3RyaW5nIGxlbgkJKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RydWN0dXJlIHVzZWQgd2l0aCBpb2N0bCBjb21tYW5kcyBmb3IgRElHSSBwYXJhbWV0ZXJzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBkaWdpX3QgeworCXVuc2lnbmVkIHNob3J0CWRpZ2lfZmxhZ3M7CQkvKiBGbGFncyAoc2VlIGFib3ZlKQkqLworCXVuc2lnbmVkIHNob3J0CWRpZ2lfbWF4Y3BzOwkJLyogTWF4IHByaW50ZXIgQ1BTCSovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjaGFyOwkJLyogTWF4IGNoYXJzIGluIHByaW50IHF1ZXVlICovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9idWZzaXplOwkJLyogQnVmZmVyIHNpemUJCSovCisJdW5zaWduZWQgY2hhcglkaWdpX29ubGVuOwkJLyogTGVuZ3RoIG9mIE9OIHN0cmluZwkqLworCXVuc2lnbmVkIGNoYXIJZGlnaV9vZmZsZW47CQkvKiBMZW5ndGggb2YgT0ZGIHN0cmluZwkqLworCWNoYXIJCWRpZ2lfb25zdHJbRElHSV9QTEVOXTsJLyogUHJpbnRlciBvbiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX29mZnN0cltESUdJX1BMRU5dOwkvKiBQcmludGVyIG9mZiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX3Rlcm1bRElHSV9UU0laXTsJLyogdGVybWluYWwgc3RyaW5nCSovCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBLTUUgZGVmaW5pdGlvbnMgYW5kIHN0cnVjdHVyZXMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZQlSV19JRExFCQkwCS8qIE9wZXJhdGlvbiBjb21wbGV0ZQkJCSovCisjZGVmaW5lCVJXX1JFQUQJCTEJLyogUmVhZCBDb25jZW50cmF0b3IgTWVtb3J5CQkqLworI2RlZmluZQlSV19XUklURQkyCS8qIFdyaXRlIENvbmNlbnRyYXRvciBNZW1vcnkJCSovCisKK3N0cnVjdCByd190IHsKKwl1bnNpZ25lZCBjaGFyCXJ3X3JlcTsJCS8qIFJlcXVlc3QgdHlwZQkJCSovCisJdW5zaWduZWQgY2hhcglyd19ib2FyZDsJLyogSG9zdCBBZGFwdGVyIGJvYXJkIG51bWJlcgkqLworCXVuc2lnbmVkIGNoYXIJcndfY29uYzsJLyogQ29uY2VudHJhdG9yIG51bWJlcgkJKi8KKwl1bnNpZ25lZCBjaGFyCXJ3X3Jlc2VydmVkOwkvKiBSZXNlcnZlZCBmb3IgZXhwYW5zaW9uCSovCisJdW5z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AgNSA9IENPTVgvaSAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9jYXJkOwkvKiBDYXJkIG51bWJlciAqLworCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdG8gZ2V0IGRyaXZlciBzdGF0dXMgaW5mb3JtYXRpb24KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9kaW5mbyB7CisJdW5zaWduZWQgbG9uZwlkaW5mb19uYm9hcmRzOwkJLyogIyBib2FyZHMgY29uZmlndXJlZAkqLworCWNoYXIJCWRpbmZvX3Jlc2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KKwljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KK307CisKKyNkZWZpbmUJRElHSV9HRVRERAkoKCdkJzw8OCkgfCAyNDgpCQkvKiBnZXQgZHJpdmVyIGluZm8gICAgICAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItYm9hcmQgaW5mb3JtYXRpb24KKyAqCisgKiBwaHlzc2l6ZSBhbmQgbWVtc2l6ZSBkaWZmZXIgd2hlbiBib2FyZCBoYXMgIndpbmRvd2VkIiBtZW1vcnkKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9pbmZvIHsKKwl1bnNpZ25lZCBsb25nCWluZm9fYmRudW07CQkvKiBCb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qIGlmbGFnIGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX29mbGFnOwkJLyogb2ZsYWcgZm9yIGNoYW5uZWwgICAgICAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fbXN0YXQ7CQkvKiBtc3RhdCBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb190eF9kYXRhOwkJLyogdHhfZGF0YSBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19yeF9kYXRhOwkJLyogcnhfZGF0YSBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19oZmxvdzsJCS8qIGhmbG93IGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3Jlc2VydmVkWzhdOwkvKiBmb3IgZnV0dXJlIGV4cGFuc2lvbiAgICAqLworfTsKKworI2RlZmluZQlESUdJX0dFVFNUQVQJKCgnZCc8PDgpIHwgMjQ0KQkJLyogZ2V0IGJvYXJkIGluZm8gICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItY2hhbm5lbCBpbmZvcm1hdGlvbgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9jaCB7CisJdW5zaWduZWQgbG9uZwlpbmZvX2JkbnVtOwkJLyogQm9hcmQgbnVtYmVyICgwIGJhc2VkKSAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fY2hhbm5lbDsJCS8qIENoYW5uZWwgaW5kZXggbnVtYmVyICAgICovCisJdW5zaWduZWQgbG9uZwl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yBvbiBjaGFubmVsCSovCisJdWxvbmcJY2hfZXJyX2JyZWFrOwkJLyogQ291bnQgb2YgYnJlYWtzIG9uIGNoYW5uZWwJKi8KKwl1bG9uZwljaF9lcnJfb3ZlcnJ1bjsJCS8qIENvdW50IG9mIG92ZXJydW5zIG9uIGNoYW5uZWwJKi8KKworCXVpbnQgY2hfc25pZmZfaW47CisJdWludCBjaF9zbmlmZl9vdXQ7CisJY2hhciAqY2hfc25pZmZfYnVmOwkJLyogU25pZmYgYnVmZmVyIGZvciBwcm9jICovCisJdWxvbmcgY2hfc25pZmZfZmxhZ3M7CQkvKiBDaGFubmVsIGZsYWdzICAgICAgICAgICAgICAgICovCisJd2FpdF9xdWV1ZV9oZWFkX3QgY2hfc25pZmZfd2FpdDsKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIENvbW1hbmQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGNtX3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRXZlbnQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGV2X3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRG93bmxvYWQgYnVmZmVyIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZG93bmxkX3QgeworCXVjaGFyCWRsX3R5cGU7CQkvKiBIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICovCisJdWNoYXIJZGxfc2VxOwkJCS8qIERvd25sb2FkIHNlcXVlbmNlICAgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc3JldjsJCS8qIFNvZnR3YXJlIHJldmlzaW9uIG51bWJlciAgICAgKi8KKwl1c2hvcnQJZGxfbHJldjsJCS8qIExvdyByZXZpc2lvbiBudW1iZXIgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfaHJldjsJCS8qIEhpZ2ggcmV2aXNpb24gbnVtYmVyICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2VnOwkJCS8qIFN0YXJ0IHNlZ21lbnQgYWRkcmVzcyAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2l6ZTsJCS8qIE51bWJlciBvZiBieXRlcyB0byBkb3dubG9hZCAgKi8KKwl1Y2hhcglkbF9kYXRhWzEwMjRdOwkJLyogRG93bmxvYWQgZGF0YSAgICAgICAgICAgICAgICAqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFcgPSByZWFkIHdyaXRlICAgICAgICBSID0gcmVhZCBvbmx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIEMgPSBjaGFuZ2VkIGJ5IGNvbW1hbmRzIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFUgPSB1bmtub3duIChtYXkgYmUgY2hhbmdlZCB3L28gbm90aWNlKSAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBic190IHsKKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdHBfam1wOwkvKiBUcmFuc21pdCBwb2xsIGp1bXAJCSAqLworCXZvbGF0aWxlIHVuc2lnbm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tYXBwZWQuXG4iLAotCQkJYnJkLT5tZW1iYXNlICsgUENJX0lPX09GRlNFVCkpOwotCQlyZXR1cm4gLUVOT01FTTsKLQl9Ci0KLQlEUFJfSU5JVCgoInJlbWFwcGVkIGlvOiAweCVwICByZW1hcHBlZCBtZW06IDB4JXBcbiIsCi0JCWJyZC0+cmVfbWFwX3BvcnQsIGJyZC0+cmVfbWFwX21lbWJhc2UpKTsKLQlyZXR1cm4gMDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogRnVuY3Rpb246Ci0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0qICAgIGRnYXBfcG9sbF9oYW5kbGVyCi0qCi0qIEF1dGhvcjoKLSoKLSogICAgU2NvdHQgSCBLaWxhdQotKiAgICAgICAKLSogUGFyYW1ldGVyczoKLSoKLSogICAgZHVtbXkgLS0gaWdub3JlZCAgICAgICAgICAgICAgICAgICAgCi0qCi0qIFJldHVybiBWYWx1ZXM6Ci0qCi0qICAgIG5vbmUKLSoKLSogRGVzY3JpcHRpb246ICAgCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0qICAgIEFzIGVhY2ggdGltZXIgZXhwaXJlcywgaXQgZGV0ZXJtaW5lcyAoYSkgd2hldGhlciB0aGUgInRyYW5zbWl0IgotKiAgICB3YWl0ZXIgbmVlZHMgdG8gYmUgd29rZW4gdXAsIGFuZCAoYikgd2hldGhlciB0aGUgcG9sbGVyIG5lZWRzIHRvCi0qICAgIGJlIHJlc2NoZWR1bGVkLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBkZ2FwX3BvbGxfaGFuZGxlcih1bG9uZyBkdW1teSkKLXsKLQlpbnQgaT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KioqKioqKioqKioqKioqKioKLSAqCi0gKiBEcml2ZXIgaW5jbHVkZXMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfX0RHQVBfRFJJVkVSX0gKLSNkZWZpbmUgX19ER0FQX0RSSVZFUl9ICi0KLSNpbmNsdWRlIDxsaW51eC92ZXJzaW9uLmg+CS8qIFRvIGdldCB0aGUgY3VycmVudCBMaW51eCB2ZXJzaW9uICovCi0jaW5jbHVkZSA8bGludXgvdHlwZXMuaD4gICAgICAgIC8qIFRvIHBpY2sgdXAgdGhlIHZhcmlvbnMgTGludXggdHlwZXMgKi8KLSNpbmNsdWRlIDxsaW51eC90dHkuaD4gICAgICAgICAgLyogVG8gcGljayB1cCB0aGUgdmFyaW91cyB0dHkgc3RydWN0cy9kZWZpbmVzICovCi0jaW5jbHVkZSA8bGludXgvaW50ZXJydXB0Lmg+ICAgIC8qIEZvciBpcnFyZXR1cm5fdCB0eXBlICovCi0KLSNpbmNsdWRlICJkZ2FwX3R5cGVzLmgiICAgICAgICAgLyogQWRkaXRpb25hbCB0eXBlcyBuZWVkZWQgYnkgdGhlIERpZ2kgaGVhZGVyIGZpbGVzICovCi0jaW5jbHVkZSAiZGlnaS5oIiAgICAgICAgICAgICAgIC8qIERpZ2kgc3BlY2lmaWMgaW9jdGwgaGVhZGVyICovCi0jaW5jbHVkZSAiZGdhcF9rY29tcGF0LmgiICAgICAgIC8qIEtlcm5lbCAyLjQvMi42IGNvbXBhdCBpbmNsdWRlcyAqLwotI2luY2x1ZGUgImRnYXBfc3lzZnMuaCIJCS8qIFN1cHBvcnQgZm9yIFNZU0ZTICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRHJpdmVyIGRlZmluZXMKLSAqCi0gKioqKioqKioqK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AgICBETV9DVFMgICAgICAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgKi8KLSNkZWZpbmUgRF9SSShjaCkgICAgICAgIERNX1JJICAgICAgICAgICAvKiBSaW5nIGluZGljYXRvciAgICAgICAqLwotI2RlZmluZSBEX0RUUihjaCkgICAgICAgRE1fRFRSICAgICAgICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBTdHJ1Y3R1cmVzIGFuZCBjbG9zZWx5IHJlbGF0ZWQgZGVmaW5lcy4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKgotICogQSBzdHJ1Y3R1cmUgdG8gaG9sZCBhIHN0YXRpc3RpY3MgY291bnRlci4gIFdlIGFsc28KLSAqIGNvbXB1dGUgbW92aW5nIGF2ZXJhZ2VzIGZvciB0aGlzIGNvdW50ZXIuCi0gKi8KLXN0cnVjdCBtYWNvdW50ZXIKLXsKLQl1MzIJCWNudDsJLyogVG90YWwgY291bnQgKi8KLQl1bG9uZwkJYWNjdW07CS8qIEFjdXVtdWxhdG9yIHBlciBwZXJpb2QgKi8KLQl1bG9uZwkJc21hOwkvKiBTaW1wbGUgbW92aW5nIGF2ZXJhZ2UgKi8KLQl1bG9uZwkJZW1hOwkvKiBFeHBvbmVudGlhbCBtb3ZpbmcgYXZlcmFnZSAqLwotfTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICogRGV2aWNlIGZsYWcgZGVmaW5pdGlvbnMgZm9yIGJkX2ZsYWdzLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgdW5fdCB7Ci0JaW50CW1hZ2ljOwkJLyogVW5pdCBNYWdpYyBOdW1iZXIuCQkJKi8KLQlzdHJ1Y3QJY2hhbm5lbF90ICp1bl9jaDsKLQl1MzIJdW5fdGltZTsKLQl1MzIJdW5fdHlwZTsKLQl1MzIJdW5fb3Blbl9jb3VudDsJLyogQ291bnRlciBvZiBvcGVucyB0byBwb3J0CQkqLwotCXN0cnVjdCB0dHlfc3RydWN0ICp1bl90dHk7LyogUG9pbnRlciB0byB1bml0IHR0eSBzdHJ1Y3R1cmUJKi8KLQl1MzIJdW5fZmxhZ3M7CS8qIFVuaXQgZmxhZ3MJCQkJKi8KLQl3YWl0X3F1ZXVlX2hlYWRfdCB1bl9mbGFnc193YWl0OyAvKiBQbGFjZSB0byBzbGVlcCB0byB3YWl0IG9uIHVuaXQgKi8KLQl1MzIJdW5fZGV2OwkJLyogTWlub3IgZGV2aWNlIG51bWJlcgkJCSovCi0JdGNmbGFnX3QgdW5fb2ZsYWc7CS8qIG9mbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLwotCXRjZmxhZ190IHVuX2xmbGFnOwkvKiBsZmxhZ3MgYmVpbmcgZG9uZSBvbiBib2FyZAkJKi8KLQlzdHJ1Y3QgZGV2aWNlICp1bl9zeXNmczsKLX07Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAqIERldmljZSBmbGFnIGRlZmluaXRpb25zIGZvciBjaF9mbGFncy4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIENIX1BST04gICAgICAgICAweDAwMDEgICAgICAgICAgLyogUHJpbnRlciBvbiBzdHJpbmcgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfT1VUICAgICAgICAgIDB4MDAwMiAgICAgICAgICAvKiBEaWFsLW91dCBkZXZpY2Ugb3BlbiAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9TVE9QICAgICAgICAgMHgwMDA0ICAgICAgICAgIC8qIE91dHB1dCBpcyBzdG9wcGVkICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIENIX1NUT1BJICAgICAgICAweDAwMDggICAgICAgICAgLyogSW5wdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfQ0QgICAgICAgICAgIDB4MDAxMCAgICAgICAgICAvKiBDYXJyaWVyIGlzIHByZXNlbnQgICAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9GQ0FSICAgICAgICAgMHgwMDIwICAgICAgICAgIC8qIENhcnJpZXIgZm9yY2VkIG9uICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgQ0hfUlhCTE9DSyAgICAgIDB4MDA4MCAgICAgICAgICAvKiBFbmFibGUgcnggYmxvY2tlZCBmbGFnICAgICAgICAgICAqLwotI2RlZmluZSBDSF9XTE9XICAgICAgICAgMHgwMTAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBsb3cgZXZlbnQgICAgICAgICAgICovCi0jZGVmaW5lIENIX1dFTVBUWSAgICAgICAweDAyMDAgICAgICAgICAgLyogVGVybSB3YWl0aW5nIGVtcHR5IGV2ZW50ICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfUkVOQUJMRSAgICAgIDB4MDQwMCAgICAgICAgICAvKiBCdWZmZXIganVzdCBlbXB0aWVkICAgICAgICAgICovCi0jZGVmaW5lIENIX1JBQ1RJVkUgICAgICAweDA4MDAgICAgICAgICAgLyogUHJvY2VzcyBhY3RpdmUgaW4geHhyZWFkKCkgICAqLwotI2RlZmluZSBDSF9SV0FJVCAgICAgICAgMHgxMDAwICAgICAgICAgIC8qIFByb2Nlc3Mgd2FpdGluZyBpb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GVjbGFyZSB0aGUgRkVQIGRlYWQuCi0JICovCi0JZm9yIChjb3VudCA9IGRnYXBfY291bnQgOzspIHsKLQotCQloZWFkID0gcmVhZHcoJihjbV9hZGRyLT5jbV9oZWFkKSk7Ci0JCXRhaWwgPSByZWFkdygmKGNtX2FkZHItPmNtX3RhaWwpKTsKLQotCQluID0gKGhlYWQgLSB0YWlsKSAmIChDTURNQVggLSBDTURTVEFSVCAtIDQpOwotCi0JCWlmIChuIDw9IG5jbWRzICogc2l6ZW9mKHN0cnVjdCBjbV90KSkKLQkJCWJyZWFrOwotCi0JCWlmICgtLWNvdW50ID09IDApIHsKLQkJCURQUl9DT1JFKCgiJXM6JWQgRmFpbGluZyBib2FyZC5cbiIsX19GSUxFX18sIF9fTElORV9fKSk7Ci0JCQljaC0+Y2hfYmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOwotCQkJcmV0dXJuOwotCQl9Ci0JCXVkZWxheSgxMCk7Ci0JfQotfQotCi0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICoKLSAqICAgICAgZGdhcF9jbWR3X2V4dCAtIFNlbmRzIGEgZXh0ZW5kZWQgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAotICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nL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TUyBGT1IgQSBQQVJUSUNVTEFSCi0gKiBQVVJQT1NFLiAgU2VlIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgotICoKLSAqIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCi0gKiBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZQotICogRm91bmRhdGlvbiwgSW5jLiwgNjc1IE1hc3MgQXZlLCBDYW1icmlkZ2UsIE1BIDAyMTM5LCBVU0EuCi0gKgotICoJTk9URTogVEhJUyBJUyBBIFNIQVJFRCBIRUFERVIuIERPIE5PVCBDSEFOR0UgQ09ESU5HIFNUWUxFISEhCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAqKioJRkVQIFZlcnNpb24gNSBkZXBlbmRlbnQgZGVmaW5pdGlvbnMKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19ER0FQX0ZFUDVfSAotI2RlZmluZSBfX0RHQVBfRkVQNV9ICi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgRkVQIG1lbW9yeSBvZmZzZXRzCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZSBTVEFSVCAgICAgICAgICAgMHgwMDA0TCAgICAgICAgIC8qIEV4ZWN1dGlvbiBzdGFydCBhZGRyZXNzICAgICAgKi8KLQotI2RlZmluZSBDTURCVUYgICAgICAgICAgMHgwZDEwTCAgICAgICAgIC8qIENvbW1hbmQgKGNtX3QpIHN0cnVjdHVyZSBvZmZzZXQgKi8KLSNkZWZpbmUgQ01EU1RBUlQgICAgICAgIDB4MDQwMEwgICAgICAgICAvKiBTdGFydCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICovICAgCi0jZGVmaW5lIENNRE1BWCAgICAgICAgICAweDA4MDBMICAgICAgICAgLyogRW5kIG9mIGNvbW1hbmQgYnVmZmVyICAgICAgICAqLwotCi0jZGVmaW5lIEVWQlVGICAgICAgICAgICAweDBkMThMICAgICAgICAgLyogRXZlbnQgKGV2X3QpIHN0cnVjdHVyZSAgICAgICAqLwotI2RlZmluZSBFVlNUQVJUICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIFN0YXJ0IG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgKi8KLSNkZWZpbmUgRVZNQVggICAgICAgICAgIDB4MGMwMEwgICAgICAgICAvKiBFbmQgb2YgZXZlbnQgYnVmZmVyICAgICAgICAgICovCi0jZGVmaW5lIEZFUDVfUExVUyAgICAgICAweDBFNDAgICAgICAgICAgLyogQVNDSUkgJzUnIGFuZCBBU0NJSSAnQScgaXMgaGVyZSAgKi8KLSNkZWZpbmUgRUNTX1NFRyAgICAgICAgIDB4MEU0NCAgICAgICAgICAvKiBTZWdtZW50IG9mIHRoZSBleHRlbmRlZCBjaGFubmVsIHN0cnVjdHVyZSAqLwotI2RlZmluZSBMSU5FX1NQRUVEICAgICAgMHgxMCAgICAgICAgICAgIC8qIE9mZnNldCBpbnRvIEVDU19TRUcgZm9yIGxpbmUgc3BlZWQgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIHRoZSBmZXAgaGFzIGV4dGVuZGVkIGNhcGFiaWxpdGllcyAqLwotCi0vKiBCSU9TIE1BR0lDIFNQT1RTICovCi0jZGVmaW5lIEVSUk9SICAgICAgICAgICAweDBD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BEU1IgPC0+IERDRCAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICogQ29tbWFuZCBzdHJ1Y3R1cmUgZGVmaW5pdGlvbi4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgY21fdCB7Ci0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21faGVhZDsJLyogQ29tbWFuZCBidWZmZXIgaGVhZCBvZmZzZXQJKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV90YWlsOwkvKiBDb21tYW5kIGJ1ZmZlciB0YWlsIG9mZnNldAkqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX3N0YXJ0OwkvKiBzdGFydCBvZmZzZXQgb2YgYnVmZmVyCSovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fbWF4OwkJLyogbGFzdCBvZmZzZXQgb2YgYnVmZmVyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBFdmVudCBzdHJ1Y3R1cmUgZGVmaW5pdGlvbi4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgZXZfdCB7Ci0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfaGVhZDsJLyogQ29tbWFuZCBidWZmZXIgaGVhZCBvZmZzZXQJKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl90YWlsOwkvKiBDb21tYW5kIGJ1ZmZlciB0YWlsIG9mZnNldAkqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X3N0YXJ0OwkvKiBzdGFydCBvZmZzZXQgb2YgYnVmZmVyCSovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfbWF4OwkJLyogbGFzdCBvZmZzZXQgb2YgYnVmZmVyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBEb3dubG9hZCBidWZmZXIgc3RydWN0dXJlLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBkb3dubGRfdCB7Ci0JdWNoYXIJZGxfdHlwZTsJCS8qIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1Y2hhcglkbF9zZXE7CQkJLyogRG93bmxvYWQgc2VxdWVuY2UgICAgICAgICAgICAqLwotCXVzaG9ydAlkbF9zcmV2OwkJLyogU29mdHdhcmUgcmV2aXNpb24gbnVtYmVyICAgICAqLwotCXVzaG9ydAlkbF9scmV2OwkJLyogTG93IHJldmlzaW9uIG51bWJlciAgICAgICAgICAqLwotCXVzaG9ydAlkbF9ocmV2OwkJLyogSGlnaCByZXZpc2lvbiBudW1iZXIgICAgICAgICAqLwotCXVzaG9ydAlkbF9zZWc7CQkJLyogU3RhcnQgc2VnbWVudCBhZGRyZXNzICAgICAgICAqLwotCXVzaG9ydAlkbF9zaXplOwkJLyogTnVtYmVyIG9mIGJ5dGVzIHRvIGRvd25sb2FkICAqLwotCXVjaGFyCWRsX2RhdGFbMTAyNF07CQkvKiBEb3dubG9hZCBkYXRhICAgICAgICAgICAgICAgICovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCi0gKiAgICAgICAgVyA9IHJlYWQgd3JpdGUgICAgICAgIFIgPSByZWFkIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAotICogICAgICAgIEMgPSBjaGFuZ2VkIGJ5IGNvbW1hbmRzIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKLSAqICAgICAgICBVID0gdW5rbm93biAobWF5IGJlIGNoYW5nZWQgdy9vIG5vdGljZSkgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgYnNfdCB7Ci0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgIHRwX2ptcDsJLyogVHJhbnNtaXQgcG9sbCBqdW1wCQkgKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdGNfam1wOwkvKiBDb29rZWQgcHJvY2VkdXJlIGp1bXAJICovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgIHJpX2ptcDsJLyogTm90IGN1cnJlbnRseSB1c2VkCQkgKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgcnBfam1wOwkvKiBSZWNlaXZlIHBvbGwganVtcAkJICovCi0KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdHhfc2VnOwkvKiBXICBUeCBzZWdtZW50CSAqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0eF9oZWFkOwkvKiBXICBUeCB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ZXJzCSovCi0jZGVmaW5lIFNUTE9XCQkweGVjCQkvKiBTZXQgdHJhbnNtaXQgbG93IHdhdGVyIG1hcmsJKi8KLSNkZWZpbmUgUlBBVVNFCQkweGVlCQkvKiBQYXVzZSByZWNlaXZlCQkqLwotI2RlZmluZSBSUkVTVU1FCQkweGVmCQkvKiBSZXN1bWUgcmVjZWl2ZQkJKi8gIAotI2RlZmluZSBDSFJFU0VUCQkweGYwCQkvKiBSZXNldCBDaGFubmVsCQkqLwotI2RlZmluZSBCVUZTRVRBTEwJMHhmMgkJLyogU2V0IFR4ICYgUnggYnVmZmVyIHNpemUgYXZhaWwqLwotI2RlZmluZSBTT0ZMQUcJCTB4ZjMJCS8qIFNldCBVTklYIG9mbGFncwkJKi8KLSNkZWZpbmUgU0hGTE9XCQkweGY0CQkvKiBTZXQgaGFyZHdhcmUgaGFuZHNoYWtlCSovCi0jZGVmaW5lIFNDRkxBRwkJMHhmNQkJLyogU2V0IFVOSVggY2ZsYWdzCQkqLwotI2RlZmluZSBTVk5FWFQJCTB4ZjYJCS8qIFNldCBWTkVYVCBjaGFyYWN0ZXIJCSovCi0jZGVmaW5lIFNQSU5URkMJCTB4ZmMJCS8qIFJlc2VydmVkCQkJKi8KLSNkZWZpbmUgU0NPTU1PREUJMHhmZAkJLyogU2V0IFJTMjMyLzQyMiBtb2RlCQkqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKglNb2RlcyBmb3IgU0NPTU1PREUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIE1PREVfMjMyCTB4MDAKLSNkZWZpbmUgTU9ERV80MjIJMHgwMQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKiAgICAgIEV2ZW50IGZsYWdzLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNkZWZpbmUgSUZCUkVBSyAgICAgICAgIDB4MDEgICAgICAgICAgICAvKiBCcmVhayByZWNlaXZlZCAgICAgICAgICAgICAgICovICAKLSNkZWZpbmUgSUZUTFcgICAgICAgICAgIDB4MDIgICAgICAgICAgICAvKiBUcmFuc21pdCBsb3cgd2F0ZXIgICAgICAgICAgICovCi0jZGVmaW5lIElGVEVNICAgICAgICAgICAweDA0ICAgICAgICAgICAgLyogVHJhbnNtaXR0ZXIgZW1wdHkgICAgICAgICAgICAqLwotI2RlZmluZSBJRkRBVEEgICAgICAgICAgMHgwOCAgICAgICAgICAgIC8qIFJlY2VpdmUgZGF0YSBwcmVzZW50ICAgICAgICAgKi8KLSNkZWZpbmUgSUZNT0RFTSAgICAgICAgIDB4MjAgICAgICAgICAgICAvKiBNb2RlbSBzdGF0dXMgY2hhbmdlICAgICAgICAgICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogICAKLSAqICAgICAgTW9kZW0gZmxhZ3MKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jICAgICAgIGRlZmluZSAgRE1fUlRTICAgICAgICAgIDB4MDIgICAgLyogUmVxdWVzdCB0byBzZW5kICAgICAgICAgICAgICAqLwotIyAgICAgICBkZWZpbmUgIERNX0NEICAgICAgICAgICAweDgwICAgIC8qIENhcnJpZXIgZGV0ZWN0ICAgICAgICAgICAgICAgKi8KLSMgICAgICAgZGVmaW5lICBETV9EU1IgICAgICAgICAgMHgyMCAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAgICAgICAgICovCi0jICAgICAgIGRlZmluZSAgRE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0YWlscy4KLSAqCi0gKiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQotICogYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKLSAqIEZvdW5kYXRpb24sIEluYy4sIDY3NSBNYXNzIEF2ZSwgQ2FtYnJpZGdlLCBNQSAwMjEzOSwgVVNBLgotICoKLSAqICRJZDogZGlnaS5oLHYgMS4xIDIwMDkvMTAvMjMgMTQ6MDE6NTcgbWFya2ggRXhwICQKLSAqCi0gKglOT1RFOiBUSElTIElTIEEgU0hBUkVEIEhFQURFUi4gRE8gTk9UIENIQU5HRSBDT0RJTkcgU1RZTEUhISEKLSAqLwotCi0jaWZuZGVmIF9fRElHSV9ICi0jZGVmaW5lIF9fRElHSV9ICi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqKioJRGVmaW5pdGlvbnMgZm9yIERpZ2kgZGl0dHkoMSkgY29tbWFuZC4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoKLSAqIENvcHlyaWdodCAoYykgMTk4OC05NiBEaWdpIEludGVybmF0aW9uYWwgSW5jLiwgQWxsIFJpZ2h0cyBSZXNlcnZlZC4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBUaGlzIG1vZHVsZSBwcm92aWRlcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc3BlY2lhbCBEaWdpCi0gKiBzZXJpYWwgbGluZSBlbmhhbmNlbWVudHMgd2hpY2ggYXJlIG5vdCBzdGFuZGF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zMiBzZWxlY3RhYmxlIHBhbmVsICovCi0jZGVmaW5lIERJR0lfUlRTX1RPR0dMRQkweDgwMDAJCS8qIFN1cHBvcnQgUlRTIFRvZ2dsZQkJKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogVGhlc2Ugb3B0aW9ucyBhcmUgbm90IHN1cHBvcnRlZCBvbiB0aGUgY29teGkuCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZQlESUdJX0NPTVhJCShESUdJX0ZBU1R8RElHSV9DT09LfERTUlBBQ0V8RENEUEFDRXxEVFJQQUNFKQotCi0jZGVmaW5lIERJR0lfUExFTgkyOAkJLyogU3RyaW5nIGxlbmd0aAkJKi8KLSNkZWZpbmUJRElHSV9UU0laCTEwCQkvKiBUZXJtaW5hbCBzdHJpbmcgbGVuCQkqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBESUdJIHBhcmFtZXRlcnMuCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RydWN0IGRpZ2lfdCB7Ci0JdW5zaWduZWQgc2hvcnQJZGlnaV9mbGFnczsJCS8qIEZsYWdzIChzZWUgYWJvdmUpCSovCi0JdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjcHM7CQkvKiBNYXggcHJpbnRlciBDUFMJKi8KLQl1bnNpZ25lZCBzaG9ydAlkaWdpX21heGNoYXI7CQkvKiBNYXggY2hhcnMgaW4gcHJpbnQgcXVldWUgKi8KLQl1bnNpZ25lZCBzaG9ydAlk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TsJLyogQm9hcmQgdHlwZSAxID0gUEMvWGksCi0JCQkJCQkJICAgICAgMiA9IFBDL1htLAotCQkJCQkJCSAgICAgIDMgPSBQQy9YZSAgCi0JCQkJCQkJICAgICAgNCA9IE1DL1hpICAKLQkJCQkJCQkgICAgICA1ID0gQ09NWC9pICovCi0JdW5zaWduZWQgY2hhcglzaHJpbmtfYnVmX2NhcmQ7CS8qIENhcmQgbnVtYmVyICovCi0JCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBTdHJ1Y3R1cmUgdG8gZ2V0IGRyaXZlciBzdGF0dXMgaW5mb3JtYXRpb24KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgZGlnaV9kaW5mbyB7Ci0JdW5zaWduZWQgbG9uZwlkaW5mb19uYm9hcmRzOwkJLyogIyBib2FyZHMgY29uZmlndXJlZAkqLwotCWNoYXIJCWRpbmZvX3Jlc2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KLQljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KLX07Ci0KLSNkZWZpbmUJRElHSV9HRVRERAkoJ2QnPDw4KSB8IDI0OAkJLyogZ2V0IGRyaXZlciBpbmZvICAgICAgKi8KLSAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFN0cnVjdHVyZSB1c2VkIHdpdGggaW9jdGwgY29tbWFuZHMgZm9yIHBlci1ib2FyZCBpbmZvcm1hdGlvbgotICoKLSAqIHBoeXNzaXplIGFuZCBtZW1zaXplIGRpZmZlciB3aGVuIGJvYXJkIGhhcyAid2luZG93ZWQiIG1lbW9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sZSBiL2RyaXZlcnMvc3RhZ2luZy9nc19mcGdhYm9vdC9NYWtlZmlsZQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zNGNiNjA2Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2dzX2ZwZ2Fib290L01ha2VmaWxlCkBAIC0wLDAgKzEsNCBAQAorZ3NfZnBnYS15CSs9IGdzX2ZwZ2Fib290Lm8gaW8ubworb2JqLSQoQ09ORklHX0dTX0ZQR0FCT09UKQkrPSBnc19mcGdhLm8KKworY2NmbGFncy0kKENPTkZJR19HU19GUEdBX0RFQlVHKQk6PSAtRERFQlVHCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZ3NfZnBnYWJvb3QvUkVBRE1FIGIvZHJpdmVycy9zdGFnaW5nL2dzX2ZwZ2Fib290L1JFQURNRQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jZmE4NjI0Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2dzX2ZwZ2Fib290L1JFQURNRQpAQCAtMCwwICsxLDcxIEBACis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KK0xpbnV4IERyaXZlciBTb3VyY2UgZm9yIFhpbGlueCBGUEdBIGZpcm13YXJlIGRvd25sb2FkCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCitUQUJMRSBPRiBDT05URU5UUy4KKworMS4gIFNVTU1BUlkKKzIuICBCQUNLR1JPVU5ECiszLiAgREVTSUdOCis0LiAgSE9XIFRPIFVTRQorNS4gIFJFRkVSRU5DRQorCisxLiBTVU1NQVJZCisKKwktIERvd25sb2FkIFhpbGlueCBGUEdBIGZpcm13YXJlCisJLSBUa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lKTsKKworZXJyX291dDoKKwlyZXR1cm4gLTE7CisKK30KKworc3RhdGljIGludCBfX2luaXQgZ3NfZnBnYWJvb3RfaW5pdCh2b2lkKQoreworCWludCBlcnIsIHI7CisKKwlyID0gLTE7CisKKwlwcl9pbmZvKCJGUEdBIERPV05MT0FEIC0tLT5cbiIpOworCXByX2luZm8oImJ1aWx0IGF0ICVzIFVUQ1xuIiwgX19USU1FU1RBTVBfXyk7CisKKwlwcl9pbmZvKCJGUEdBIGltYWdlIGZpbGUgbmFtZTogJXNcbiIsIGZpbGUpOworCisJZXJyID0gaW5pdF9kcml2ZXIoKTsKKwlpZiAoZXJyICE9IDApIHsKKwkJcHJfZXJyKCJGUEdBIERSSVZFUiBJTklUIEZBSUwhIVxuIik7CisJCXJldHVybiByOworCX0KKworCWVyciA9IHhsX2luaXRfaW8oKTsKKwlpZiAoZXJyKSB7CisJCXByX2VycigiR1BJTyBJTklUIEZBSUwhIVxuIik7CisJCXIgPSAtMTsKKwkJZ290byBlcnJvdXQ7CisJfQorCisJZXJyID0gZ3NfZnBnYWJvb3QoKTsKKwlpZiAoZXJyKSB7CisJCXByX2VycigiRlBHQSBET1dOTE9BRCBGQUlMISFcbiIpOworCQlyID0gLTE7CisJCWdvdG8gZXJyb3V0OworCX0KKworCXByX2luZm8oIkZQR0EgRE9XTkxPQUQgRE9ORSA8LS0tXG4iKTsKKworCXIgPSAwOworCXJldHVybiByOworCitlcnJvdXQ6CisJZmluaXNoX2RyaXZlcigpOworCisJcmV0dXJuIHI7Cit9CisKK3N0YXRpYyB2b2lkIF9fZXhpdCBnc19mcGdhYm9vdF9leGl0KHZvaWQpCit7CisJZmluaXNoX2RyaXZlcigpOworCXByX2luZm8oIkZQR0EgaW1hZ2UgZG93bmxvYWQgbW9kdWxlIHJlbW92ZWRcbiIpOworfQorCittb2R1bGVfaW5pdChnc19mcGdhYm9vdF9pbml0KTsKK21vZHVsZV9leGl0KGdzX2ZwZ2Fib290X2V4aXQpOworCitNT0RVT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y5yW2NudF0pIHsKKwkJCXByX2Vycigibm90IGZpbmRkaW5nIGdwaW8gY2VsbC1pbmRleCAlZFxuIiwgY250KTsKKwkJCXJldHVybiAtRU5PREVWOworCQl9CisJCWNudCsrOworCX0KKwltcGM4NXh4X2dwaW9fc2V0X2RpcigwLCAweDAwMDJCRkZGLCAweDAwMDJCRkZGKTsKKwltcGM4NXh4X2dwaW9fc2V0X2RpcigxLCAweDAwMjQwMDYwLCAweDAwMjQwMDYwKTsKKworCWdidXMubmdwaW8gPSBjbnQ7CisKKwlyZXR1cm4gMDsKK30KKworCisjZWxzZQkvKiBwbGFjZWhvbGRlciBmb3IgYm9hcmRzIHdpdGggZGlmZmVyZW50IGNvbmZpZyAqLworCit2b2lkIHhsX3Byb2dyYW1fYihpbnQzMl90IGkpCit7CisJcmV0dXJuOworfQorCit2b2lkIHhsX3Jkd3JfYihpbnQzMl90IGkpCit7CisJcmV0dXJuOworfQorCit2b2lkIHhsX2NzaV9iKGludDMyX3QgaSkKK3sKKwlyZXR1cm47Cit9CisKK2ludCB4bF9nZXRfaW5pdF9iKHZvaWQpCit7CisJcmV0dXJuIC0xOworfQorCitpbnQgeGxfZ2V0X2RvbmVfYih2b2lkKQoreworCXJldHVybiAtMTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGJ5dGUwX291dCh1bnNpZ25lZCBjaGFyIGRhdGEpCit7CisJcmV0dXJuOworfQorCitzdGF0aWMgaW5saW5lIHZvaWQgYnl0ZTFfb3V0KHVuc2lnbmVkIGNoYXIgZGF0YSkKK3sKKwlyZXR1cm47Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCB4bF9jY2xrX2IoaW50MzJfdCBpKQoreworCXJldHVybjsKK30KKworLyoKKyAqIGNvbmZpZ3VyYWJsZSBwZXIgZGV2aWNlIHR5cGUgZm9yIGRpZmZlcmVudCBJL08gY29uZmlnCisgKi8KK2ludCB4bF9pbml0X2lvKHZvaWQpCit7CisJcmV0dXJuIC0xOworfQorCisjZW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AgfSwKLQl7IExJTkU2X0JJVF9QT0RTVFVESU9fVVgyLCAiUE9EU3R1ZGlvVVgyIiwgICJQT0QgU3R1ZGlvIFVYMiIsICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfUE9EWDMsICAgICAgICAgIlBPRFgzIiwgICAgICAgICAiUE9EIFgzIiwgICAgICAgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgTElORTZfQklUX1BPRFgzTElWRSwgICAgICJQT0RYM0xpdmUiLCAgICAgIlBPRCBYMyBMaXZlIiwgICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7IExJTkU2X0JJVF9QT0RYVCwgICAgICAgICAiUE9EeHQiLCAgICAgICAgICJQT0R4dCIsICAgICAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCi0JeyBMSU5FNl9CSVRfUE9EWFRMSVZFLCAgICAgIlBPRHh0TGl2ZSIsICAgICAiUE9EeHQgTGl2ZSIsICAgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAotCXsgTElORTZfQklUX1BPRFhUUFJPLCAgICAgICJQT0R4dFBybyIsICAgICAgIlBPRHh0IFBybyIsICAgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKLQl7IExJTkU2X0JJVF9UT05FUE9SVF9HWCwgICAiVG9uZVBvcnRHWCIsICAgICJUb25lUG9ydCBHWCIsICAgICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfVE9ORVBPUlRfVVgxLCAgIlRvbmVQb3J0VVgxIiwgICAiVG9uZVBvcnQgVVgxIiwgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgTElORTZfQklUX1RPTkVQT1JUX1VYMiwgICJUb25lUG9ydFVYMiIsICAgIlRvbmVQb3J0IFVYMiIsICAgICBMSU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AgICAgICAgICAgICAgbm90X3ZhbGlkID0gMDsKKz4gKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworPiArICAgICAgICAgICAgIH0gICAKKz4gKyAgICAgfQorCitBbnlib2R5IGV2ZXJ5IGhlYXJkIG9mIG1lbWNtcCBvciBiYWNtcCBhbmQgQkRBRERSX0FOWT8KKworPiArICAgICAgICAgICAgIGlmIChub3RfdmFsaWQpIHsKKz4gKyAgICAgICAgICAgICAgICAgICAgIGRldl9pbmZvKGluZm8tPmRldiwgIlZhbGlkIGJsdWV0b290aCBhZGRyZXNzIG5vdCBmb3VuZCwiCis+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzZXR0aW5nIHNvbWUgcmFuZG9tXG4iKTsKKz4gKyAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYWRkcmVzcyBpcyBub3QgdmFsaWQsIHVzZSBzb21lIHJhbmRvbSAqLworPiArICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGluZm8tPmJkX2FkZHIsIG5va2lhX291aSwgMyk7Cis+ICsgICAgICAgICAgICAgICAgICAgICBnZXRfcmFuZG9tX2J5dGVzKGluZm8tPmJkX2FkZHIgKyAzLCAzKTsKKz4gKyAgICAgICAgICAgICB9CisKKworQW5kIHdoeSBkb2VzIGV2ZXJ5IHNpbmdsZSBjaGlwIGZpcm13YXJlIGRvZXMgdGhpcyBkaWZmZXJlbnRseS4gU2VyaW91c2x5LCB0aGlzIGlzIGEgbWVzcy4KKworPiArdm9pZCBoY2lfaDRwX3BhcnNlX2Z3X2V2ZW50KHN0cnVjdCBoY2lfaDRwX2luZm8gKmluZm8sIHN0cnVjdCBza19idWZmICpza2IpCis+ICt7Cis+ICsgICAgIHN3aXRjaCAoaW5mby0+bWFuX2lkKSB7Cis+ICsgICAgIGNhc2UgSDRQX0lEX0NTUjoKKz4gKyAgICAgICAgICAgICBoY2lfaDRwX2JjNF9wYXJzZV9md19ldmVudChpbmZvLCBza2IpOwor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CkgeworCQkJCW5vdF92YWxpZCA9IDA7CisJCQkJYnJlYWs7CisJCQl9CisJCX0KKworCQlpZiAobm90X3ZhbGlkKSB7CisJCQlkZXZfaW5mbyhpbmZvLT5kZXYsICJWYWxpZCBibHVldG9vdGggYWRkcmVzcyBub3QgZm91bmQsIHNldHRpbmcgc29tZSByYW5kb21cbiIpOworCQkJLyogV2hlbiBhZGRyZXNzIGlzIG5vdCB2YWxpZCwgdXNlIHNvbWUgcmFuZG9tICovCisJCQltZW1jcHkoaW5mby0+YmRfYWRkciwgbm9raWFfb3VpLCAzKTsKKwkJCWdldF9yYW5kb21fYnl0ZXMoaW5mby0+YmRfYWRkciArIDMsIDMpOworCQl9CisKKwkJc2tiLT5kYXRhW29mZnNldCArIDddID0gaW5mby0+YmRfYWRkclswXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDZdID0gaW5mby0+YmRfYWRkclsxXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDRdID0gaW5mby0+YmRfYWRkclsyXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDBdID0gaW5mby0+YmRfYWRkclszXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDNdID0gaW5mby0+YmRfYWRkcls0XTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDJdID0gaW5mby0+YmRfYWRkcls1XTsKKwl9CisKKwlmb3IgKGNvdW50ID0gMTsgOyBjb3VudCsrKSB7CisJCUJUX0RCRygiU2VuZGluZyBmaXJtd2FyZSBjb21tYW5kICVkIiwgY291bnQpOworCQlpbml0X2NvbXBsZXRpb24oJmluZm8tPmZ3X2NvbXBsZXRpb24pOworCQlza2JfcXVldWVfdGFpbCgmaW5mby0+dHhxLCBza2IpOworCQlzcGluX2xvY2tfaXJxc2F2ZSgmaW5mby0+bG9jaywgZmxhZ3MpOworCQloY2lfaDRwX291dGIoaW5mbywgVUFSVF9JRVIsIGhjaV9oNHBfaW5iKGluZm8sIFVBUlRfSUVSKSB8CisJCQkJCQkJIFVBU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CXsKIAotLy8JCXByaW50aygic3RvcCBzY2FuIHN5bmNcbiIpOwotLy8gICAJCWdvdG8gb3V0OwotLy8gIAl9Ci0vLwlwcmludGsoIj09PT09PT1oaD09PT09PT09PT09PT09PT5pcHMgc2NhblxuIik7Ci0gICAgIAl3aGlsZSgxKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkIGluIHR3byBzaXR1YXRpb25zCi0gICAgICAgICAgICAgICAgICogMS0gV2UgaGF2ZSBzd2l0Y2hlZCB0byBhZC1ob2MgbW9kZSBhbmQgd2UgYXJlCi0gICAgICAgICAgICAgICAgICogICAgcGVyZm9ybWluZyBhIGNvbXBsZXRlIHN5bmNybyBzY2FuIGJlZm9yZSBjb25jbHVkZQotICAgICAgICAgICAgICAgICAqICAgIHRoZXJlIGFyZSBubyBpbnRlcmVzdGluZyBjZWxsIGFuZCB0byBjcmVhdGUgYQotICAgICAgICAgICAgICAgICAqICAgIG5ldyBvbmUuIEluIHRoaXMgY2FzZSB0aGUgbGluayBzdGF0ZSBpcwotICAgICAgICAgICAgICAgICAqICAgIElFRUU4MDIxMV9OT0xJTksgdW50aWwgd2UgZm91bmQgYW4gaW50ZXJlc3RpbmcgY2VsbC4KLSAgICAgICAgICAgICAgICAgKiAgICBJZiBzbyB0aGUgaWVlZTgwMjFfbmV3X25ldCwgY2FsbGVkIGJ5IHRoZSBSWCBwYXRoCi0gICAgICAgICAgICAgICAgICogICAgd2lsbCBzZXQgdGhlIHN0YXRlIHRvIElFRUU4MDIxMV9MSU5LRUQsIHNvIHdlIHN0b3AKLSAgICAgICAgICAgICAgICAgKiAgICBzY2FubmluZwotICAgICAgICAgICAgICAgICAqIDItIFdlIGFyZSBsaW5rZWQgYW5kIHRoZSByb290IHVzZXMgcnVuIGl3bGlzdCBzY2FuLgotICAgICAgICAgICAgICAgICAqICAgIFNvIHdlIHN3aXRjaCB0byBJRUVFODAyMTFfTElOS0VEX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mICovCiAJY2FuY2VsX2RlbGF5ZWRfd29yaygmaWVlZS0+R1BJT0NoYW5nZVJGV29ya0l0ZW0pOwogCiAJZGVzdHJveV93b3JrcXVldWUoaWVlZS0+d3EpOwpAQCAtMjYwNywyMiArMjMzNiwxNiBAQAogCXVwKCZpZWVlLT53eF9zZW0pOwogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFN0YXJ0IG9mIFdQQSBjb2RlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogdGhpcyBpcyBzdG9sZW4gZnJvbSB0aGUgaXB3MjIwMCBkcml2ZXIgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQorLyogU3RhcnQgb2YgV1BBIGNvZGUuIFRoaXMgaXMgc3RvbGVuIGZyb20gdGhlIGlwdzIyMDAgZHJpdmVyICAqLwogc3RhdGljIGludCBpZWVlODAyMTFfd3BhX2VuYWJsZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgaW50IHZhbHVlKQogewogCS8qIFRoaXMgaXMgY2FsbGVkIHdoZW4gd3BhX3N1cHBsaWNhbnQgbG9hZHMgYW5kIGNsb3NlcyB0aGUgZHJpdmVyCiAJICogaW50ZXJmYWNlLiAqLwotCXByaW50aygiJXMgV1BBXG4iLHZhbHVlID8gImVuYWJsaW5nIiA6ICJkaXNhYmxpbmciKTsKKwlwcmludGsoIiVzIFdQQVxuIiwgdmFsdWUgPyAiZW5hYmxpbmciIDogImRpc2FibGluZyIpOwogCWllZWUtPndwYV9lbmFibGVkID0gdmFsdWU7CiAJcmV0dXJuIDA7CiB9CiAKLQogc3RhdGljIHZvaWQgaWVlZTgwMjExX3dwYV9hc3NvY19mcmFtZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgY2hhciAqd3BhX2ll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ib29sIGJfYnVzeV90cmFmZmljOyAvKiB3aGVuIGl0IGlzIHNldCB0byAxLCBVSSBjYW5uJ3Qgc2NhbiBhdCB3aWxsLiAqLworfTsKIAotCXU4CQkJCUlkbGVDb3VudDsgICAgIC8vIChLRUVQX0FMSVZFX0lOVEVSVkFMIC8gQ0hFQ0tfRk9SX0hBTkdfUEVSSU9EKQotCXUzMgkJCQlMYXN0TnVtVHhVbmljYXN0OwotCXUzMgkJCQlMYXN0TnVtUnhVbmljYXN0OworLyogWUosbW9kaWZpZWQsMDgwODI4LGVuZCAqLwogCi0JYm9vbAkJCQliQnVzeVRyYWZmaWM7ICAgIC8vd2hlbiBpdCBpcyBzZXQgdG8gMSwgVUkgY2Fubid0IHNjYW4gYXQgd2lsbC4KLX1saW5rX2RldGVjdF90LCAqcGxpbmtfZGV0ZWN0X3Q7CisvKiBieSBhbXkgZm9yIGxlZAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExFRCBjdXN0b21pemF0aW9uLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworZW51bSBsZWRfc3RyYXRlZ3lfODE4NSB7CisJU1dfTEVEX01PREUwLAorCVNXX0xFRF9NT0RFMSwKKwlIV19MRUQsIC8qIEhXIGNvbnRyb2wgMiBMRURzLCBMRUQwIGFuZCBMRUQxICh0aGVyZSBhcmUgNCBkaWZmZXJlbnQKKwkJICogY29udHJvbCBtb2RlcykuICovCit9OwogCi0vL1lKLG1vZGlmaWVkLDA4MDgyOCxlbmQKK2VudW0gcnRfcmZfcG93ZXJfc3RhdGUgeworCVJGX09OLAorCVJGX1NMRUVQLAorCVJGX09GRgorfTsKIAotLy9ieSBhbXkgZm9yIGxlZAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLy8gTEVEIGN1c3RvbWl6YXRpb24uCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CitlbnVtIF9SZWFzb25Db2RlIHsKKwl1bnNwZWNfcmVhc29uID0gMHgxLAorCWF1dGhfbm90X3ZhbGlkID0gMHgyLAorCWRlYXV0aF9sdl9zcyA9IDB4MywKKwlpbmFjdGl2aXR5ID0gMHg0LAorCWFwX292ZXJsb2FkID0gMHg1LAorCWNsYXNzMl9lcnIgPSAweDYsCisJY2xhc3MzX2VyciA9IDB4NywKKwlkaXNhc19sdl9zcyA9IDB4OCwKKwlhc29jX25vdF9hdXRoID0gMHg5LAogCi10eXBlZGVmCWVudW0gX0xFRF9TVFJBVEVHWV84MTg1ewotCVNXX0xFRF9NT0RFMCwgLy8KLQlTV19MRURfTU9ERTEsIC8vCi0JSFdfTEVELCAvLyBIVyBjb250cm9sIDIgTEVEcywgTEVEMCBhbmQgTEVEMSAodGhlcmUgYXJlIDQgZGlmZmVyZW50IGNvbnRyb2wgbW9kZXMpCi19TEVEX1NUUkFURUdZXzgxODUsICpQTEVEX1NUUkFURUdZXzgxODU7Ci0vL2J5IGFteSBmb3IgbGVkCi0vL2J5IGFteSBmb3IgcG93ZXIgc2F2ZQotdHlwZWRlZgllbnVtIF9MRURfQ1RMX01PREV7Ci0JTEVEX0NUTF9QT1dFUl9PTiA9IDEsCi0JTEVEX0NUTF9MSU5LID0gMiwKLQlMRURfQ1RMX05PX0xJTksgPSAzLAotCUxFRF9DVExfVFggPSA0LAotCUxFRF9DVExfUlggPSA1LAotCUxFRF9DVExfU0lURV9TVVJWRVkgPSA2LAotCUxFRF9DVExfUE9XRVJfT0ZGID0gNwotfUxFRF9DVExfTU9ERTsKKwkvKiAtLS0tTUlDX0NIRUNLICovCisJbWljX2ZhaWx1cmUgPSAweGUsCisJLyog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GFsaXZlCi0JdTggICAgICBrZWVwQWxpdmVMZXZlbDsgLy9ZSixhZGQsMDgwODI4LGZvciBLZWVwQWxpdmUKLQl1bnNpZ25lZCBsb25nIAlOdW1UeE9rVG90YWw7Ci0JdTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJldHJ5Q250OwotICAgICAgICB1MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJldHJ5UmF0ZTsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgICAgICBMYXN0VHhva0NudDsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgTGFzdFJ4b2tDbnQ7Ci0gICAgICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyUmV0cnlDbnQ7Ci0gICAgICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIExhc3RUeE9LQnl0ZXM7Ci0JdW5zaWduZWQgbG9uZyAJCSAgICBOdW1UeE9rQnl0ZXNUb3RhbDsKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgIExhc3RGYWlsVHhSYXRlOwotICAgICAgICBsb25nICAgICAgICAgICAgICAgICAgICAgICAgTGFzdEZhaWxUeFJhdGVTUzsKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgIEZhaWxUeFJhdGVDb3VudDsKLSAgICAgICAgdTMyICAgICAgICAgICAgICAgICAgICAgICAgIExhc3RUeFRocm91Z2hwdXQ7Ci0gICAgICAgIC8vZm9yIHVwIHJhdGUKLSAgICAgICAgdW5zaWduZWQgc2hvcnQgICAgICAgICAgYlRyeXVwaW5nOwotICAgICAgICB1OCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3VyclR4UmF0ZTsgICAgIC8vdGhlIHJhdGUgYmVmb3JlIHVwCi0gICAgICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyUmV0c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QX1gyNQkweDA4MDUJCS8qIENDSVRUIFguMjUJCQkqLwotI2RlZmluZSBFVEhfUF9BUlAJMHgwODA2CQkvKiBBZGRyZXNzIFJlc29sdXRpb24gcGFja2V0CSovCi0jZGVmaW5lCUVUSF9QX0JQUQkweDA4RkYJCS8qIEc4QlBRIEFYLjI1IEV0aGVybmV0IFBhY2tldCAgKi8KLSNkZWZpbmUgRVRIX1BfSUVFRVBVUAkweDBhMDAJCS8qIFhlcm94IElFRUU4MDIuMyBQVVAgcGFja2V0ICAgKi8KLSNkZWZpbmUgRVRIX1BfSUVFRVBVUEFUCTB4MGEwMQkJLyogWGVyb3ggSUVFRTgwMi4zIFBVUAkJKi8KLSNkZWZpbmUgRVRIX1BfREVDICAgICAgIDB4NjAwMCAgICAgICAgICAvKiBERUMgQXNzaWduZWQgcHJvdG8gICAgICAgICAgICovCi0jZGVmaW5lIEVUSF9QX0ROQV9ETCAgICAweDYwMDEgICAgICAgICAgLyogREVDIEROQSBEdW1wL0xvYWQgICAgICAgICAgICAqLwotI2RlZmluZSBFVEhfUF9ETkFfUkMgICAgMHg2MDAyICAgICAgICAgIC8qIERFQyBETkEgUmVtb3RlIENvbnNvbGUgICAgICAgKi8KLSNkZWZpbmUgRVRIX1BfRE5BX1JUICAgIDB4NjAwMyAgICAgICAgICAvKiBERUMgRE5BIFJvdXRpbmcgICAgICAgICAgICAgICovCi0jZGVmaW5lIEVUSF9QX0xBVCAgICAgICAweDYwMDQgICAgICAgICAgLyogREVDIExBVCAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBFVEhfUF9ESUFHICAgICAgMHg2MDA1ICAgICAgICAgIC8qIERFQyBEaWFnbm9zdGljcyAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgRVRIX1BfQ1VTVCAgICAgIDB4NjAwNiAgICAgICAgICAvKiBERUMgQ3VzdG9tZXIgdXNlICAgICAgICAgICAgICovCi0jZGVmaW5lIEVUSF9QX1NDQSAgICAgICAweDYwMDcgICAgIC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AgICBcCi0gICAoeSkgID0gdSBeIHYgXiB3OyAgICAgICAgXAotICAgKHkpIF49IHJvdHIodSBeIHQsICA4KSBeIFwKLQkgIHJvdHIodiBeIHQsIDE2KSBeIFwKLQkgIHJvdHIodCwyNCkKLQotLyogaW5pdGlhbGlzZSB0aGUga2V5IHNjaGVkdWxlIGZyb20gdGhlIHVzZXIgc3VwcGxpZWQga2V5ICovCi0KLSNkZWZpbmUgbG9vcDQoaSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi17ICAgdCA9IHJvdHIodCwgIDgpOyB0ID0gbHNfYm94KHQpIF4gcmNvX3RhYltpXTsgICAgXAotICAgIHQgXj0gRV9LRVlbNCAqIGldOyAgICAgRV9LRVlbNCAqIGkgKyA0XSA9IHQ7ICAgIFwKLSAgICB0IF49IEVfS0VZWzQgKiBpICsgMV07IEVfS0VZWzQgKiBpICsgNV0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs0ICogaSArIDJdOyBFX0tFWVs0ICogaSArIDZdID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNCAqIGkgKyAzXTsgRV9LRVlbNCAqIGkgKyA3XSA9IHQ7ICAgIFwKLX0KLQotI2RlZmluZSBsb29wNihpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLXsgICB0ID0gcm90cih0LCAgOCk7IHQgPSBsc19ib3godCkgXiByY29fdGFiW2ldOyAgICBcCi0gICAgdCBePSBFX0tFWVs2ICogaV07ICAgICBFX0tFWVs2ICogaSArIDZdID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNiAqIGkgKyAxXTsgRV9LRVlbNiAqIGkgKyA3XSA9IHQ7ICAgIFwKLSAgICB0IF49IEVfS0VZWzYgKiBpICsgMl07IEVfS0VZWzYgKiBpICsgOF0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs2ICogaSArIDNdOyBFX0tFWVs2ICogaSArIDldID0gdDsgICAgXAotICAgIHQgXj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kJCXBCQSAgLy9CQSBlbnRyeSB0byBiZSBkaXNhYmxlZAogICogIG91dHB1dDogIG5vbmUKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBEZUFjdGl2YXRlQkFFbnRyeSggc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBCQV9SRUNPUkQgcEJBKQorc3RhdGljIHZvaWQgRGVBY3RpdmF0ZUJBRW50cnkoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBCQV9SRUNPUkQgcEJBKQogewogCXBCQS0+YlZhbGlkID0gZmFsc2U7CiAJZGVsX3RpbWVyX3N5bmMoJnBCQS0+VGltZXIpOwpAQCAtMzcsNyArMzcsNyBAQAogICogIG91dHB1dDogIG5vbmUKICAqICBub3RpY2U6ICBBcyBQVFhfVFNfUkVDT1JEIHN0cnVjdHVyZSB3aWxsIGJlIGRlZmluZWQgaW4gUU9TLCBzbyB3YWl0IHRvIGJlIG1lcmdlZC4gLy9GSVhNRQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi11OCBUeFRzRGVsZXRlQkEoIHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBQVFhfVFNfUkVDT1JECXBUeFRzKQorc3RhdGljIHU4IFR4VHNEZWxldGVCQShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgUFRYX1RTX1JFQ09SRCBwVHhUcykKIHsKIAlQQkFfUkVDT1JECQlwQWRtaXR0ZWRCYSA9ICZwVHhUcy0+VHhBZG1pdHRlZEJBUmVjb3JkOyAgLy9UaGVzZSB0d28gQkEgZW50cmllcyBtdXN0IGV4aXN0IGluIFRTIHN0cnVjdHVyZQogCVBCQV9SRUNPUkQJCXBQZW5kaW5nQmEgPSAmcFR4VHMtPlR4UGVuZGluZ0JBUmVjb3JkOwpAQCAtNjcsNyArNjcsNyBAQAogICogIG91dHB1dDogIG5vbmUKICAqICBub3RpY2U6ICBBcyBQUlhfVFNfUkVDT1JEIHN0cnVjdHVyZSB3aWxsIGJlIGRlZmluZWQgaW4gUU9TLCBzbyB3YWl0IHRvIGJlIG1lcmdlZC4gLy9GSVhNRSwgc2FtZSB3aXRoIGFib3ZlCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXU4IFJ4VHNEZWxldGVCQSggc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBSWF9UU19SRUNPUkQJcFJ4VHMpCitzdGF0aWMgdTggUnhUc0RlbGV0ZUJBKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBQUlhfVFNfUkVDT1JEIHBSeFRzKQogewogCVBCQV9SRUNPUkQJCXBCYSA9ICZwUnhUcy0+UnhBZG1pdHRlZEJBUmVjb3JkOwogCXU4CQkJYlNlbmRERUxCQSA9IGZhbHNlOwpAQCAtMzA3LDcgKzMwNyw5IEBACiAgKiAgbm90aWNlOiBJZiBhbnkgcG9zc2libGUsIHBsZWFzZSBoaWRlIHBCQSBpbiBpZWVlLiBBbmQgdGVtcG9yYXJpbHkgdXNlIE1hbmFnZSBRdWV1ZSBhcyBzb2Z0bWFjX21nbXRfeG1pdCgpIHVzdWFsbHkgZG9lcwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLXZvaWQgaWVlZTgw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WVlZSwgdTggKlBlZXJNYWNBZGRyKQorc3RhdGljIGJvb2wgSFRJT1RBY3RJc0Rpc2FibGVNQ1NUd29TcGF0aWFsU3RyZWFtKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLAorCQkJCQkJIHU4ICpQZWVyTWFjQWRkcikKIHsKIAlib29sIHJldFZhbHVlID0gZmFsc2U7CiAKQEAgLTQ4Niw3ICs0ODcsOCBAQAogICogIG91dHB1dDogIG5vbmUKICAqICByZXR1cm46ICByZXR1cm4gMSBpZiBkcml2ZXIgc2hvdWxkIGRpc2FibGUgRURDQSB0dXJibyBtb2RlKG90aGVyd2lzZSByZXR1cm4gMCkKICAgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXU4IEhUSU9UQWN0SXNEaXNhYmxlRURDQVR1cmJvKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCB1OCAqUGVlck1hY0FkZHIpCitzdGF0aWMgdTggSFRJT1RBY3RJc0Rpc2FibGVFRENBVHVyYm8oc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsCisJCQkJICAgICB1OCAqUGVlck1hY0FkZHIpCiB7CiAJdTgJcmV0VmFsdWUgPSBmYWxzZTsJLy8gZGVmYXVsdCBlbmFibGUgRURDQSBUdXJibyBtb2RlLgogCS8vIFNldCBzcGVjaWZpYyBFRENBIHBhcmFtZXRlciBmb3IgZGlmZmVyZW50IEFQIGluIERNIGhhbmRsZXIuCkBAIC01MDAsNyArNTAyLDcgQEAKICAqICBvdXRwdXQ6ICBub25lCiAgKiAgcmV0dXJuOiAgcmV0dXJuIDEgaWYgdHJ1ZQogICAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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HlldAogCS8vIFRoaXMgaXMgdXNlZCBmb3IgV01NU0EgYW5kIEFDTS4KQEAgLTIyLDcgKzIyLDcgQEAKICAqICByZXR1cm46ICBOVUxMCiAgKiAgbm90aWNlOgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFJ4UGt0UGVuZGluZ1RpbWVvdXQodW5zaWduZWQgbG9uZyBkYXRhKQorc3RhdGljIHZvaWQgUnhQa3RQZW5kaW5nVGltZW91dCh1bnNpZ25lZCBsb25nIGRhdGEpCiB7CiAJUFJYX1RTX1JFQ09SRAlwUnhUcyA9IChQUlhfVFNfUkVDT1JEKWRhdGE7CiAJc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUgPSBjb250YWluZXJfb2YocFJ4VHMsIHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlLCBSeFRzUmVjb3JkW3BSeFRzLT5udW1dKTsKQEAgLTk5LDcgKzk5LDcgQEAKICAqICByZXR1cm46ICBOVUxMCiAgKiAgbm90aWNlOgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFRzQWRkQmFQcm9jZXNzKHVuc2lnbmVkIGxvbmcgZGF0YSkKK3N0YXRpYyB2b2lkIFRzQWRkQmFQcm9jZXNzKHVuc2lnbmVkIGxvbmcgZGF0YSkKIHsKIAlQVFhfVFNfUkVDT1JECXBUeFRzID0gKFBUWF9UU19SRUNPUkQpZGF0YTsKIAl1OCBudW0gPSBwVHhUcy0+bnVtOwpAQCAtMTEwLDcgKzExMCw3IEBACiB9CiAKIAotdm9pZCBSZXNldFRzQ29tbW9uSW5mbyhQVFNfQ09NTU9OX0lORk8J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S0tLQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBydGw4MTkyX3BoeV9SRlNlcmlhbFdyaXRlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCi0JCQkgICAgICAgUkY5MF9SQURJT19QQVRIX0UgZVJGUGF0aCwgdTMyIG9mZnNldCwgdTMyIGRhdGEpCitzdGF0aWMgdm9pZCBydGw4MTkyX3BoeV9SRlNlcmlhbFdyaXRlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsCisJCQkJICAgICAgUkY5MF9SQURJT19QQVRIX0UgZVJGUGF0aCwgdTMyIG9mZnNldCwKKwkJCQkgICAgICB1MzIgZGF0YSkKIHsKIAlzdHJ1Y3QgcjgxOTJfcHJpdiAqcHJpdiA9IGllZWU4MDIxMV9wcml2KGRldik7CiAJdTMyIERhdGFBbmRBZGRyID0gMCwgbmV3X29mZnNldCA9IDA7CkBAIC01NzEsNyArNTcyLDcgQEAKICAqIG5vdGljZTogICAgSW5pdGlhbGl6YXRpb24gdmFsdWUgaGVyZSBpcyBjb25zdGFudCBhbmQgaXQgc2hvdWxkIG5ldmVyCiAgKiAgICAgICAgICAgIGJlIGNoYW5nZWQKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgcnRsODE5Ml9Jbml0QkJSRlJlZ0RlZihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQorc3RhdGljIHZvaWQgcnRsODE5Ml9Jbml0QkJSRlJlZ0RlZihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewogCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gaWVlZTgwMjExX3ByaXYoZGV2KTsKIApAQCAtNzgwLDcgKzc4MSw3IEBACiAgKiBub3RpY2U6ICAgIEluaXRpYWxpemF0aW9uIHZhb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YjEwNTRfc2V0X3JlZ2lzdGVyKHBvcnQsUEFHRV80LFNCMTA1WF9SVFIscnRyW3BvcnQtPmxpbmVdKTsgCi0JYWZyX3N0YXR1cyA9IHNiMTA1NF9nZXRfcmVnaXN0ZXIocG9ydCwgUEFHRV80LCBTQjEwNVhfQUZSKTsKLQkJCi0JcmV0dXJuIGFmcl9zdGF0dXM7Ci19Ci0KLXN0YXRpYyBpbnQgZ2V0X2RldmljZV90eXBlKGludCBhcmcpCi17Ci0JaW50IHJldDsKLSAgICAgICAgcmV0ID0gaW5iKG1wX2RldnNbYXJnXS5vcHRpb25fcmVnX2FkZHIrTVBfT1BUUl9ESVIwKTsKLSAgICAgICAgcmV0ID0gKHJldCAmIDB4ZjApID4+IDQ7Ci0gICAgICAgIHN3aXRjaCAocmV0KQotICAgICAgICB7Ci0gICAgICAgICAgICAgICBjYXNlIERJUl9VQVJUXzE2QzU1MDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfMTZDNTVYOwotICAgICAgICAgICAgICAgY2FzZSBESVJfVUFSVF8xNkMxMDUwOgotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUE9SVF8xNkMxMDVYOwotICAgICAgICAgICAgICAgY2FzZSBESVJfVUFSVF8xNkMxMDUwQToKLSAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICBpZiAobXRwdC0+cG9ydC5saW5lIDwgMikKLSAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfMTZDMTA1WEE7Ci0gICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgaWYgKG10cHQtPmRldmljZS0+ZGV2aWNlX2lkICYgMHg1MCkKLSAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQT1JUXzE2QzU1WDsKLSAgICAgICAgICAgICAgICAgICB9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i0JCXsKLQkJCWZjcl9hcnJbaV0gPSAweDAxOwotCQkJCi0JCX0KLQl9Ci0JaWYoZGVlcF9jb3VudD09MCkKLQl7Ci0JCWZvcihpPTA7aTwyNTY7aSsrKQotCQl7Ci0JCQlkZWVwW2ldID0gMTsKLQkJCQotCQl9Ci0JfQotCWlmKHJ0cl9jb3VudD09MCkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGZvcihpPTA7aTwyNTY7aSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJ0cltpXSA9IDB4MTA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0JaWYodHRyX2NvdW50PT0wKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yKGk9MDtpPDI1NjtpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdHRyW2ldID0gMHgzODsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi1wcmludGsoIk1VTFRJIElOSVRcbiIpOwotCWZvciggaT0wOyBpPCBtcF9ucnBjaWJyZHM7IGkrKykKLQl7Ci0KLQkJd2hpbGUoIChkZXYgPSBwY2lfZ2V0X2RldmljZShtcF9wY2lib2FyZHNbaV0udmVuZG9yX2lkLCBtcF9wY2lib2FyZHNbaV0uZGV2aWNlX2lkLCBkZXYpICkgKQotCi0JCXsKLXByaW50aygiRk9VTkR+fn5cbiIpOwotLy8JQ2VudCBPUyBidWcgZml4Ci0vLwkJCWlmIChtcF9wY2lib2FyZHNbaV0uZGV2aWNlX2lkICYgMHgwODAwKQotCQkJewotCQkJCWludCBzdGF0dXM7Ci0JICAgICAgICAJCXBjaV9kaXNhYmxlX2RldmljZShkZXYpOwotCSAgICAgICAgCQlzdGF0dXMgPSBwY2lfZW5hYmxlX2RldmljZShkZXYpOwotICAgICAgICAgICAgCi0JICAgCQkgICAgIAlpZiAoc3RhdHVzICE9IDApCi0gICAgICAgIAkJCXsgCi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A9IDM4NDAwOyAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjE5MjAwICAgICA6IGJhdWQgPSAxOTIwMDsgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI5NjAwICAgICAgOiBiYXVkID0gOTYwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNDgwMCAgICAgIDogYmF1ZCA9IDQ4MDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjI0MDAgICAgICA6IGJhdWQgPSAyNDAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxODAwICAgICAgOiBiYXVkID0gMTgwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTIwMCAgICAgIDogYmF1ZCA9IDEyMDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjYwMCAgICAgICA6IGJhdWQgPSA2MDA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIzMDAgICAgICAgOiBiYXVkID0gMzAwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQjIwMCAgICAgICA6IGJhdWQgPSAyMDA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxNTAgICAgICAgOiBiYXVkID0gMTUwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTM0ICAgICAgIDogYmF1ZCA9IDEzNDsgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjExMCAgICAgICA6IGJhdWQgPSAxMTA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI3NSAgICAgICAgOiBiYXVkID0gNzU7ICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNTAgICAgICAgIDogYmF1ZCA9IDUwOyAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWRlZmF1bHQgICAgICAgICA6IGJhdWQgPSA5NjAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChiYXVkID09IDM4NDAwKQotICAgICAgICAgICAgICAgICAgICAgICAgYmF1ZCA9IGFsdGJhdWQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYmF1ZCA9PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgYmF1ZCA9IDk2MDA7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYmF1ZCA+PSBtaW4gJiYgYmF1ZCA8PSBtYXgpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmF1ZDsKLQotICAgICAgICAgICAgICAgIHRlcm1pb3MtPmNfY2ZsYWcgJj0gfkNCQVVEOwotICAgICAgICAgICAgICAgIGlmIChvbGQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlcm1pb3MtPmNfY2ZsYWcgfD0gb2xkLT5jX2NmbGFnICYgQ0JBVUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvbGQgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdGVybWlvcy0+Y19jZmxhZyB8PSBCOTYwMDsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAwOwotfQotdW5zaWduZWQgaW50IHNiX3VhcnRfZ2V0X2Rpdmlzb3Ioc3RydWN0IHNiX3VhcnRfcG9ydCAqcG9ydCwgdW5zaWduZWQgaW50IGJhdWQpCi17Ci0gICAgICAgIHVuc2lnbmVkIGludCBxdW90OwotCi0gICAgICAgIGlmIChiYXVkID09IDM4NDAwICYmIChwb3J0LT5mbGFncyAmIFVQRl9TUERfTUFTSykgPT0gVVBGX1NQRF9DVVNUKQotICAgICAgICAgICAgICAgIHF1b3QgPSBwb3J0LT5jdXN0b21f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JTTElDIFRlY2hub2xvZ3kodG0pIFNlcnZlciAiXAorc3RhdGljIGNoYXIgKnNsaWNfcHJvZHVjdF9uYW1lID0gIlNMSUMgVGVjaG5vbG9neSh0bSkgU2VydmVyICIKIAkJImFuZCBTdG9yYWdlIEFjY2VsZXJhdG9yIChOb24tQWNjZWxlcmF0ZWQpIjsKIHN0YXRpYyBjaGFyICpzbGljX3ZlbmRvciA9ICJBbGFjcml0ZWNoLCBJbmMuIjsKIApAQCAtMTQ0LDI5ICsxNDQsNiBAQAogCiBNT0RVTEVfREVWSUNFX1RBQkxFKHBjaSwgc2xpY19wY2lfdGJsKTsKIAotI2RlZmluZSBTTElDX0dFVF9TTElDX0hBTkRMRShfYWRhcHRlciwgX3BzbGljX2hhbmRsZSkgICAgICAgICAgICAgICAgICAgXAoteyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fbG9ja19pcnFzYXZlKCZfYWRhcHRlci0+aGFuZGxlX2xvY2subG9jaywgICAgICAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi0JX3BzbGljX2hhbmRsZSAgPSAgX2FkYXB0ZXItPnBmcmVlX3NsaWNfaGFuZGxlczsgICAgICAgICAgICAgICAgIFwKLQlpZiAoX3BzbGljX2hhbmRsZSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQlfYWRhcHRlci0+cGZyZWVfc2xpY19oYW5kbGVzID0gX3BzbGljX2hhbmRsZS0+bmV4dDsgICAgIFwKLQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJl9hZGFwdGVyLT5oYW5kbGVfbG9jay5sb2NrLCAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi19Ci0KLSNkZWZpbmUgU0xJQ19GUkVFX1NMSUNfSEFORExFKF9hZGFwdGVyLCBfcHNsaWNfaGFuZGxlKSAgICAgICAgICAgICAgICAgIFwKLXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlfcHNsaWNfaGFuZGxlLT50eXBlID0gU0xJQ19IQU5ETEVfRlJFRTsgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fbG9ja19pcnFzYXZlKCZfYWRhcHRlci0+aGFuZGxlX2xvY2subG9jaywgICAgICAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi0JX3BzbGljX2hhbmRsZS0+bmV4dCA9IF9hZGFwdGVyLT5wZnJlZV9zbGljX2hhbmRsZXM7ICAgICAgICAgICAgIFwKLQlfYWRhcHRlci0+cGZyZWVfc2xpY19oYW5kbGVzID0gX3BzbGljX2hhbmRsZTsgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJl9hZGFwdGVyLT5oYW5kbGVfbG9jay5sb2NrLCAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi19Ci0KIHN0YXRpYyBpbmxpbmUgdm9pZCBzbGljX3JlZzMyX3dyaXRlKHZvaWQgX19pb21lbSAqcmVnLCB1MzIgdmFsdWUsIGJvb2wgZmx1c2gpCiB7CiAJd3JpdGVsKHZhbHVlLCByZWcpOwpAQCAtMTQ0Miw3ICsxNDE5LDEzIEBACiAJd2hpbGUgKChjbWRjbnQgPCBTTElDX0NNRFFfQ01EU0lOUEFHRSkgJiYKIAkgICAgICAgKGFk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sgNykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMDggICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgOCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMDkgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgOSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTAgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTApCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzExICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDExKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xMiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxMikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTMgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTMpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzE0ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDE0KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xNSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxNSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTYgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTYpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzE3ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDE3KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xOCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxOCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTkgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTkpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzIwICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDIwKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yMSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyMSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjIgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjIpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzIzICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDIzKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yNCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyNCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjUgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjUpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI2ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI2KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yNyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyNykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjggICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjgpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI5ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI5KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zMCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzMCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzEgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzEpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzMyICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDMyKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zMyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzMykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzQgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzQpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM1ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM1KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zNiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzNikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzcgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzcpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM4ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM4KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zOSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzOSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDAgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDApCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQxICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQxKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80MiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0MikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDMgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDMpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQ0ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQ0KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80NSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0NSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDYgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDYpCisKK3N0YXRpYyBpbmxpbmUgY2hhciAqCitzdWJzeXNfY29uc29sZV90b19zKGludCBzdWJzeXMsIGNoYXIgKnMsIGludCBuKQoreworCXN3aXRjaCAoc3Vic3lzKSB7CisJY2FzZSBTVUJTWVNfQ09OU09MRV9WSURFTzoKKwkJc3RybmNweShzLCAiQ09OU09MRV9WSURFTyIsIG4pOworCQ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zNdLAorCQlndWlkLT5kYXRhNFs0XSwgZ3VpZC0+ZGF0YTRbNV0sIGd1aWQtPmRhdGE0WzZdLCBndWlkLT5kYXRhNFs3XSk7CisJcmV0dXJuIHM7Cit9CisKKy8qKiBQYXJzZSBhIGd1aWQgc3RyaW5nIGluIGFueSBvZiB0aGVzZSBmb3JtczoKKyAqICAgICAgezExMTExMTExLTIyMjItMzMzMy00NDU1LTY2Nzc4ODk5YWFiYn0KKyAqICAgICAgezExMTExMTExLTIyMjItMzMzMy00NDU1NjY3Nzg4OTlhYWJifQorICogICAgICAxMTExMTExMS0yMjIyLTMzMzMtNDQ1NS02Njc3ODg5OWFhYmIKKyAqICAgICAgMTExMTExMTEtMjIyMi0zMzMzLTQ0NTU2Njc3ODg5OWFhYmIKKyAqLworc3RhdGljIGlubGluZSBHVUlECitHVUlEX3NjYW4oVTggKnApCit7CisJR1VJRCBndWlkID0gR1VJRDA7CisJVTggeFszM107CisJaW50IGNvdW50ID0gMDsKKwlpbnQgYywgaSA9IDA7CisJVTggY2RhdGExWzldOworCVU4IGNkYXRhMls1XTsKKwlVOCBjZGF0YTNbNV07CisJVTggY2RhdGE0WzNdOworCWludCBkYXNoY291bnQgPSAwOworCWludCBicmFjZSA9IDA7CisJdW5zaWduZWQgbG9uZyB1bGRhdGE7CisKKwlpZiAoIXApCisJCXJldHVybiBndWlkOworCWlmICgqcCA9PSAneycpIHsKKwkJcCsrOworCQlicmFjZSA9IDE7CisJfQorCXdoaWxlIChjb3VudCA8IDMyKSB7CisJCWlmICgqcCA9PSAnfScpCisJCQlyZXR1cm4gZ3VpZDsKKwkJaWYgKCpwID09ICdcMCcpCisJCQlyZXR1cm4gZ3VpZDsKKwkJYyA9IHRvdXBwZXIoKnApOworCQlwKys7CisJCWlmIChjID09ICctJykgeworCQkJc3dpdGNoIChkYXNoY291bnQpIHsKKwkJCWNhc2UgMDoKKwkJCQlpZiAoaSAhPSA4KQorCQkJCQlyZXR1cm4gZ3VpZDsKKwkJCQl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isgKiBkZXRhaWxzLgorICovCisKKy8qKiBAZmlsZSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiAgVGhpcyBkZXNjcmliZXMgdGhlIGludGVyZmFjZXMgbmVjZXNzYXJ5IGZvciBjcmVhdGluZyBhIHRyZWUgb2YgdHlwZXMsCisgKiAgb2JqZWN0cywgYW5kIHByb3BlcnRpZXMgaW4gL3Byb2MuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisKKyNpZm5kZWYgX19QUk9DT0JKRUNUVFJFRV9IX18KKyNkZWZpbmUgX19QUk9DT0JKRUNUVFJFRV9IX18KKworI2luY2x1ZGUgInVuaWtsb2cuaCIKKyNpbmNsdWRlICJ0aW1za21vZC5oIgorCisvKiBUaGVzZSBhcmUgb3BhcXVlIHN0cnVjdHVyZXMgdG8gdXNlcnMuCisgKiBGaWVsZHMgYXJlIGRlY2xhcmVkIG9ubHkgaW4gdGhlIGltcGxlbWVudGF0aW9uIC5jIGZpbGVzLgorICovCit0eXBlZGVmIHN0cnVjdCBNWVBST0NPQkpFQ1RfVGFnIE1ZUFJPQ09CSkVDVDsKK3R5cGVkZWYgc3RydWN0IE1ZUFJPQ1RZUEVfVGFnICAgTVlQUk9DVFlQRTsKKworTVlQUk9DT0JKRUNUICp2aXNvcl9wcm9jX0NyZWF0ZU9iamVjdChNWVBST0NUWVBFICp0eXBlLCBjb25zdCBjaGFyICpuYW1lLAorCQkJCSAgICAgIHZvaWQgKmNvbnRleHQpOwordm9pZCAgICAgICAgICB2aXNvcl9wcm9jX0Rlc3Ryb3lPYmplY3QoTVlQUk9DT0JKRUNUICpvYmopOworTVlQUk9DVFlQRSAgICp2aXNvcl9wcm9jX0NyZWF0ZVR5cGUoc3RydWN0IHByb2NfZGlyX2VudHJ5ICpwcm9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ZgorICogIHRoZSBleHByZXNzaW9uIGV2YWx1YXRlcyB0byA8IDAuCisgKiAgQHBhcmFtIHggdGhlIGV4cHJlc3Npb24gdG8gdHJ5CisgKi8KKyNkZWZpbmUgQVNTRVJUKGNvbmQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlkbyB7IGlmICghKGNvbmQpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJSFVIRFJWKCJBU1NFUlQgZmFpbGVkIC0gJXMiLAkgICAgICAgXAorCQkJICAgICAgIF9fc3RyaW5naWZ5KGNvbmQpKTsJICAgICAgIFwKKwl9IHdoaWxlICgwKQorCisjZGVmaW5lIHNpemVvZm1lbWJlcihUWVBFLCBNRU1CRVIpIChzaXplb2YoKChUWVBFICopMCktPk1FTUJFUikpCisvKiogIkNvdmVyZWQgcXVvdGllbnQiIGZ1bmN0aW9uICovCisjZGVmaW5lIENPVlEodiwgZCkgICgoKHYpICsgKGQpIC0gMSkgLyAoZCkpCisjZGVmaW5lIFNXQVBQT0lOVEVSUyhwMSwgcDIpCQkJCVwKKwlkbyB7CQkJCQkJXAorCQl2b2lkICpTV0FQUE9JTlRFUlNfVEVNUCA9ICh2b2lkICopcDE7CVwKKwkJKHZvaWQgKikocDEpID0gKHZvaWQgKikocDIpOyAgICAgICAgICAgIFwKKwkJKHZvaWQgKikocDIpID0gU1dBUFBPSU5URVJTX1RFTVA7CVwKKwl9IHdoaWxlICgwKQorCisvKioKKyAqICBAYWRkdG9ncm91cCBkcml2ZXJsb2dnaW5nCisgKiAgQHsKKyAqLworCisjZGVmaW5lIFBSSU5US0RSVihmbXQsIGFyZ3MuLi4pIExPR0lORihmbXQsICMjIGFyZ3MpCisjZGVmaW5lIFRCRERSVihmbXQsIGFyZ3MuLi4pICAgIExPR0VSUihmbXQsICMjIGFyZ3MpCisjZGVmaW5lIEhVSERSVihmbXQsIGFyZ3MuLi4pICAgIExPR0VSUihmbXQsICMj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VihkZXZuYW1lLCBmbXQsIGFyZ3MuLi4pICAgIExPR0lORkRFVihkZXZuYW1lLCBmbXQsICMjIGFyZ3MpCisjZGVmaW5lIElORk9ERVZYKGRldm5vLCBmbXQsIGFyZ3MuLi4pICAgICBMT0dJTkZERVZYKGRldm5vLCBmbXQsICMjIGFyZ3MpCisjZGVmaW5lIERFQlVHREVWKGRldm5hbWUsIGZtdCwgYXJncy4uLikgICBEQkdJTkZERVYoZGV2bmFtZSwgZm10LCAjIyBhcmdzKQorCisKKy8qIEB9ICovCisKKy8qKiBWZXJpZmllcyB0aGUgY29uc2lzdGVuY3kgb2YgeW91ciBQUklWQVRFREVWSUNFREFUQSBzdHJ1Y3R1cmUgdXNpbmcKKyAqICBjb252ZW50aW9uYWwgInNpZ25hdHVyZSIgZmllbGRzOgorICogIDxwPgorICogIC0gc2lnMSBzaG91bGQgY29udGFpbiB0aGUgc2l6ZSBvZiB0aGUgc3RydWN0dXJlCisgKiAgLSBzaWcyIHNob3VsZCBjb250YWluIGEgcG9pbnRlciB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBzdHJ1Y3R1cmUKKyAqLworI2RlZmluZSBERExPT0tTVkFMSUQoZGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkoKGRkICE9IE5VTEwpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJglcCisJCSAoKGRkKS0+c2lnMSA9PSBzaXplb2YoUFJJVkFURURFVklDRURBVEEpKSAmJglcCisJCSAoKGRkKS0+c2lnMiA9PSBkZCkpCisKKy8qKiBWZXJpZmllcyB0aGUgY29uc2lzdGVuY3kgb2YgeW91ciBQUklWQVRFRklMRURBVEEgc3RydWN0dXJlIHVzaW5nCisgKiAgY29udmVudGlvbmFsICJzaWduYXR1cmUiIGZpZWxkczoKKyAqICA8cD4KKyAqICAtIHNpZzEgc2hvdWxkIGNvbnRhaW4gdGhlIHNpemUgb2YgdGhlIHN0cnVjdHVyZQorICogIC0gc2lnMiBzaG91bGQgY29udGFpbiBhIHBvaW50ZXIgdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgc3RydWN0dXJlCisgKi8KKyNkZWZpbmUgRkRMT09LU1ZBTElEKGZkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJKChmZCAhPSBOVUxMKSAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICAgICBcCisJICgoZmQpLT5zaWcxID09IHNpemVvZihQUklWQVRFRklMRURBVEEpKSAmJiAgICBcCisJICgoZmQpLT5zaWcyID09IGZkKSkKKworLyoqIExvY2tzIGRkLT5sb2NrRGV2IGlmIHlvdSBoYXZuJ3QgYWxyZWFkeSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgTE9DS0RFVihkZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKCFsb2NrZWREZXYpIHsJCQkJICAgICAgIFwKKwkJCXNwaW5fbG9jaygmZGQtPmxvY2tEZXYpOwkJICAgICAgIFwKKwkJCWxvY2tlZERldiA9IFRSVUU7CQkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogVW5sb2NrcyBkZC0+bG9ja0RldiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLREVWKGRkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKGxvY2tlZERldikgewkJCQkgICAgICAgXAorCQkJc3Bpbl91bmxvY2soJmRkLT5sb2NrRGV2KTsJCSAgICAgICBcCisJCQlsb2NrZWREZXYgPSBGQUxTRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBMb2NrcyBkZC0+bG9ja0RldklTUiBpZiB5b3UgaGF2bid0IGFscmVhZHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIExPQ0tERVZJU1IoZGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWlmICghbG9ja2VkRGV2SVNSKSB7CQkJCSAgICAgICBcCisJCQlzcGluX2xvY2tfaXJxc2F2ZSgmZGQtPmxvY2tEZXZJU1IsIGZsYWdzKTsgICAgIFwKKwkJCWxvY2tlZERldklTUiA9IFRSVUU7CQkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogVW5sb2NrcyBkZC0+bG9ja0RldklTUiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLREVWSVNSKGRkKQkJCQkJCVwKKwl7CQkJCQkJCQlcCisJCWlmIChsb2NrZWREZXZJU1IpIHsJCQkJCVwKKwkJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmRkLT5sb2NrRGV2SVNSLCBmbGFncyk7IFwKKwkJCWxvY2tlZERldklTUiA9IEZBTFNFOwkJCQlcCisJCX0JCQkJCQkJXAorCX0KKworLyoqIExvY2tzIExvY2tHbG9iYWxJU1IgaWYgeW91IGhhdm4ndCBhbHJlYWR5IGxvY2tlZCBpdCAqLworI2RlZmluZSBMT0NLR0xPQkFMSVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAoIWxvY2tlZEdsb2JhbElTUikgewkJCQkgICAgICAgXAorCQkJc3Bpbl9sb2NrX2lycXNhdmUoJkxvY2tHbG9iYWxJU1IsIGZsYWdzKTsgICAgICBcCisJCQlsb2NrZWRHbG9iYWxJU1IgPSBUUlVFOwkJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIFVubG9ja3MgTG9ja0dsb2JhbElTUiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLR0xPQkFMSVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKGxvY2tlZEdsb2JhbElTUikgewkJCQkgICAgICAgXAorCQkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmTG9ja0dsb2JhbElTUiwgZmxhZ3MpOyBcCisJCQlsb2NrZWRHbG9iYWxJU1IgPSBGQUxTRTsJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIExvY2tzIExvY2tHbG9iYWwgaWYgeW91IGhhdm4ndCBhbHJlYWR5IGxvY2tlZCBpdCAqLworI2RlZmluZSBMT0NLR0xPQkFMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAoIWxvY2tlZEdsb2JhbCkgewkJCQkgICAgICAgXAorCQkJc3Bpbl9sb2NrKCZMb2NrR2xvYmFsKTsJCQkgICAgICAgXAorCQkJbG9ja2VkR2xvYmFsID0gVFJVRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBVbmxvY2tzIExvY2tHbG9iYWwgaWYgeW91IHByZXZpb3VzbHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIFVOTE9DS0dMT0JBTCAgIC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UxJVFkgT1IgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UsIEdPT0QgVElUTEUgb3IKKyAqIE5PTiBJTkZSSU5HRU1FTlQuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlCisgKiBkZXRhaWxzLgorICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFVuaXN5cyB0aHJlYWQgdXRpbGl0aWVzIGhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisjaWZuZGVmIF9fVUlTVEhSRUFEX0hfXworI2RlZmluZSBfX1VJU1RIUkVBRF9IX18KKworCisjaW5jbHVkZSAibGludXgvY29tcGxldGlvbi5oIgorCitzdHJ1Y3QgdWlzdGhyZWFkX2luZm8geworCXN0cnVjdCB0YXNrX3N0cnVjdCAqdGFzazsKKwlpbnQgaWQ7CisJaW50IHNob3VsZF9zdG9wOworCXN0cnVjdCBjb21wbGV0aW9uIGhhc19zdG9wcGVkOworfTsKKworCisvKiByZXR1cm5zIDAgZm9yIGZhaWx1cmUsIDEgZm9yIHN1Y2Nlc3MgKi8KK2ludCB1aXN0aHJlYWRfc3RhcnQoCisJc3RydWN0IHVpc3RocmVhZF9pbmZvICp0aHJpbmZvLAorCWludCAoKnRocmVhZGZuKSh2b2lkICopLAorCXZvaWQgKnRocmNvbnRleHQsCisJY2hhciAqbmFtZSk7CisKK3ZvaWQgdWlzdGhyZWFkX3N0b3Aoc3RydWN0IHVpc3RocmVhZF9pbmZvICp0aHJpbmZvKTsKKworI2VuZGlmIC8qIF9fVUlTVEhSRUFEX0hfXyAqLwpkaWZmIC0tZ2l0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ioqKioqKioqKioqKioqKioqKi8KKy8qIGxvY2FsIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludCBwcm9jX2luZm9fdmJ1c19zaG93KHN0cnVjdCBzZXFfZmlsZSAqbSwgdm9pZCAqdik7CitzdGF0aWMgaW50Citwcm9jX2luZm9fdmJ1c19vcGVuKHN0cnVjdCBpbm9kZSAqaW5vZGUsIHN0cnVjdCBmaWxlICpmaWxwKQoreworCS8qIHByb2NfaW5mb192YnVzX3Nob3cgd2lsbCBncmFiIHRoaXMgZnJvbSBzZXFfZmlsZS5wcml2YXRlOiAqLworCXN0cnVjdCBidXNfaW5mbyAqYnVzID0gUERFX0RBVEEoaW5vZGUpOworCXJldHVybiBzaW5nbGVfb3BlbihmaWxwLCBwcm9jX2luZm9fdmJ1c19zaG93LCBidXMpOworfQorCitzdGF0aWMgY29uc3Qgc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBwcm9jX2luZm9fdmJ1c19mb3BzID0geworCS5vcGVuID0gcHJvY19pbmZvX3ZidXNfb3BlbiwKKwkucmVhZCA9IHNlcV9yZWFkLAorCS5sbHNlZWsgPSBzZXFfbHNlZWssCisJLnJlbGVhc2UgPSBzaW5nbGVfcmVsZWFzZSwKK307CisKK3N0YXRpYyBzc2l6ZV90IHVpc2xpYl9wcm9jX3JlYWRfd3JpdGVvbmx5KHN0cnVjdCBmaWxlICpmaWxlLAorCQkJCQkgIGNoYXIgX191c2VyICpidWZmZXIsCisJCQkJCSAgc2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworCitzdGF0aWMgc3NpemVfdCB2bmljX3Byb2Nfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWZmZXIsCisJCQkgICAgICAgc2l6ZV90IGNvdW50LCBsb2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50IHRvIHNlbmQgYSBoaW50IHRvIFByb2Nlc3NfSW5jb21pbmcoKSB0aGF0CisgKiAgeW91ciBkZXZpY2UgbWlnaHQgaGF2ZSBtb3JlIHJlcXVlc3RzLgorICovCit2b2lkCit1aXNsaWJfZm9yY2VfY2hhbm5lbF9pbnRlcnJ1cHQoVTMyIGJ1c05vLCBVMzIgZGV2Tm8pCit7CisJaWYgKGVuX3NtYXJ0X3dha2V1cCA9PSAwKQorCQlyZXR1cm47CisJaWYgKEdvX1BvbGxpbmdfRGV2aWNlX0NoYW5uZWxzKQorCQlyZXR1cm47CisJLyogVGhlIHBvaW50IG9mIHVzaW5nIHNjaGVkdWxlX3dvcmsoKSBpbnN0ZWFkIG9mIGp1c3QgZG9pbmcKKwkgKiB0aGUgd29yayBpbmxpbmUgaXMgdG8gZm9yY2UgYSBzbGlnaHQgZGVsYXkgYmVmb3JlIHdha2luZyB1cAorCSAqIHRoZSBQcm9jZXNzX0luY29taW5nKCkgdGhyZWFkLgorCSAqLworCXRvdF93YWtldXBfY250Kys7CisJc2NoZWR1bGVfd29yaygmV29ya193YWtldXBfcG9sbGluZ19kZXZpY2VfY2hhbm5lbHMpOworfQorRVhQT1JUX1NZTUJPTF9HUEwodWlzbGliX2ZvcmNlX2NoYW5uZWxfaW50ZXJydXB0KTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTW9kdWxlIEluaXQgJiBFeGl0IGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdAordWlzbGliX21vZF9pbml0KHZvaWQpCit7CisKKwlMT0dJTkYoIk1PTklUT1JBUElTIik7CisKKwlMT0dJTkYoInNpemVvZihzdHJ1Y3QgdWlzY21kcnNwKTolbHUgYnl0ZXNcbiIsCisJICAgICAgICh1bG9uZykgc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bHVkZSA8bGludXgvc2NoZWQuaD4KKyNpbmNsdWRlIDxsaW51eC9rdGhyZWFkLmg+CisjaW5jbHVkZSAidW5pa2xvZy5oIgorI2luY2x1ZGUgInVpc3V0aWxzLmgiCisjaW5jbHVkZSAidWlzdGhyZWFkLmgiCisKKyNkZWZpbmUgS0lMTChhLCBiLCBjKSBraWxsX3BpZChmaW5kX3ZwaWQoYSksIGIsIGMpCisKKy8qIHRoaXMgaXMgc2hvcnRlciB0aGFuIHVzaW5nIF9fRklMRV9fIChmdWxsIHBhdGggbmFtZSkgaW4KKyAqIGRlYnVnL2luZm8vZXJyb3IgbWVzc2FnZXMKKyAqLworI2RlZmluZSBDVVJSRU5UX0ZJTEVfUEMgVUlTTElCX1BDX3Vpc3RocmVhZF9jCisjZGVmaW5lIF9fTVlGSUxFX18gInVpc3RocmVhZC5jIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBFeHBvcnRlZCBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIHJldHVybnMgMCBmb3IgZmFpbHVyZSwgMSBmb3Igc3VjY2VzcyAqLworaW50Cit1aXN0aHJlYWRfc3RhcnQoc3RydWN0IHVpc3RocmVhZF9pbmZvICp0aHJpbmZvLAorCQlpbnQgKCp0aHJlYWRmbikodm9pZCAqKSwgdm9pZCAqdGhyY29udGV4dCwgY2hhciAqbmFtZSkKK3sKKwl0aHJpbmZvLT5zaG91bGRfc3RvcCA9IDA7CisJLyogdXNlZCB0byBzdG9wIHRoZSB0aHJlYWQgKi8KKwlpbml0X2NvbXBsZXRpb24oJnRocmluZm8tPmhhc19zdG9wcGVkKTsKKwl0aHJpbmZvLT50YXNrID0ga3RocmVhZF9jcmVhdGUodGhyZWFkZm4sIHRocmNvbnRleHQsIG5hbWUsIE5V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MgdmlhCisJCQkJCSAqIHVpc2N0cmxfcmVnaXN0ZXJfcmVxX2hhbmRsZXIoKSBvcgorCQkJCQkgKiB1aXNjdHJsX3JlZ2lzdGVyX3JlcV9oYW5kbGVyX2V4KCkgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBVdGlsaXR5IGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2ludAordWlzdXRpbF9hZGRfcHJvY19saW5lX2V4KGludCAqdG90YWwsIGNoYXIgKipidWZmZXIsIGludCAqYnVmZmVyX3JlbWFpbmluZywKKwkJICAgICAgY2hhciAqZm9ybWF0LCAuLi4pCit7CisJdmFfbGlzdCBhcmdzOworCWludCBsZW47CisKKwlEQkdJTkYoImJ1ZmZlciA9IDB4JXAgOiAqYnVmZmVyID0gMHglcC5cbiIsIGJ1ZmZlciwgKmJ1ZmZlcik7CisJdmFfc3RhcnQoYXJncywgZm9ybWF0KTsKKwlsZW4gPSB2c25wcmludGYoKmJ1ZmZlciwgKmJ1ZmZlcl9yZW1haW5pbmcsIGZvcm1hdCwgYXJncyk7CisJaWYgKGxlbiA+PSAqYnVmZmVyX3JlbWFpbmluZykgeworCQkqYnVmZmVyICs9ICpidWZmZXJfcmVtYWluaW5nOworCQkqdG90YWwgKz0gKmJ1ZmZlcl9yZW1haW5pbmc7CisJCSpidWZmZXJfcmVtYWluaW5nID0gMDsKKwkJTE9HRVJSKCJieXRlcyByZW1haW5pbmcgaXMgdG9vIHNtYWxsIVxuIik7CisJCXJldHVybiAtMTsKKwl9CisJKmJ1ZmZlcl9yZW1haW5pbmcgLT0gbGVuOworCSpidWZmZXIgKz0gbGVuOworCSp0b3RhbCArPSBsZW47CisJcmV0dXJuIGxlbjsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKHV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W92ZShzdHJ1Y3Qgd29ya19zdHJ1Y3QgKndvcmspOworc3RhdGljIHZvaWQgdmlydGhiYV9zZXJ2ZXJkb3duX2NvbXBsZXRlKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yayk7CisKK3N0YXRpYyBzc2l6ZV90IGluZm9fcHJvY19yZWFkKHN0cnVjdCBmaWxlICpmaWxlLCBjaGFyIF9fdXNlciAqYnVmLAorCQkJICAgICAgc2l6ZV90IGxlbiwgbG9mZl90ICpvZmZzZXQpOworc3RhdGljIHNzaXplX3QgcnF3dV9wcm9jX3dyaXRlKHN0cnVjdCBmaWxlICpmaWxlLCBjb25zdCBjaGFyIF9fdXNlciAqYnVmZmVyLAorCQkJICAgICAgIHNpemVfdCBjb3VudCwgbG9mZl90ICpwcG9zKTsKK3N0YXRpYyBzc2l6ZV90IGVuYWJsZV9pbnRzX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWZmZXIsCisJCQkJc2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworc3RhdGljIHNzaXplX3QgZW5hYmxlX2ludHNfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWZmZXIsCisJCQkJIHNpemVfdCBjb3VudCwgbG9mZl90ICpwcG9zKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogR2xvYmFscyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IHJzbHRxX3dhaXRfdXNlY3MgPSA0MDAwOwkvKiBEZWZhdWx0IDRtcyAqLworc3RhdGljIHVuc2lnbmVkIGludCBNYXhCdWZmTGVuOworCisvKiBNb2R1bGUgb3B0aW9ucyAqLworc3RhdGljIGNoYXIgKnZpcnRoYmF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6aWQ9JWQ6bHVuPSVkXVxuIiwKKwkJICAgICBzaG9zdC0+aG9zdF9ubywgY21kcnNwLT5kaXNrbm90aWZ5LmNoYW5uZWwsCisJCSAgICAgY21kcnNwLT5kaXNrbm90aWZ5LmlkLCBjbWRyc3AtPmRpc2tub3RpZnkubHVuKTsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFByb2JlIFJlbW92ZSBGdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyBpcnFyZXR1cm5fdAordmlydGhiYV9JU1IoaW50IGlycSwgdm9pZCAqZGV2X2lkKQoreworCXN0cnVjdCB2aXJ0aGJhX2luZm8gKnZpcnRoYmFpbmZvID0gKHN0cnVjdCB2aXJ0aGJhX2luZm8gKikgZGV2X2lkOworCUNIQU5ORUxfSEVBREVSIF9faW9tZW0gKnBDaGFubmVsSGVhZGVyOworCVNJR05BTF9RVUVVRV9IRUFERVIgX19pb21lbSAqcHFoZHI7CisJVTY0IG1hc2s7CisJdW5zaWduZWQgbG9uZyBsb25nIHJjMTsKKworCWlmICh2aXJ0aGJhaW5mbyA9PSBOVUxMKQorCQlyZXR1cm4gSVJRX05PTkU7CisJdmlydGhiYWluZm8tPmludGVycnVwdHNfcmN2ZCsrOworCXBDaGFubmVsSGVhZGVyID0gdmlydGhiYWluZm8tPmNoaW5mby5xdWV1ZWluZm8tPmNoYW47CisJaWYgKCgocmVhZHEoJnBDaGFubmVsSGVhZGVyLT5GZWF0dXJlcykKKwkgICAgICAmIFVMVFJBX0lPX0lPVk1fSVNfT0tfV0lUSF9EUklWRVJfRElTQUJMSU5HX0lOVFMpICE9IDApCisJICAgICYmICgocmVhZHEoJnBDaGFubmVsSGVhZGVyLT5GZWF0dXJlcykgJgorCQkgVUxUUkF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AgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdAordmlydGhiYV9wYXJzZV9saW5lKGNoYXIgKnN0cikKK3sKKwlEQkdJTkYoIkluIHZpcnRoYmFfcGFyc2VfbGluZSAlc1xuIiwgc3RyKTsKKwlyZXR1cm4gMTsKK30KKworc3RhdGljIHZvaWQgX19pbml0Cit2aXJ0aGJhX3BhcnNlX29wdGlvbnMoY2hhciAqbGluZSkKK3sKKwljaGFyICpuZXh0ID0gbGluZTsKKworCVBPU1RDT0RFX0xJTlVYXzIoVkhCQV9DUkVBVEVfRU5UUllfUEMsIFBPU1RDT0RFX1NFVkVSSVRZX0lORk8pOworCWlmIChsaW5lID09IE5VTEwgfHwgISpsaW5lKQorCQlyZXR1cm47CisJd2hpbGUgKChsaW5lID0gbmV4dCkgIT0gTlVMTCkgeworCQluZXh0ID0gc3RyY2hyKGxpbmUsICcgJyk7CisJCWlmIChuZXh0ICE9IE5VTEwpCisJCQkqbmV4dCsrID0gMDsKKwkJaWYgKCF2aXJ0aGJhX3BhcnNlX2xpbmUobGluZSkpCisJCQlEQkdJTkYoIlVua25vd24gb3B0aW9uICclcydcbiIsIGxpbmUpOworCX0KKworCVBPU1RDT0RFX0xJTlVYXzIoVkhCQV9DUkVBVEVfRVhJVF9QQywgUE9TVENPREVfU0VWRVJJVFlfSU5GTyk7Cit9CisKK3N0YXRpYyBpbnQgX19pbml0Cit2aXJ0aGJhX21vZF9pbml0KHZvaWQpCit7CisJaW50IGVycm9yOworCWludCBpOworCisJTE9HSU5GKCJFbnRlcmluZyB2aXJ0aGJhX21vZF9pbml0Li4uXG4iKTsKKworCVBPU1RDT0RFX0xJTlVYXzIoVkhCQV9DUkVBVEVfRU5UUllfUEMsIFBPU1RDT0RFX1NFVkVSSVRZX0lORk8pOworCXZpcnRoYmFfcGFyc2Vfb3B0aW9ucyh2aXJ0aGJhX29wdGlvbnMpO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c2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworc3RhdGljIHNzaXplX3QgaW5mb19wcm9jX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCisJCQkgICAgICBzaXplX3QgbGVuLCBsb2ZmX3QgKm9mZnNldCk7CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIHByb2NfdmlydF9mb3BzID0geworCS53cml0ZSA9IHZpcnRfcHJvY193cml0ZSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIHByb2NfaW5mb19mb3BzID0geworCS5yZWFkID0gaW5mb19wcm9jX3JlYWQsCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBHbG9iYWxzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIG1ldGhvZHMgaW4gYnVzX3R5cGUgc3RydWN0IGFsbG93IHRoZSBidXMgY29kZSB0byBzZXJ2ZSBhcyBhbgorICogaW50ZXJtZWRpYXJ5IGJldHdlZW4gdGhlIGRldmljZSBjb3JlIGFuZCBpbmRpdmlkdWFsIGRldmljZSBjb3JlIGFuZAorICogaW5kaXZpZHVhbCBkcml2ZXJzCisgKi8KK3N0YXRpYyBzdHJ1Y3QgYnVzX3R5cGUgdmlydHBjaV9idXNfdHlwZSA9IHsKKwkubmFtZSA9ICJ1aXN2aXJ0cGNpIiwKKwkubWF0Y2ggPSB2aXJ0cGNpX2J1c19tYXRjaCwKKwkudWV2ZW50ID0gdmlydHBjaV91ZXZlbnQsCisJLnN1c3BlbmQgPSB2aXJ0cGNpX2RldmljZV9zdXNwZW5kLAorCS5yZXN1bWUgPSB2aXJ0cGNpX2RldmljZV9yZXN1bWUsC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ZHJpdmVyLAorCSAgICAgICBkZXZfLT5kcml2ZXItPm5hbWUpOwkvKiBWRVJCT1NFL0RFQlVHICovCisJaWYgKHZpcnRwY2lkcnYpIHsKKwkJLyogVEVNUDogYXNzdW1pbmcgd2UgaGF2ZSBvbmx5IG9uZSBzdWNoIGRyaXZlciBmb3Igbm93ICovCisJCWlmICh2aXJ0cGNpZHJ2LT5yZW1vdmUpCisJCQl2aXJ0cGNpZHJ2LT5yZW1vdmUodmlydHBjaWRldik7CisJCXZpcnRwY2lkZXYtPm15ZHJpdmVyID0gTlVMTDsKKwl9CisKKwlEQkdJTkYoImNhbGxpbmcgcHV0ZGV2aWNlXG4iKTsKKwlwdXRfZGV2aWNlKGRldl8pOworCisJREJHSU5GKCJMZWF2aW5nXG4iKTsKKwlyZXR1cm4gMDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogQnVzIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCB2aXJ0cGNpX2J1c19yZWxlYXNlKHN0cnVjdCBkZXZpY2UgKmRldikKK3sKKwkvKiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB3aGVuIHRoZSBsYXN0IHJlZmVyZW5jZSB0byB0aGUKKwkgKiBkZXZpY2UgaXMgcmVtb3ZlZAorCSAqLworCURCR0lORigiSW4gdmlydHBjaV9idXNfcmVsZWFzZVxuIik7CisJLyogd2hhdCBlbHNlIGlzIHN1cHBvc2VkIHRvIGhhcHBlbiBoZXJlPyAqLworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBBZGFwdGVyIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqK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worI2VuZGlmCisJY2FzZSAweGY6CisJCS8qIGRlbGV0ZSBhbGwgdmhiYXMvdm5pY3MgKi8KKwkJaSA9IHNzY2FuZihidWYsICIleC0leC0lZCIsICZ0eXBlLCAmYWN0aW9uLCAmYnVzbm8pOworCQlpZiAoaSAhPSAzKQorCQkJYnJlYWs7CisJCWJ1c2RlbHBhcmFtcy5idXNObyA9IGJ1c25vOworCQlkZWxldGVfYWxsX3ZpcnQodHlwZSwgJmJ1c2RlbHBhcmFtcyk7CisJCXJldHVybiBjb3VudDsJLyogc3VjY2VzcyAqLworCWRlZmF1bHQ6CisJCWJyZWFrOworCX0KKwlQUklOVF9VU0FHRV9SRVRVUk47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIE1vZHVsZSBJbml0ICYgRXhpdCBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludCBfX2luaXQgdmlydHBjaV9tb2RfaW5pdCh2b2lkKQoreworCWludCByZXQ7CisKKworCUxPR0lORigiTW9kdWxlIGJ1aWxkOiBEYXRlOiVzIFRpbWU6JXMuLi5cbiIsIF9fREFURV9fLCBfX1RJTUVfXyk7CisKKwlQT1NUQ09ERV9MSU5VWF8yKFZQQ0lfQ1JFQVRFX0VOVFJZX1BDLCBQT1NUQ09ERV9TRVZFUklUWV9JTkZPKTsKKworCXJldCA9IGJ1c19yZWdpc3RlcigmdmlydHBjaV9idXNfdHlwZSk7CisJLyogY3JlYXRlcyAvc3lzL2J1cy91aXN2aXJ0cGNpIHdoaWNoIGNvbnRhaW5zIGRldmljZXMgJgorCSAqIGRyaXZlcnMgZGlyZWN0b3J5CisJICovCisJaWYgKHJldCkgeworCQlMT0dFUlIoImJ1c19yZWdpc3RlciAqKioqRkFJTEVEOiVkXG4iLCByZXQpOworC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gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgcGF5bG9hZCBhcmVhCisgKiAgIGNvbnRyb2x2bV9yZXNwb25kX3dpdGhfcGF5bG9hZCAgICBmdW5jdGlvbiB0byBjYWxsIHRvIHNlbmQgZWFjaCBjb250cm9sdm0KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlIGNvbnRhaW5pbmcgZmlsZSBkYXRhIGFzIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZDsgcmV0dXJucyBGQUxTRSBvbmx5IGlmIHRoZQorICoJCQkJICAgICAgIHBheWxvYWQgYnVmZmVyIHdhcyBmcmVlZCBpbmxpbmUKKyAqICAgZHVtcF9mdW5jICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRvIGR1bXAgY29udGV4dCBkYXRhIGluCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodW1hbi1yZWFkYWJsZSBmb3JtYXQKKyAqCisgKiAgUmV0dXJucyBUUlVFIGlmZiB0aGUgZmlsZSB0cmFuc2ZlciByZXF1ZXN0IGhhcyBiZWVuIHN1Y2Nlc3NmdWxseSBpbml0aWF0ZWQsCisgKiAgb3IgRkFMU0UgdG8gaW5kaWNhdGUgZmFpbHVyZS4KKyAqLworQk9PTAorZmlsZXhmZXJfZ2V0RmlsZShDT05UUk9MVk1fTUVTU0FHRV9IRUFERVIgKm1zZ0hkciwKKwkJIHU2NCBmaWxlX3JlcXVlc3RfbnVtYmVyLAorCQkgdWludCB1cGxpbmtfaW5kZXgsCisJCSB1aW50IGRpc2tfaW5kZXgsCisJCSBjaGFyICpmaWxlX25hbWUsCisJCSBHRVRfQ09OVElHVU9VU19DT05UUk9MVk1fUEFZTE9BRF9GVU5DCisJCSBnZXRfY29udGlndW91c19jb250cm9sdm1fcGF5bG9hZCwKKwkJIENPTlRST0xWTV9SRVNQ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AgICAgICAgICAgICAgICAgICAgPHJlcV9jb250ZXh0X2J5dGVzPi1zaXplZCBzdG9yYWdlIGFyZWEgcmV0dXJuZWQgYnkKKyAqICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmdW5jOyBub3RlIHRoYXQgaXQgd291bGQgTk9UIGJlIHN1ZmZpY2llbnQgdG8KKyAqICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3cgdGhlIGNhbGxlciB0byBpbml0aWFsaXplIHRoaXMgdXBvbiByZXR1cm4sIGFzCisgKiAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB0aGUgb3RoZXIgdXNlci1zdXBwbGllZCBjYWxsYmFja3MgbWlnaHQgaGF2ZQorICogICAgICAgICAgICAgICAgICAgICAgICBhbHJlYWR5IGJlZW4gY2FsbGVkIGJ5IHRoZW4KKyAqICAgZ2V0X2NvbnRyb2x2bV9maWxlZGF0YSAgIGZ1bmN0aW9uIHRvIGNhbGwgdG8gb2J0YWluIG1vcmUgZGF0YSBmb3IgdGhlIGZpbGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlaW5nIHdyaXR0ZW47IHJlZmVyIHRvIGdldF9jb250cm9sdm1fZmlsZWRhdGEoKQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gdmlzb3JjaGlwc2V0X21haW4uYyBmb3IgYSBjb21wbGV0ZSBkZXNjcmlwdGlvbgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgcGFyYW1ldGVycworICogICBjb250cm9sdm1fZW5kX3B1dEZpbGUgICAgZnVuY3Rpb24gdG8gY2FsbCB0byBpbmRpY2F0ZSB0aGF0IGNyZWF0aW9uIG9mIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWwgZmlsZSBoYXMgY29tcGxldGVkOyAgc2V0IDxyZXNwb25zZT4gdG8gYQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVnYXRpdmUgdmFsdWUgdG8gaW5kaWNhdGUgY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BQklMSVRZIE9SIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLCBHT09EIFRJVExFIG9yCisgKiBOT04gSU5GUklOR0VNRU5ULiAgU2VlIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZQorICogZGV0YWlscy4KKyAqLworCisvKiogQGZpbGUgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogIFRoaXMgZGVzY3JpYmVzIHN0cnVjdHVyZXMgbmVlZGVkIGZvciB0aGUgaW50ZXJmYWNlIGJldHdlZW4gdGhlCisgKiAgdmlzb3JjaGlwc2V0IGRyaXZlciBhbmQgYSB1c2VyLW1vZGUgY29tcG9uZW50IHRoYXQgb3BlbnMgdGhlIGRldmljZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KKworI2lmbmRlZiBfX1ZJU09SQ0hJUFNFVF9VTU9ERV9ICisjZGVmaW5lIF9fVklTT1JDSElQU0VUX1VNT0RFX0gKKworCisKKy8qKiBUaGUgdXNlci1tb2RlIHByb2dyYW0gY2FuIGFjY2VzcyB0aGUgY29udHJvbCBjaGFubmVsIGJ1ZmZlciBkaXJlY3RseQorICogIHZpYSB0aGlzIG1lbW9yeSBtYXAuCisgKi8KKyNkZWZpbmUgVklTT1JDSElQU0VUX01NQVBfQ09OVFJPTENIQU5PRkZTRVQgICAgKDB4MDAwMDAwMDApCisjZGVmaW5lIFZJU09SQ0hJUFNFVF9NTUFQX0NPTlRST0xDSEFOU0laRSAgICAgICgweDAwNDAwMDAwKSAgLyogNE1CICovCisKKyNlbmRpZiAvKiBfX1ZJU09SQ0hJUFNFVF9VTU9ERV9IICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvdW5pc3lzL3Zpc29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Swgdm9pZCAqcCk7CisgKiAgICAgIHZvaWQgc2hvd19kcml2ZXJfaW5mbyhzdHJ1Y3Qgc2VxX2ZpbGUgKnNlcSk7CisgKgorICogIFRoZSBzZWNvbmQgcGFyYW1ldGVyIHRvIHNob3dfZGV2aWNlX2luZm8gaXMgYWN0dWFsbHkgYSBwb2ludGVyIHRvIHRoZQorICogIGRldmljZS1zcGVjaWZpYyBpbmZvIHRvIHNob3cuICBJdCBpcyB0aGUgY29udGV4dCB0aGF0IHdhcyBvcmlnaW5hbGx5CisgKiAgcGFzc2VkIHRvIHZpc29yX2Vhc3lwcm9jX0luaXREZXZpY2UoKS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KKworI2luY2x1ZGUgPGxpbnV4L3Byb2NfZnMuaD4KKworI2luY2x1ZGUgInVuaWtsb2cuaCIKKyNpbmNsdWRlICJ0aW1za21vZC5oIgorI2luY2x1ZGUgImVhc3lwcm9jLmgiCisKKyNkZWZpbmUgTVlEUlZOQU1FICJlYXN5cHJvYyIKKworCisKKy8qCisgKiAgIC9wcm9jLzxQcm9jSWQ+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHJvY0RpcgorICogICAvcHJvYy88UHJvY0lkPi9kcml2ZXIgICAgICAgICAgICAgICAgICAgICAgIFByb2NEcml2ZXJEaXIKKyAqICAgL3Byb2MvPFByb2NJZD4vZHJpdmVyL2RpYWcgICAgICAgICAgICAgICAgICBQcm9jRHJpdmVyRGlhZ0ZpbGUKKyAqICAgL3Byb2MvPFByb2NJZD4vZGV2aWNlICAgICAgICAgICAgICAgICAgICAgICBQcm9jRGV2aWNlRGlyCisgKiAgIC9wcm9jLzxQcm9jSWQ+L2RldmljZS8wICAgICAgICAgICAgICAgICAgICAgcHJvY0RldmljZXhEaXIKKyAqICAgL3Byb2MvPFByb2NJZD4vZGV2aWNlLzAvZGlhZyAg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IHRtcCA9IDA7CiAJaW50IHJjOwogCi0Jc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7Ci0gICAgcmMgPSBDT05UUk9MbnNSZXF1ZXN0SW4ocERldmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1RZUEVfUkVBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHX1JDUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1JFUVVFU1RfTUFDUkVHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5VG1wTW9kZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgaWYgKHJjID09IDApIHBEZXZpY2UtPmJ5UnhNb2RlID0gYnlUbXBNb2RlOworCXJjID0gQ09OVFJPTG5zUmVxdWVzdEluKHByaXYsIE1FU1NBR0VfVFlQRV9SRUFELAorCQlNQUNfUkVHX1JDUiwgTUVTU0FHRV9SRVFVRVNUX01BQ1JFRywgMSwgJnRtcCk7CisJaWYgKHJjID09IDApCisJCXByaXYtPmJ5UnhNb2RlID0gdG1wOwogCi0gICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAicERldmljZS0+YnlSeE1vZGUgaW49ICV4XG4iLCBwRGV2aWNlLT5ieVJ4TW9kZSk7CisJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAicHJpdi0+YnlSeE1vZGUgaW49ICV4XG4iLAorCQkJCQkJCXByaXYtPmJ5UnhNb2RlKTsKIAotICAgIGlmIChkZXYtPmZsYWdzICYgSUZGX1BST01JU0MpIHsgLyogc2V0IHByb21pc2N1b3VzIG1vZGUgKi8KLSAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfRVJSLEtFUk5fTk9USUNFICIlczogUHJvbWlzY3VvdXMgbW9kZSBlbmFibGVkLlxuIiwgZGV2LT5uYW1lKTsKLQkvKiB1bmNvbmRpdGlvbmFsbHkgbG9nIG5ldCB0YXBzICovCi0gICAgICAgIHBEZXZpY2UtPmJ5UnhNb2RlIHw9IChSQ1JfTVVMVElDQVNUfFJDUl9CUk9BRENBU1R8UkNSX1VOSUNBU1QpOwotICAgIH0KLSAgICBlbHNlIGlmICgobmV0ZGV2X21jX2NvdW50KGRldikgPiBwRGV2aWNlLT5tdWx0aWNhc3RfbGltaXQpIHx8Ci0JICAgICAoZGV2LT5mbGFncyAmIElGRl9BTExNVUxUSSkpIHsKLSAgICAgICAgQ09OVFJPTG5zUmVxdWVzdE91dChwRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1FU1NBR0VfVFlQRV9XUklURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHX01BUjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTUVTU0FHRV9SRVFVRVNUX01BQ1JFRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieURhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBwRGV2aWNlLT5ieVJ4TW9kZSB8PSAoUkNSX01VTFRJQ0FTVHxSQ1JfQlJPQURDQVNUKTsKLSAgICB9Ci0gICAgZWxzZSB7Ci0gICAgICAgIG1lbXNldChtY19maWx0ZXIsIDAsIHNpemVvZihtY19maWx0ZXIpKTsKLQluZXRkZXZfZm9yX2VhY2hfbWNfYWRkcihoYSwgZGV2KSB7Ci0gICAgICAgICAgICBpbnQgYml0X25yID0gZXRoZXJfY3JjKEVUSF9BTEVOLCBoYS0+YWRkcikgPj4gMjY7Ci0gICAgICAgICAgICBtY19maWx0ZXJbYml0X25yID4+IDVdIHw9IGNwdV90b19sZTMyKDEgPDwgKGJpdF9uciAmIDMxKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChpaSA9IDA7IGlpID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uZGlmIC8vIEJJTl9ETAorI2VuZGlmIC8qIEJJTl9ETCAqLwogCiAKICNpbmNsdWRlIDxkZWJ1Zy5oPgogCiAjaW5jbHVkZSA8aGNmLmg+CiAjaW5jbHVkZSA8ZGhmLmg+Ci0vL2luIG9yZGVyIHRvIGdldCBhcm91bmQ6OiB3bF9tYWluLmM6MjIyOTogYEhSRUdfRVZfUkRNQUQnIHVuZGVjbGFyZWQgKGZpcnN0IHVzZSBpbiB0aGlzIGZ1bmN0aW9uKQorLyogaW4gb3JkZXIgdG8gZ2V0IGFyb3VuZDo6IHdsX21haW4uYzoyMjI5OiBgSFJFR19FVl9SRE1BRCcgdW5kZWNsYXJlZCAoZmlyc3QgdXNlIGluIHRoaXMgZnVuY3Rpb24pICovCiAjaW5jbHVkZSA8aGNmZGVmLmg+CiAKICNpbmNsdWRlIDx3bF9pZi5oPgpAQCAtMTMzLDggKzExOCw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogI2RlZmluZSBWQUxJRF9QQVJBTShDKSBcCiAJeyBcCi0JCWlmICghKEMpKSBcCi0JCXsgXAorCQlpZiAoIShDKSkgeyBcCiAJCQlwcmludGsoS0VSTl9JTkZPICJXaXJlbGVzcywgcGFyYW1ldGVyIGVycm9yOiBcIiVzXCJcbiIsICNDKTsgXAogCQkJZ290byBmYWlsZWQ7IFwKIAkJfSBcCkBAIC0xNDIsNyArMTI2LDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKglsb2NhbCBmdW5jdGlvbnMKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2lzcl9oYW5kbGVyKCB1bnNpZ25lZCBsb25nIHAgKTsKK3ZvaWQgd2xfaXNyX2hhbmRsZXIodW5zaWduZWQgbG9uZyBwKTsKIAogI2lmIDAgLy9TQ1VMTF9VU0VfUFJPQyAvKiBkb24ndCB3YXN0ZSBzcGFjZSBpZiB1bnVzZWQgKi8KIHN0YXRpYyBpbnQgc2N1bGxfcmVhZF9wcm9jbWVtKHN0cnVjdCBzZXFfZmlsZSAqbSwgdm9pZCAqdik7CkBAIC0xNjgsNyArMTUyLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBtb2R1bGUgcGFyYW1ldGVyIGRlZmluaXRpb25zIC0gc2V0IHdpdGggJ2luc21vZCcKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgcF91MTYgICAgaXJxX21hc2sgICAgICAgICAgICAgICAgPSAweGRlYjg7IC8vIElSUTMsNCw1LDcsOSwxMCwxMSwxMiwxNCwxNQorc3RhdGljIHBfdTE2ICAgIGlycV9tYXNrICAgICAgICAgICAgICAgID0gMHhkZWI4OyAvKiBJUlEzLDQsNSw3LDksMTAsMTEsMTIsMTQsMTUgKi8KIHN0YXRpYyBwX3M4ICAgICBpcnFfbGlzdFs0XSAgICAgICAgICAgICA9IHsgLTEgfTsKIAogI2lmIDAKQEAgLTE4Myw3ICsxNjcsNyBAQAogc3RhdGljIHBfdTE2ICAgIFBBUk1fQlJTQ18yR0haICAgICAgICAgICAgIAk9IFBBUk1fREVGQVVMVF9CUlNDXzJHSFo7CiBzdGF0aWMgcF91MTYgICAgUEFSTV9CUlNDXzVHSFogICAgICAgICAgICAgCT0gUEFSTV9ERUZBVUxUX0JSU0NfNUdIWjsKIHN0YXRpYyBwX3UxNiAgICBQQVJNX0NPRVhJU1RFTkNFICAgICAgICAgICAJPSBQQVJNX0RFRkFVT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IgdGhlIHNwaW5sb2NrIGFueXdheSBqdXN0IGluIGNhc2Ugd2UgZXZlciBuZWVkCi0gICAgICAgdGhpcyByb3V0aW5lICovCi0vLyAgd2xfbG9jayggbHAsICZmbGFncyApOwotLy8gIHdsX3VubG9jayggbHAsICZmbGFncyApOwotCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2luaXQKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xOTMsMTcgKzE2NSwyMCBAQAogICogICAgICBlcnJubyBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX2NvbmZpZyggc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmbWFwICptYXAgKQoraW50IHdsX2NvbmZpZyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaWZtYXAgKm1hcCkKIHsKLSAgICBEQkdfUEFSQU0oIERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYgKTsKLSAgICBEQkdfUEFSQU0oIERiZ0luZm8sICJtYXAiLCAiMHglcCIsIG1hcCApOworCURCR19QQVJBTShEYmdJbmZvLCAiZGV2IiwgIiVzICgweCVwKSIsIGRldi0+bmFtZSwgZGV2KTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgIm1hcCIsICIweCVwIiwgbWFwKTsKIAotICAgIC8qIFRoZSBvbmx5IHRoaW5nIHdlIGNhcmUgYWJvdXQgaGVyZSBpcyBhIHBvcnQgY2hhbmdlLiBTaW5jZSB0aGlzIG5vdCBuZWVkZWQsCi0gICAgICAgaWdub3JlIHRoZSByZXF1ZXN0LiAqLwotICAgIERCR19UUkFDRShEYmdJbmZvLCAiJXM6ICVzIGNhbGxlZC5cbiIsIGRldi0+bmFtZSwgX19mdW5jX18pOworCS8qCisJICogVGhlIG9ubHkgdGhpbmcgd2UgY2FyZSBhYm91dCBoZXJlIGlzIGEgcG9ydCBjaGFuZ2UuCisJICogU2luY2UgdGhpcyBub3QgbmVlZGVkLCBpZ25vcmUgdGhlIHJlcXVlc3QuIAorCSAqLworCURCR19UUkFDRShEYmdJbmZvLCAiJXM6ICVzIGNhbGxlZC5cbiIsIGRldi0+bmFtZSwgX19mdW5jX18pOwogCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2NvbmZpZworCXJldHVybiAwOworfQkJCQkvKiB3bF9jb25maWcgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTIyNCw0OCArMTk5LDQ3IEBACiAgKiAgICAgIHN0YXRpc3RpY3MuCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICp3bF9zdGF0cyggc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyAqd2xfc3RhdHMoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50OwotI2VuZGlmICAvKiBVU0VfV0RTICovCi0gICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgIGZs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5VTV9XRFNfUE9SVFM7IGNvdW50KysgKSB7Ci0JaWYoIGRldiA9PSBscC0+d2RzX3BvcnRbY291bnRdLmRldiApIHsKLQkgICAgcFN0YXRzID0gJiggbHAtPndkc19wb3J0W2NvdW50XS5zdGF0cyApOworCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJaWYgKGRldiA9PSBscC0+d2RzX3BvcnRbY291bnRdLmRldikKKwkJCXBTdGF0cyA9ICYobHAtPndkc19wb3J0W2NvdW50XS5zdGF0cyk7CiAJfQotICAgIH0KIAotI2VuZGlmICAvKiBVU0VfV0RTICovCisjZW5kaWYgLyogVVNFX1dEUyAqLwogCi0gICAgLyogSWYgcFN0YXRzIGlzIHN0aWxsIE5VTEwsIHRoZW4gdGhlIGRldmljZSBpcyBub3QgYSBXRFMgcG9ydCAqLwotICAgIGlmKCBwU3RhdHMgPT0gTlVMTCApIHsKLSAgICAgICAgcFN0YXRzID0gJiggbHAtPnN0YXRzICk7Ci0gICAgfQorCS8qIElmIHBTdGF0cyBpcyBzdGlsbCBOVUxMLCB0aGVuIHRoZSBkZXZpY2UgaXMgbm90IGEgV0RTIHBvcnQgKi8KKwlpZiAocFN0YXRzID09IE5VTEwpCisJCXBTdGF0cyA9ICYobHAtPnN0YXRzKTsKIAotICAgIHdsX3VubG9jayggbHAsICZmbGFncyApOworCXdsX3VubG9jayhscCwgJmZsYWdzKTsKIAotICAgIHJldHVybiBwU3RhdHM7Ci19IC8vIHdsX3N0YXRzCisJcmV0dXJuIHBTdGF0czsKK30JCQkJLyogd2xfc3RhdHMgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTI4O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kVUSUZfU1RBUlRfUVVFVUUobHApOworCX0gZWxzZSB7CisJCXdsX2hjZl9lcnJvcihkZXYsIHN0YXR1cyk7CS8qIFJlcG9ydCB0aGUgZXJyb3IgKi8KKwkJbmV0aWZfZGV2aWNlX2RldGFjaChkZXYpOwkvKiBTdG9wIHRoZSBkZXZpY2UgYW5kIHF1ZXVlICovCisJfQogCi0gICAgd2xfdW5sb2NrKCBscCwgJmZsYWdzICk7CisJd2xfdW5sb2NrKGxwLCAmZmxhZ3MpOwogCi0gICAgcmV0dXJuIHN0YXR1czsKLX0gLy8gd2xfb3BlbgorCXJldHVybiBzdGF0dXM7Cit9CQkJCS8qIHdsX29wZW4gKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTM3Nyw3MyArMzUzLDcwIEBACiAgKiAgICAgIGVycm5vIG90aGVyd2lzZQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfY2xvc2UoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX2Nsb3NlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgc3RydWN0IHdsX3ByaXZhdGUgICAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOwogCi0gICAgREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOworCUR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JQSBGSVhNRSIpOworCX0KK30JCQkJLyogd2xfZ2V0X2RydmluZm8gKi8KIAogc3RhdGljIHN0cnVjdCBldGh0b29sX29wcyB3bF9ldGh0b29sX29wcyA9IHsKLSAgICAuZ2V0X2RydmluZm8gPSB3bF9nZXRfZHJ2aW5mbywKLSAgICAuZ2V0X2xpbmsgPSBldGh0b29sX29wX2dldF9saW5rLAorCS5nZXRfZHJ2aW5mbyA9IHdsX2dldF9kcnZpbmZvLAorCS5nZXRfbGluayA9IGV0aHRvb2xfb3BfZ2V0X2xpbmssCiB9OwogCi0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgl3bF9pb2N0bCgpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNDY0LDgxICs0MzcsODYgQEAKICAqICAgICAgZXJybm8gdmFsdWUgb3RoZXJ3aXNlCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9pb2N0bCggc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCApCitpbnQgd2xfaW9jdGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCkKIHsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgKmxwID0gd2xfcHJpdihkZXYpOwotICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIGZsYWdzOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgIHJldCA9IDA7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJa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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNjI2LDEwMyArNjA1LDEwNSBAQAogICogICAgICAxIG9uIGVycm9yCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9zZW5kKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQoraW50IHdsX3NlbmQoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewogCi0gICAgaW50ICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgREVTQ19TVFJDVCAgICAgICAgICAqZGVzYzsKLSAgICBXVkxBTl9MRlJBTUUgICAgICAgICp0eEYgPSBOVUxMOwotICAgIHN0cnVjdCBsaXN0X2hlYWQgICAgKmVsZW1lbnQ7Ci0gICAgaW50ICAgICAgICAgICAgICAgICBsZW47CisJaW50IHN0YXR1czsKKwlERVNDX1NUUkNUICpkZXNjOworCVdWTEFOX0xGUkFNRSAqdHhGID0gTlVMTDsKKwlzdHJ1Y3QgbGlzdF9oZWFkICplbGVtZW50OworCWludCBsZW47CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0gICAgaWYoIGxwID09IE5VTEwgKSB7Ci0gICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIlByaXZhdGUgYWRhcHRlciBzdHJ1Y3QgaXMgTlVMTFxuIiApOwotICAgICAgICByZXR1cm4gRkFMU0U7Ci0gICAgfQotICAgIGlmKCBscC0+ZGV2ID09IE5VTEwgKSB7Ci0gICAgICAgIERCR19FUlJPUi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CBscC0+dHhRX2NvdW50IDwgVFhfUV9MT1dfV0FURVJfTUFSSyApIHsKLSAgICAgICAgICAgICAgICBpZiggbHAtPm5ldGlmX3F1ZXVlX29uID09IEZBTFNFICkgewotICAgICAgICAgICAgICAgICAgICBEQkdfVFgoIERiZ0luZm8sICJLaWNrc3RhcnRpbmcgUTogJWRcbiIsIGxwLT50eFFfY291bnQgKTsKLSAgICAgICAgICAgICAgICAgICAgbmV0aWZfd2FrZV9xdWV1ZSggbHAtPmRldiApOwotICAgICAgICAgICAgICAgICAgICBXTF9XRFNfTkVUSUZfV0FLRV9RVUVVRSggbHAgKTsKLSAgICAgICAgICAgICAgICAgICAgbHAtPm5ldGlmX3F1ZXVlX29uID0gVFJVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9CisJCQlpZiAobHAtPnR4UV9jb3VudCA8IFRYX1FfTE9XX1dBVEVSX01BUkspIHsKKwkJCQlpZiAobHAtPm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJCURCR19UWChEYmdJbmZvLCAiS2lja3N0YXJ0aW5nIFE6ICVkXG4iLAorCQkJCQkgICAgICAgbHAtPnR4UV9jb3VudCk7CisJCQkJCW5ldGlmX3dha2VfcXVldWUobHAtPmRldik7CisJCQkJCVdMX1dEU19ORVRJRl9XQUtFX1FVRVVFKGxwKTsKKwkJCQkJbHAtPm5ldGlmX3F1ZXVlX29uID0gVFJVRTsKKwkJCQl9CisJCQl9CisJCX0KKwl9CiAKLSAgICBpZiggbHAtPnR4Ri5za2IgPT0gTlVMTCApIHsKLSAgICAgICAgcmV0dXJuIEZBTFNFOwotICAgIH0KKwlpZiAobHAtPnR4Ri5za2IgPT0gTlVMTCkKKwkJcmV0dXJuIEZBTFNFOwogCi0gICAgLyogSWYgdGhlIGRldmljZSBoYXMgcmVzb3VyY2VzIChGSURzKSBhdmFpbGFibGUsIHRoZW4gVHggdGhlIHBhY2tldCAqLwotIC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KKyNlbmRpZiAvKiBVU0VfV0RTICovCiAKLSAgICAgICAgLyogRnJlZSB0aGUgc2tiIGFuZCBwZXJmb3JtIHF1ZXVlIGNsZWFudXAsIGFzIHRoZSBidWZmZXIgd2FzCi0gICAgICAgICAgICB0cmFuc21pdHRlZCBzdWNjZXNzZnVsbHkgKi8KLSAgICAgICAgZGV2X2tmcmVlX3NrYiggbHAtPnR4Ri5za2IgKTsKKwkJLyogRnJlZSB0aGUgc2tiIGFuZCBwZXJmb3JtIHF1ZXVlIGNsZWFudXAsIGFzIHRoZSBidWZmZXIgd2FzCisJCSAgIHRyYW5zbWl0dGVkIHN1Y2Nlc3NmdWxseSAqLworCQlkZXZfa2ZyZWVfc2tiKGxwLT50eEYuc2tiKTsKIAotICAgICAgICBscC0+dHhGLnNrYiA9IE5VTEw7Ci0gICAgICAgIGxwLT50eEYucG9ydCA9IDA7Ci0gICAgfQorCQlscC0+dHhGLnNrYiA9IE5VTEw7CisJCWxwLT50eEYucG9ydCA9IDA7CisJfQogCi0gICAgcmV0dXJuIFRSVUU7Ci19IC8vIHdsX3NlbmQKKwlyZXR1cm4gVFJVRTsKK30JCQkJLyogd2xfc2VuZCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNzQ0LDc1ICs3MjUsNzQgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHgoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGludCBwb3J0ICkKK2ludCB3bF90eChzdHJ1Y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9ja2VkXG4iKTsKKwkJLyogU3RhcnQgZHJvcHBpbmcgcGFja2V0cyBoZXJlPz8/ICovCisJCXdsX3VubG9jayhscCwgJmZsYWdzKTsKKwkJcmV0dXJuIDE7CisJfQogI2lmZGVmIFVTRV9SVFMKLSAgICBpZiggbHAtPnVzZVJUUyA9PSAxICkgewotICAgICAgICBEQkdfUFJJTlQoICJSVFM6IHdlJ3JlIGdldHRpbmcgYSBUeC4uLlxuIiApOwotCXdsX3VubG9jayggbHAsICZmbGFncyApOwotICAgICAgICByZXR1cm4gMTsKLSAgICB9Ci0jZW5kaWYgIC8qIFVTRV9SVFMgKi8KKwlpZiAobHAtPnVzZVJUUyA9PSAxKSB7CisJCURCR19QUklOVCgiUlRTOiB3ZSdyZSBnZXR0aW5nIGEgVHguLi5cbiIpOworCQl3bF91bmxvY2sobHAsICZmbGFncyk7CisJCXJldHVybiAxOworCX0KKyNlbmRpZiAvKiBVU0VfUlRTICovCiAKLSAgICBpZiggIWxwLT51c2VfZG1hICkgewotICAgICAgICAvKiBHZXQgYW4gZWxlbWVudCBmcm9tIHRoZSBxdWV1ZSAqLwotICAgICAgICBlbGVtZW50ID0gbHAtPnR4RnJlZS5uZXh0OwotICAgICAgICB0eEYgPSAoV1ZMQU5fTEZSQU1FICopbGlzdF9lbnRyeSggZWxlbWVudCwgV1ZMQU5fTEZSQU1FLCBub2RlICk7Ci0gICAgICAgIGlmKCB0eEYgPT0gTlVMTCApIHsKLSAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIlByb2JsZW0gd2l0aCBsaXN0X2VudHJ5XG4iICk7Ci0JICAgIHdsX3VubG9jayggbHAsICZmbGFncyApOwotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgLyogRmlsbCBvdXQgdGhlIGZyYW1lICovCi0gICAgICAgIHR4Ri0+ZnJhbWUuc2tiID0gc2tiOwotICAgICAgICB0eEYtPmZyYW1lLnBvcnQgPSBwb3J0OwotICAg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HAsIHNrYiwgcG9ydCk7CisJfSBlbHNlCiAjZW5kaWYKLSAgICB7Ci0gICAgICAgIHdsX3NlbmQoIGxwICk7Ci0gICAgfQotICAgIC8qIFJlLWVuYWJsZSBJbnRlcnJ1cHRzLCByZWxlYXNlIHRoZSBzcGlubG9jayBhbmQgcmV0dXJuICovCi0gICAgd2xfYWN0X2ludF9vbiggbHAgKTsKLSAgICB3bF91bmxvY2soIGxwLCAmZmxhZ3MgKTsKLSAgICByZXR1cm4gMDsKLX0gLy8gd2xfdHgKKwl7CisJCXdsX3NlbmQobHApOworCX0KKwkvKiBSZS1lbmFibGUgSW50ZXJydXB0cywgcmVsZWFzZSB0aGUgc3BpbmxvY2sgYW5kIHJldHVybiAqLworCXdsX2FjdF9pbnRfb24obHApOworCXdsX3VubG9jayhscCwgJmZsYWdzKTsKKwlyZXR1cm4gMDsKK30JCQkJLyogd2xfdHggKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTgzNSw2NyArODE1LDY4IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50IHdsX3J4KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBzdHJ1Y3Qgc2tfYnVmZiAgICAgICAgICAqc2tiOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICpscCA9IHdsX3ByaXYoZGV2KTsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgaGNmXzE2ICAgICAgICAgICAgICAgICAgcGt0bGVuO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Y2FzZSA1OgotICAgICAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJY2FzZSAxOgorCQkJCWNhc2UgMjoKKwkJCQljYXNlIDM6CisJCQkJY2FzZSA0OgorCQkJCWNhc2UgNToKKwkJCQljYXNlIDY6CisJCQkJCXNrYi0+ZGV2ID0gbHAtPndkc19wb3J0W3BvcnQgLSAxXS5kZXY7CisJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWNhc2UgMDoKKwkJCQlkZWZhdWx0OgorCQkJCQlza2ItPmRldiA9IGRldjsKKwkJCQkJYnJlYWs7CisJCQkJfQogCi0gICAgICAgICAgICAgICAgZGVzYyA9ICYoIGxwLT5kZXNjX3J4ICk7CisJCQkJZGVzYyA9ICYobHAtPmRlc2NfcngpOwogCi0gICAgICAgICAgICAgICAgZGVzYy0+bmV4dF9kZXNjX2FkZHIgPSBOVUxMOworCQkJCWRlc2MtPm5leHRfZGVzY19hZGRyID0gTlVMTDsKIAogLyoKICNkZWZpbmUgQkxPQ0tfSU5QVVQoYnVmLCBsZW4pIFwKQEAgLTkwNCw2NyArODg1LDczIEBACiAgICAgc3RhdHVzID0gaGNmX3Jjdl9tc2coJihscC0+aGNmQ3R4KSwgZGVzYywgMCkKICovCiAKLSAgICAgICAgICAgICAgICBHRVRfUEFDS0VUKCBza2ItPmRldiwgc2tiLCBwa3RsZW4gKTsKKwkJCQlHRVRfUEFDS0VUKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICBpZiggc3RhdHVzID09IEhDRl9TVUNDRVNTICkgewotICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJaWYgKHN0YXR1cyA9PSBIQ0ZfU1VDQ0VTUykgeworCQkJCQluZXRpZl9yeChza2IpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfcGFja2V0cysrOwotICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKLSAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9ieXRlcyArPSBwa3RsZW47Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLworCQkJCQllbHNlIHsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X3BhY2tldHMrKzsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICBkZXYtPmxhc3RfcnggPSBqaWZmaWVzOworCQkJCQlkZXYtPmxhc3RfcnggPSBqaWZmaWVzOwogCiAjaWZkZWYgV0lSRUxFU1NfRVhUCiAjaWZkZWYgV0lSRUxFU1NfU1BZCi0gICAgICAgICAgICAgICAgICAgIGlmKCBscC0+c3B5ZGF0YS5zcHlfbnVtYmVyID4gMCApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKnNyY2FkZHIgPSBza2ItPm1hYy5yYXcgKyBNQUNfQUREUl9TSVpFOworCQkJCQlpZiAobHAtPnNweWRhdGEuc3B5X251bWJlciA+IDApIHsKKwkJCQkJCWNoYXIgKnNyY2FkZHIgPQorCQkJCQkJICAgIHNrYi0+bWFjLnJhdyArCisJCQkJCQkgICAgTUFDX0FERFJfU0laRTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgd2xfc3B5X2dhdGhlciggZGV2LCBzcmNhZGRyICk7Ci0gICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJCXdsX3NweV9nYXRoZXIoZGV2LCBzcmNhZGRyKTsKKwkJCQkJfQogI2VuZGlmIC8qIFdJUkVMRVNTX1NQWSAqLwogI2VuZGlmIC8qIFdJUkVMRVNTX0VYVCAqLwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIgKTsKKwkJCQl9IGVsc2UgeworCQkJCQlEQkdfRVJST1IoRGJnSW5mbywKKwkJCQkJCSAgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfZHJvcHBlZCsrOwotICAgICAgICAgICAgICAgICAgICB9CisJCQkJCWlmIChwb3J0ID09IDApCisJCQkJCQlscC0+c3RhdHMucnhfZHJvcHBlZCsrOwogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLworCQkJCQllbHNlIHsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X2Ryb3BwZWQrKzsKKwkJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiKCBza2IgKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIkNvdWxkIG5vdCBhbGxvYyBza2JcbiIgKTsKKwkJCQkJZGV2X2tmcmVlX3NrYihza2IpOworCQkJCX0KKwkJCX0gZWxzZSB7CisJCQkJREJHX0VSUk9SKERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWlmIChwb3J0ID09IDApCisJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICB9Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KKwkJCQllbHNlIHsKKwkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJICAgICAxXS5zdGF0cy5yeF9kcm9wcGVkKys7CisJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KKwkJCX0KKwkJfQorCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeAorCXJldHVybiAwOworfQkJCQkvKiB3bF9yeCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtOTg2LDE0MiArOTczLDE1OSBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KICNpZmRlZiBORVdfTVVMVElDQVNUCiAKLXZvaWQgd2xfbXVsdGljYXN0KCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK3ZvaWQgd2xfbXVsdGljYXN0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0jaWYgMSAvLzs/IChIQ0ZfVFlQRSkgJiBIQ0ZfVFlQRV9TVEEgLy87P3Nob3VsZCB3ZSByZXR1cm4gYW4gZXJyb3Igc3RhdHVzIGluIEFQIG1vZGUKLS8vOz9zZWVtcyByZWFzb25hYmxlIHRoYXQgZXZlbiBhbiBBUC1vbmx5IGRyaXZlciBjb3VsZCBhZmZvcmQgdGhpcyBzbWFsbCBhZGRpdGlvbmFsIGZvb3RwcmludAorI2lmIDEJCQkJLyogKEhDRl9UWVBFKSAm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sKLSAgICAgICAgICAgIERCR19UUkFDRSggRGJnSW5mbywgIlNraXBwaW5nIG11bHRpY2FzdCwgaW4gUlRTIG1vZGVcbiIgKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotI2VuZGlmICAvKiBVU0VfUlRTICovCisJCWlmIChscC0+dXNlUlRTID09IDEpIHsKKwkJCURCR19UUkFDRShEYmdJbmZvLCAiU2tpcHBpbmcgbXVsdGljYXN0LCBpbiBSVFMgbW9kZVxuIik7CisJCQlyZXR1cm47CisJCX0KKyNlbmRpZiAvKiBVU0VfUlRTICovCiAKLSAgICAgICAgd2xfbG9jayggbHAsICZmbGFncyApOwotICAgICAgICB3bF9hY3RfaW50X29mZiggbHAgKTsKKwkJd2xfbG9jayhscCwgJmZsYWdzKTsKKwkJd2xfYWN0X2ludF9vZmYobHApOwogCi0JCWlmICggQ05WX0lOVF9UT19MSVRUTEUoIGxwLT5oY2ZDdHguSUZCX0ZXSWRlbnRpdHkuY29tcF9pZCApID09IENPTVBfSURfRldfU1RBICApIHsKLSAgICAgICAgICAgIGlmKCBkZXYtPmZsYWdzICYgSUZGX1BST01JU0MgKSB7Ci0gICAgICAgICAgICAgICAgLyogRW5hYmxlIHByb21pc2N1b3VzIG1vZGUgKi8KLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLmxlbiAgICAgICA9IDI7Ci0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC50eXAgICAgICAgPSBDRkdfUFJPTUlTQ1VPVVNfTU9ERTsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAxICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgUHJvbWlzY3VvdXMgbW9kZSAoSUZGX1BST01JU0MpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICgobmV0ZGV2X21jX2NvdW50KGRldikgPiBIQ0ZfTUFYX01VTFRJQ0FTVCkgfHwKLSAgICAgICAgICAgICAgICAgICAgKCBkZXYtPmZsYWdzICYgSUZGX0FMTE1VTFRJICkpIHsKLSAgICAgICAgICAgICAgICAvKiBTaHV0dGluZyBvZmYgdGhpcyBmaWx0ZXIgd2lsbCBlbmFibGUgYWxsIG11bHRpY2FzdCBmcmFtZXMgdG8KLSAgICAgICAgICAgICAgICAgICBiZSBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsIHNvCi0gICAgICAgICAgICAgICAgICAgYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAwICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgYWxsIG11bHRpY2FzdCBtb2RlIChJRkZfQUxMTVVMVEkpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICAgICAgd2xfYXBwbHkoIGxwICk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICghbmV0ZGV2X21jX2VtcHR5KGRldikpIHsKLSAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIG11bHRpY2FzdCBhZGRyZXNzZXM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obHAtPmx0dlJlY29yZCkpOwogCi0gICAgICAgICAgICAgICAgLyogRGlzYWJsZSBtdWx0aWNhc3QgbW9kZSAqLwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQubGVuID0gMjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnR5cCA9IENGR19HUk9VUF9BRERSOwotICAgICAgICAgICAgICAgIERCR19QUklOVCggIkRpc2FibGluZyBNdWx0aWNhc3QgbW9kZVxuIiApOwotICAgICAgICAgICAgICAgIGhjZl9wdXRfaW5mbyggJiggbHAtPmhjZkN0eCApLCAoTFRWUCkmKCBscC0+bHR2UmVjb3JkICkpOworCQkJCS8qIERpc2FibGUgbXVsdGljYXN0IG1vZGUgKi8KKwkJCQlscC0+bHR2UmVjb3JkLmxlbiA9IDI7CisJCQkJbHAtPmx0dlJlY29yZC50eXAgPSBDRkdfR1JPVVBfQUREUjsKKwkJCQlEQkdfUFJJTlQoIkRpc2FibGluZyBNdWx0aWNhc3QgbW9kZVxuIik7CisJCQkJaGNmX3B1dF9pbmZvKCYobHAtPmhjZkN0eCksCisJCQkJCSAgICAgKExUVlApICYgKGxwLT5sdHZSZWNvcmQpKTsKIAotICAgICAgICAgICAgICAgIC8qIFR1cm5pbmcgb24gdGhpcyBmaWx0ZXIgd2lsbCBwcmV2ZW50IGFsbCBtdWx0aWNhc3QgZnJhbWVzIGZyb20KLSAgICAgICAgICAgICAgICAgICBiZWluZyBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsCi0gICAgICAgICAgICAgICAgICAgc28gYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgIC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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAjZW5kaWYgLyogTkVXX01VTFRJQ0FTVCAqLwogCi1zdGF0aWMgY29uc3Qgc3RydWN0IG5ldF9kZXZpY2Vfb3BzIHdsX25ldGRldl9vcHMgPQotewotICAgIC5uZG9fc3RhcnRfeG1pdCAgICAgICAgID0gJndsX3R4X3BvcnQwLAorc3RhdGljIGNvbnN0IHN0cnVjdCBuZXRfZGV2aWNlX29wcyB3bF9uZXRkZXZfb3BzID0geworCS5uZG9fc3RhcnRfeG1pdCA9ICZ3bF90eF9wb3J0MCwKIAotICAgIC5uZG9fc2V0X2NvbmZpZyAgICAgICAgID0gJndsX2NvbmZpZywKLSAgICAubmRvX2dldF9zdGF0cyAgICAgICAgICA9ICZ3bF9zdGF0cywKLSAgICAubmRvX3NldF9yeF9tb2RlICAgICAgICA9ICZ3bF9tdWx0aWNhc3QsCisJLm5kb19zZXRfY29uZmlnID0gJndsX2NvbmZpZywKKwkubmRvX2dldF9zdGF0cyA9ICZ3bF9zdGF0cywKKwkubmRvX3NldF9yeF9tb2RlID0gJndsX211bHRpY2FzdCwKIAotICAgIC5uZG9faW5pdCAgICAgICAgICAgICAgID0gJndsX2luc2VydCwKLSAgICAubmRvX29wZW4gICAgICAgICAgICAgICA9ICZ3bF9hZGFwdGVyX29wZW4sCi0gICAgLm5kb19zdG9wICAgICAgICAgICAgICAgPSAmd2xfYWRhcHRlcl9jbG9zZSwKLSAgICAubmRvX2RvX2lvY3RsICAgICAgICAgICA9ICZ3bF9pb2N0bCwKKwkubmRvX2luaXQgPSAmd2xfaW5zZXJ0LAorCS5uZG9fb3BlbiA9ICZ3bF9hZGFwdGVyX29wZW4sCisJLm5kb19zdG9wID0gJndsX2FkYXB0ZXJfY2xvc2UsCisJLm5kb19kb19pb2N0bCA9ICZ3bF9pb2N0bCwKIAotICAgIC5uZG9fdHhfdGltZW91dCAgICAgICAgID0gJndsX3R4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JLyogd2xfZGV2aWNlX2FsbG9jICovCiAKLSAgICByZXR1cm4gZGV2OwotfSAvLyB3bF9kZXZpY2VfYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjA2LDE1ICsxMjEzLDE0IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2RldmljZV9kZWFsbG9jKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK3ZvaWQgd2xfZGV2aWNlX2RlYWxsb2Moc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLS8vICAgIHN0cnVjdCB3bF9wcml2YXRlICAgKmxwID0gd2xfcHJpdihkZXYpOworCS8qIERlYWxsb2MgdGhlIFdEUyBwb3J0cyAqLworCVdMX1dEU19ERVZJQ0VfREVBTExPQyhscCk7CiAKLSAgICAvKiBEZWFsbG9jIHRoZSBXRFMgcG9ydHMgKi8KLSAgICBXTF9XRFNfREVWSUNFX0RFQUxMT0MoIGxwICk7CisJZnJlZV9uZXRkZXYoZGV2KTsKK30JCQkJLyogd2xfZGV2aWNlX2RlYWxsb2MgKi8KIAotICAgIGZyZWVfbmV0ZGV2KCBkZXYgKTsKLX0gLy8gd2xfZGV2aWNlX2RlYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjM1LDE1ICsxMjQxLDE2IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDAoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQwKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAwXG4iICk7CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDBcbiIpOwogCi0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMCApOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjaWZkZWYgRU5BQkxFX0RNQQotICAgIHJldHVybiB3bF90eF9kbWEoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8wICk7CisJcmV0dXJuIHdsX3R4X2RtYShza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjZW5kaWYKLX0gLy8gd2xfdHhfcG9ydDAKK30JCQkJLyogd2xfdHhfcG9ydDBpICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKICNpZmRlZiBVU0VfV0RTCkBAIC0xMjY2LDExICsxMjczLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDEoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQxKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMSApOwotfSAvLyB3bF90eF9wb3J0MQorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzEpOworfQkJCQkvKiB3bF90eF9wb3J0MSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTI5MSwxMSArMTI5OSwxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQyKCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0MihzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzIgKTsKLX0gLy8gd2xfdHhfcG9ydDIKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF8yKTsKK30JCQkJLyogd2xfdHhfcG9ydDIgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzMTYsMTEgKzEzMjUsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Myggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDMoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8zICk7Ci19IC8vIHdsX3R4X3BvcnQzCisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMyk7Cit9CQkJCS8qIHdsX3R4X3BvcnQzICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMzQxLDExICsxMzUxLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDQoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQ0KHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfNCApOwotfSAvLyB3bF90eF9wb3J0NAorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzQpOworfQkJCQkvKiB3bF90eF9wb3J0NCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTM2NiwxMSArMTM3NywxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQ1KCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0NShzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzUgKTsKLX0gLy8gd2xfdHhfcG9ydDUKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF81KTsKK30JCQkJLyogd2xfdHhfcG9ydDUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzOTEsMTEgKzE0MDMsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Niggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDYoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF82ICk7Ci19IC8vIHdsX3R4X3BvcnQ2CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfNik7Cit9CQkJCS8qIHdsX3R4X3BvcnQ2ICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDE3LDUwICsxN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bHAtPndkc19wb3J0WzFdLmRldi0+aGFyZF9zdGFydF94bWl0ID0gJndsX3R4X3BvcnQyOworCWxwLT53ZHNfcG9ydFsyXS5kZXYtPmhhcmRfc3RhcnRfeG1pdCA9ICZ3bF90eF9wb3J0MzsKKwlscC0+d2RzX3BvcnRbM10uZGV2LT5oYXJkX3N0YXJ0X3htaXQgPSAmd2xfdHhfcG9ydDQ7CisJbHAtPndkc19wb3J0WzRdLmRldi0+aGFyZF9zdGFydF94bWl0ID0gJndsX3R4X3BvcnQ1OworCWxwLT53ZHNfcG9ydFs1XS5kZXYtPmhhcmRfc3RhcnRfeG1pdCA9ICZ3bF90eF9wb3J0NjsKIAotICAgIFdMX1dEU19ORVRJRl9TVE9QX1FVRVVFKCBscCApOwotfSAvLyB3bF93ZHNfZGV2aWNlX2FsbG9jCisJV0xfV0RTX05FVElGX1NUT1BfUVVFVUUobHApOworfQkJCQkvKiB3bF93ZHNfZGV2aWNlX2FsbG9jICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDgwLDI2ICsxNDk1LDI3IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19kZXZpY2VfZGVhbGxvYyggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX2RldmljZV9kZWFsbG9jKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogCi0gICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1J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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNTIwLDIxICsxNTM2LDIyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3N0YXJ0X3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gRkFMU0UgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfc3RhcnRfcXVldWUoIGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ICk7Ci0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19IC8vIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfc3RhcnRfcXVldWUobHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQkJCWxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RhcnRfcXVldWUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTE1NTUsMjEgKzE1NzIsMjIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfd2RzX25ldGlmX3N0b3BfcXVldWUoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9zdG9wX3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gVFJVRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBGQUxTRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX3N0b3BfcXVldWUKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCisJCQkgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBUUlVFKSB7CisJCQkJbmV0aWZfc3RvcF9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IEZBTFNFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RvcF9xdWV1ZSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTU5MCwyMSArMTYwOCwyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3dha2VfcXVldWUoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewotICAgIGludCBjb3VudDsKKwlpbnQgY291bnQ7CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0gICAgaWYoIGxwICE9IE5VTEwgKSB7Ci0gICAgICAgIGZvciggY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KysgKSB7Ci0gICAgICAgICAgICBpZiggbHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCi0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBGQUxTRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfSAvLyB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfd2FrZV9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7CisJCQl9CisJCX0KKwl9Cit9CQkJCS8qIHdsX3dkc19uZXRpZl93YWtlX3F1ZXVlICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNjI1LDE5ICsxNjQ0LDE5IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29uKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQordm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7Ci0gICAgaW50IGNvdW50OworCWludCBjb3VudDsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBpZiggbHAgIT0gTlVMTCApIHsKLSAgICAgICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1JUUzsgY291bnQrKyApIHsKLSAgICAgICAgICAgIGlmKCBscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vbiggbHAtPndkc19wb3J0W2NvdW50XS5kZXYgKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX2NhcnJpZXJfb24KKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQorCQkJCW5ldGlmX2NhcnJpZXJfb24obHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbiAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTY1OCwyMSArMTY3NywyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29mZihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7CiAJaW50IGNvdW50OwogCi0JaWYobHAgIT0gTlVMTCkgewotCQlmb3IoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKLQkJCWlmKGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCkKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQogCQkJCW5ldGlmX2NhcnJpZXJfb2ZmKGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2KTsKIAkJfQogCX0KIAotfSAvLyB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYKK30JCQkJLyogd2xfd2RzX25ldGlmX2NhcnJpZXJfb2ZmICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKLSNlbmRpZiAgLyogVVNFX1dEUyAqLworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAogI2lmZGVmIEVOQUJMRV9ETUEKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNjk1LDcwICsxNzE1LDcxIEBACiAgKiAgICAgIDEgb24gZXJyb3IKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3NlbmRfZG1hKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAsIHN0cnVjdCBza19idWZmICpza2IsIGludCBwb3J0ICkKK2ludCB3bF9zZW5kX2RtYShzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAsIHN0cnVjdCBza19idWZmICpza2IsIGludCBwb3J0KQogewotICAgIGludCAgICAgICAgIGxlbjsKLSAgICBERVNDX1NUUkNUICpkZXNjID0gTlVMTDsKLSAgICBERVNDX1NUUkNUICpkZXNjX25leHQgPSBOVUxMOworCWludCBsZW47CisJREVTQ19TVFJDVCAqZGVzYyA9IE5VTEw7CisJREVTQ19TVFJDVCAqZGVzY19uZXh0ID0gTlVMTDsKICAgICAvKi0tLS0tLS0tLS0tLS0t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HV0KCAmKCBscC0+aGNmQ3R4ICksIGRlc2MsIDAgKTsKKwloY2ZfZG1hX3R4X3B1dCgmKGxwLT5oY2ZDdHgpLCBkZXNjLCAwKTsKIAotICAgIC8qIEZyZWUgdGhlIHNrYiBhbmQgcGVyZm9ybSBxdWV1ZSBjbGVhbnVwLCBhcyB0aGUgYnVmZmVyIHdhcwotICAgICAgICAgICAgdHJhbnNtaXR0ZWQgc3VjY2Vzc2Z1bGx5ICovCi0gICAgZGV2X2tmcmVlX3NrYiggc2tiICk7CisJLyogRnJlZSB0aGUgc2tiIGFuZCBwZXJmb3JtIHF1ZXVlIGNsZWFudXAsIGFzIHRoZSBidWZmZXIgd2FzCisJICAgdHJhbnNtaXR0ZWQgc3VjY2Vzc2Z1bGx5ICovCisJZGV2X2tmcmVlX3NrYihza2IpOwogCi0gICAgcmV0dXJuIFRSVUU7Ci19IC8vIHdsX3NlbmRfZG1hCisJcmV0dXJuIFRSVUU7Cit9CQkJCS8qIHdsX3NlbmRfZG1hICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNzc5LDE0NyArMTgwMCwxNTIgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfcnhfZG1hKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF9yeF9kbWEoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBoY2ZfMTYgICAgICAgICAgICAgICAgICAgcGt0bGV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iAtRUlPOwotICAgICAgICB9Ci0jZW5kaWYgIC8qIFVTRV9SVFMgKi8KKwkJaWYgKGxwLT51c2VSVFMgPT0gMSkgeworCQkJREJHX1BSSU5UKCJSVFM6IFdlJ3JlIGdldHRpbmcgYW4gUnguLi5cbiIpOworCQkJcmV0dXJuIC1FSU87CisJCX0KKyNlbmRpZiAvKiBVU0VfUlRTICovCiAKLSAgICAgICAgLy9pZiggbHAtPmRtYS5zdGF0dXMgPT0gMCApCi0gICAgICAgIC8vewotICAgICAgICAgICAgZGVzYyA9IGhjZl9kbWFfcnhfZ2V0KCAmKCBscC0+aGNmQ3R4ICkpOworCQkvKgorCQkgKmlmKCBscC0+ZG1hLnN0YXR1cyA9PSAwICkKKwkJICp7CisJCSAqLworCQlkZXNjID0gaGNmX2RtYV9yeF9nZXQoJihscC0+aGNmQ3R4KSk7CiAKLSAgICAgICAgICAgIGlmKCBkZXNjICE9IE5VTEwgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIENoZWNrIGFuZCBzZWUgaWYgd2UgcmN2ZC4gYSBXTVAgZnJhbWUgKi8KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgIGlmKCgoICooaGNmXzggKikmZGVzYy0+YnVmX2FkZHJbSEZTX1NUQVRdICkgJgotICAgICAgICAgICAgICAgICAgICAoIEhGU19TVEFUX01TR19UWVBFIHwgSEZTX1NUQVRfRVJSICkpID09IEhGU19TVEFUX1dNUF9NU0cgKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgREJHX1RSQUNFKCBEYmdJbmZvLCAiR290IGEgV01QIGZyYW1lXG4iICk7CisJCWlmIChkZXNjICE9IE5VTEwpIHsKKwkJCS8qIENoZWNrIGFuZCBzZWUgaWYgd2UgcmN2ZC4gYSBXTVAgZnJhbWUgKi8KKwkJCS8qCisJCQkgICBpZigoKCAqKGhjZl84ICopJmRlc2MtPmJ1Zl9hZGRyW0hGU19TVEFUXSApICYKKwkJC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C8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCi0gICAgICAgICAgICAgICAgICAgIGhjZl9kbWFfcnhfcHV0KCAmKCBscC0+aGNmQ3R4ICksIGRlc2MgKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU87Ci0gICAgICAgICAgICAgICAgfQorCQkJCS8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCisJCQkJaGNmX2RtYV9yeF9wdXQoJihscC0+aGNmQ3R4KSwgZGVzYyk7CisJCQkJcmV0dXJuIC1FSU87CisJCQl9CiAKLSAgICAgICAgICAgICAgICAvKiBSZWFkIHRoZSBIRlNfU1RBVCByZWdpc3RlciBmcm9tIHRoZSBsb29rYWhlYWQgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgaGZzX3N0YXQgPSAoaGNmXzE2KSggZGVzYy0+YnVmX2FkZHJbSEZTX1NUQVQvMl0gKTsKKwkJCS8qIFJlYWQgdGhlIEhGU19TVEFUIHJlZ2lzdGVyIGZyb20gdGhlIGxvb2thaGVhZCBidWZmZXIgKi8KKwkJCWhmc19zdGF0ID0gKGhjZl8xNikgKGRlc2MtPmJ1Zl9hZGRyW0hGU19TVEFUIC8gMl0pOwogCi0gICAgICAgICAgICAgICAgLyogTWFrZSBzdXJlIHRoZSBmcmFtZSBpc24ndCBiYWQgKi8KLSAgICAgICAgICAgICAgICBpZigoIGhmc19zdGF0ICYgSEZTX1NUQVRfRVJSICkgIT0gSENGX1NVQ0NFU1MgKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgREJHX1dBUk5JTkcoIERiZ0luZm8sICJIRlNfU1RBVF9FUlJPUiAoMHgleCkgaW4gUnggUGFja2V0XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjLT5idWZfYWRkcltIRlNfU1RBVC8yXSApOworCQkJLyogTWFrZSBzdXJlIHRoZSBmcmFtZSB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DTlQoZGVzY19uZXh0KTsKLSAgICAgICAgICAgICAgICBpZiAocGt0bGVuICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChza2IgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKCBwb3J0ICkgeworCQkJcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKKwkJCWlmIChwa3RsZW4gIT0gMCkgeworCQkJCXNrYiA9IEFMTE9DX1NLQihwa3RsZW4pOworCQkJCWlmIChza2IgIT0gTlVMTCkgeworCQkJCQlzd2l0Y2ggKHBvcnQpIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KKwkJCQkJY2FzZSAxOgorCQkJCQljYXNlIDI6CisJCQkJCWNhc2UgMzoKKwkJCQkJY2FzZSA0OgorCQkJCQljYXNlIDU6CisJCQkJCWNhc2UgNjoKKwkJCQkJCXNrYi0+ZGV2ID0KKwkJCQkJCSAgICBscC0+d2RzX3BvcnRbcG9ydCAtIDFdLmRldjsKKwkJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJY2FzZSAwOgorCQkJCQlkZWZhdWx0OgorCQkJCQkJc2tiLT5kZXYgPSBkZXY7CisJCQkJCQlicmVhazsKKwkJCQkJfQogCi0gICAgICAgICAgICAgICAgICAgICAgICBHRVRfUEFDS0VUX0RNQSggc2tiLT5kZXYsIHNrYiwgcGt0bGVuICk7CisJCQkJCUdFVF9QQUNLRVRfRE1BKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCi0gICAgICAgICAgICAgICAgICAgICAgICBoY2ZfZG1hX3J4X3B1dCggJiggbHAtPmhjZkN0eCApLCBkZXNjICk7CisJCQkJCS8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCisJCQkJCWhjZl9kbWFfcnhfcHV0KCYobHAtPmhjZkN0eCksIGRlc2MpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJCW5ldGlmX3J4KHNrYik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X3BhY2tldHMrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W3BvcnQtMV0uc3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfcGFja2V0cysrOworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfYnl0ZXMgKz0gcGt0bGVuOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLwogCi0gICAgICAgICAgICAgICAgICAgICAgICBkZXYtPmxhc3RfcnggPSBqaWZmaWVzOworCQkJCQlkZXYtPmxhc3RfcnggPSBqaWZmaWVzOwogCi0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQkdfRVJST1IoIERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iICk7CisJCQkJfSBlbHNlIHsKKwkJCQkJREJHX0VSUk9SKERiZ0luZm8sCisJCQkJCQkgICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBvcnQgPT0gMCApCi0JICAgICAgICAgICAgICAgICAgICB7Ci0JICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLQkgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJaWYgKHBvcnQgPT0gMCkKKwkJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAvL30KLSAgICB9CisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfZHJvcHBlZCsrOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLworCQkJCX0KKwkJCX0KKwkJfQorCQkvKn0qLworCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeF9kbWEKKwlyZXR1cm4gMDsKK30JCQkJLyogd2xfcnhfZG1hICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0jZW5kaWYgIC8vIEVOQUJMRV9ETUEKKyNlbmRpZiAvKiBFTkFCTEVfRE1BICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMgYi9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMKaW5kZXggNGNhNmU0Mi4uNzUwMTljMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfdXRpbC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL3dsX3V0aWwuYwpAQCAtMTYxLDQzICsxNjEsNiBAQAogCiAKIAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoJcGVyY2VudCgpCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqICBERVNDUklQVElPTjoKLSAqCi0gKiAgICAgIFJldHVybiBhIHZhbHVlIGFzIGEgcGVyY2VudGFnZSBvZiBtaW4gdG8gbWF4LgotICoKLSAqICBQQVJBTUVURVJTOgotICoKLSAqICAgICAgdmFsdWUgICAtIHRoZSB2YWx1ZSBpbiBxdWVzdGlvbgotICogICAgICBtaW4gICAgIC0gdGhlIG1pbmltdW0gcmFuZ2UgdmFsdWUKLSAqICAgICAgbWF4ICAgICAtIHRoZSBtYXhpbXVtIHJhbmdlIHZhbHVlCi0gKgotICogIFJFVFVSTlM6Ci0gKgotICogICAgICB0aGUgcGVyY2VudGFnZSB2YWx1ZQotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgcGVyY2VudCggaW50IHZhbHVlLCBpbnQgbWluLCBpbnQgbWF4ICkKLXsKLSAgICAvKiBUcnVuY2F0ZSB0aGUgdmFsdWUgdG8gYmUgYmV0d2VlbiBtaW4gYW5kIG1heC4gKi8KLSAgICBpZiggdmFsdWUgPCBtaW4gKQotICAgICAgICB2YWx1ZSA9IG1pbjsKLQotICAgIGlmKCB2YWx1ZSA+IG1heCApCi0gICAgICAgIHZhbHVlID0gbWF4OwotCi0gICAgLyogUmV0dXJuIHRoZSB2YWx1ZSBhcyBhIHBlcmNlbnRhZ2Ugb2YgbWluIHRvIG1heC4gKi8KLSAgICByZXR1cm4gKCgoIHZhbHVlIC0gbWluICkgKiAxMDAgKSAvICggbWF4IC0gbWluICkpOwotfSAvLyBwZXJjZW50Ci0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0KLQotCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoJaXNfdmFsaWRfa2V5X3N0cmluZygpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd2V4dC5jIGIvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd2V4dC5jCmluZGV4IDE4N2ZjMDYuLjQ5ZWVlYWUgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL3dsX3dleHQuYworKysgYi9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF93ZXh0LmMKQEAgLTMzNTQsNyArMzM1NCw3IEBACiAJICAgdGhlIGNhbGwgdG8gd2lyZWxlc3Nfc2VuZF9ldmVudCgpIG11c3QgYWxzbyBwb2ludCB0byB3aGVyZSB0aGUgRVNTSUQKIAkgICBsaXZlcyAqLwogCXdycXUuZXNzaWQubGVuZ3RoICA9IHN0cmxlbiggbHAtPk5ldHdvcmtOYW1lICk7Ci0Jd3JxdS5lc3NpZC5wb2ludGVyID0gKGNhZGRyX3QpbHAtPk5ldHdvcmtOYW1lOworCXdycXUuZXNzaWQucG9pbnRlciA9ICh2b2lkIF9fdXNlciAqKWxwLT5OZXR3b3JrTmFtZTsKIAl3cnF1LmVzc2lkLmZsYWdzICAgPSAxOw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5kZXggYWUxN2RkZi4uMWJlMjZmZSAxMDA2NDQKLS0tIGEvZHJpdmVycy92aWRlby9NYWtlZmlsZQorKysgYi9kcml2ZXJzL3ZpZGVvL01ha2VmaWxlCkBAIC03NSw3ICs3NSw2IEBACiBvYmotJChDT05GSUdfRkJfUDkxMDApICAgICAgICAgICAgKz0gcDkxMDAubyBzYnVzbGliLm8KIG9iai0kKENPTkZJR19GQl9UQ1gpICAgICAgICAgICAgICArPSB0Y3gubyBzYnVzbGliLm8KIG9iai0kKENPTkZJR19GQl9MRU8pICAgICAgICAgICAgICArPSBsZW8ubyBzYnVzbGliLm8KLW9iai0kKENPTkZJR19GQl9TR0lWVykgICAgICAgICAgICArPSBzZ2l2d2ZiLm8KIG9iai0kKENPTkZJR19GQl9BQ09STikgICAgICAgICAgICArPSBhY29ybmZiLm8KIG9iai0kKENPTkZJR19GQl9BVEFSSSkgICAgICAgICAgICArPSBhdGFmYi5vIGMycF9pcGxhbjIubyBhdGFmYl9tZmIubyBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXRhZmJfaXBsYW4ycDIubyBhdGFmYl9pcGxhbjJwNC5vIGF0YWZiX2lwbGFuMnA4Lm8KQEAgLTE3Miw4ICsxNzEsNiBAQAogIyB0aGUgdGVzdCBmcmFtZWJ1ZmZlciBpcyBsYXN0CiBvYmotJChDT05GSUdfRkJfVklSVFVBTCkgICAgICAgICAgKz0gdmZiLm8KIAotI3ZpZGVvIG91dHB1dCBzd2l0Y2ggc3lzZnMgZHJpdmVyCi1vYmotJChDT05GSUdfVklERU9fT1VUUFVUX0NPTlRST0wpICs9IG91dHB1dC5vCiBvYmotJChDT05GSUdfVklERU9NT0RFX0hFTFBFUlMpICs9IGRpc3BsYXlfdGltaW5nLm8gdmlkZW9tb2RlLm8KIGlmZXEgKCQoQ09ORklHX09GKSx5KQogb2JqLSQoQ09ORklHX1ZJREVPTU9ERV9IRUxQRVJTKSArPSBvZl9kaXNwbGF5X3RpbWlu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aHQuaCBiL2luY2x1ZGUvYXNtLWdlbmVyaWMvYml0b3BzL2NvbnN0X2h3ZWlnaHQuaAppbmRleCBmYTJhNTBiLi4wYTdlMDY2IDEwMDY0NAotLS0gYS9pbmNsdWRlL2FzbS1nZW5lcmljL2JpdG9wcy9jb25zdF9od2VpZ2h0LmgKKysrIGIvaW5jbHVkZS9hc20tZ2VuZXJpYy9iaXRvcHMvY29uc3RfaHdlaWdodC5oCkBAIC01LDE0ICs1LDE1IEBACiAgKiBDb21waWxlIHRpbWUgdmVyc2lvbnMgb2YgX19hcmNoX2h3ZWlnaHROKCkKICAqLwogI2RlZmluZSBfX2NvbnN0X2h3ZWlnaHQ4KHcpCQlcCi0gICAgICAoCSghISgodykgJiAoMVVMTCA8PCAwKSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCAxKSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCAyKSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCAzKSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCA0KSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCA1KSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCA2KSkpICsJXAotCSghISgodykgJiAoMVVMTCA8PCA3KSkpCSkKKwkoKHVuc2lnbmVkIGludCkJCQlcCisJICgoISEoKHcpICYgKDFVTEwgPDwgMCkpKSArCVwKKwkgICghISgodykgJiAoMVVMTCA8PCAxKSkpICsJXAorCSAgKCEhKCh3KSAmICgxVUxMIDw8IDIpKSkgKwlcCisJICAoISEoKHcpICYgKDFVTEwgPDwgMykpKSArCVwKKwkgICghISgodykgJiAoMVVMTCA8PCA0KSkpICsJXAorCSAgKCEhKCh3KSAmICgxVUxMIDw8IDUpKSkgKwlcCisJICAoISEoKHcpICYgKDFVTEwgPDwgNikpKSArCVwKKwkgICghISgodykgJiAoMVVMTCA8PCA3KSkpKSkKIAogI2RlZmluZSBfX2NvbnN0X2h3ZWlnaHQxNih3KSAoX19jb25zdF9od2VpZ2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X2Zhc3RfYXNzaWduKAorCQlfX2Fzc2lnbl9zdHIobmFtZSwgbmFtZSk7CisJCV9fZW50cnktPnZhbCA9IHZhbDsKKwkpLAorCisJVFBfcHJpbnRrKCIlcyAweCU4Ljh4IiwgX19nZXRfc3RyKG5hbWUpLCAodW5zaWduZWQgaW50KV9fZW50cnktPnZhbCkKKworKTsKKworREVGSU5FX0VWRU5UKGlwYywgaXBjX3JlcXVlc3QsCisKKwlUUF9QUk9UTyhjb25zdCBjaGFyICpuYW1lLCBpbnQgdmFsKSwKKworCVRQX0FSR1MobmFtZSwgdmFsKQorCispOworCitERUZJTkVfRVZFTlQoaXBjLCBpcGNfcmVwbHksCisKKwlUUF9QUk9UTyhjb25zdCBjaGFyICpuYW1lLCBpbnQgdmFsKSwKKworCVRQX0FSR1MobmFtZSwgdmFsKQorCispOworCitERUZJTkVfRVZFTlQoaXBjLCBpcGNfcGVuZGluZ19yZXBseSwKKworCVRQX1BST1RPKGNvbnN0IGNoYXIgKm5hbWUsIGludCB2YWwpLAorCisJVFBfQVJHUyhuYW1lLCB2YWwpCisKKyk7CisKK0RFRklORV9FVkVOVChpcGMsIGlwY19ub3RpZmljYXRpb24sCisKKwlUUF9QUk9UTyhjb25zdCBjaGFyICpuYW1lLCBpbnQgdmFsKSwKKworCVRQX0FSR1MobmFtZSwgdmFsKQorCispOworCitERUZJTkVfRVZFTlQoaXBjLCBpcGNfZXJyb3IsCisKKwlUUF9QUk9UTyhjb25zdCBjaGFyICpuYW1lLCBpbnQgdmFsKSwKKworCVRQX0FSR1MobmFtZSwgdmFsKQorCispOworCitERUNMQVJFX0VWRU5UX0NMQVNTKHN0cmVhbV9wb3NpdGlvbiwKKworCVRQX1BST1RPKHVuc2lnbmVkIGludCBpZCwgdW5zaWduZWQgaW50IHBvcyksCisKKwlUUF9BUkdTKGlkLCBwb3MpLAorCisJVFBfU1RSVUNUX19lbnRyeSgKKwkJX19maWVsZCgJdW5zaWduZWQgaW50LAlpZAkJKQorCQlfX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LCAgICB2c3luY19lbmQgKi8KLSAgICAxMDY3LCAgIDEwMjQsICAgICAgICAgICAxMDY3LCAgICAgICAgICAgMTAyNywgICAgICAgICAgIDEwMzAsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA0LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xNjAwXzEwMjRfNjAsCi0gICAgLyogZmxhZ3MsCQkJCQl3aWR0aCwgICAgICAgICAgaGVpZ2h0LAkJCWZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIERCRV9WT0ZfRkxBVFBBTkVMLCAgIDE2MDAsICAgICAgICAgICAxMDI0LAkJCTYwMDAwLCAgICAgICAgICAxMDY5MTMsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAxNjcwLCAgIDE2MDAsICAgICAgICAgICAxNjcwLCAgICAgICAgICAgMTYzMCwgICAgICAgICAgIDE2NTAsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMDY3LCAgIDEwMjQsICAgICAgICAgICAxMDY3LCAgICAgICAgICAgMTAyNywgICAgICAgICAgIDEwMzAsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA0LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xNjAwXzEyMDBfNTAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTYwMCwgICAgICAgICAgIDEyMDAsICAgICAgICAgICA1MDAwMCwgICAgICAgICAgMTMwNTAwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjA4OCwgICAxNjAwLCAgICAgICAgICAgMjA4OCwgICAgICAgICAgIDE2NDQsICAgICAgICAgICAxNzY0LAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTI1MCwgICAxMjAwLCAgICAgICAgICAgMTI1MCwgICAgICAgICAgIDEyMDUsICAgICAgICAgICAxMjExLAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgMjQsICAgICA1LCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTYwMF8xMjAwXzYwLAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE2MDAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNTk5NDAsICAgICAgICAgIDE2MjAwMCwKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDIxNjAsICAgMTYwMCwgICAgICAgICAgIDIxNjAsICAgICAgICAgICAxNjQ0LCAgICAgICAgICAgMTg1NiwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDEyNTAsICAgMTIwMCwgICAgICAgICAgIDEyNTAsICAgICAgICAgICAxMjAxLCAgICAgICAgICAgMTIwNCwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDYsCQkxLCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTYwMF8xMjAwXzc1LAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE2MDAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNzUwMDAsICAgICAgICAgIDIwMjUwMCwKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDIxNjAsICAgMTYwMCwgICAgICAgICAgIDIxNjAsICAgICAgICAgICAxNjQ0LCAgICAgICAgICAgMTg1NiwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDEyNTAsICAgMTIwMCwgICAgICAgICAgIDEyNTAsICAgICAgICAgICAxMjAxLCAgICAgICAgICAgMTIwNCwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDE1LAkJMiwgICAgICAgICAgICAgIDAKLSAgfSwKLQotICB7Ci0gICAgREJFX1ZUXzE5MjBfMTA4MF81MCwKLSAgICAvKiBmbGFncywgIHdpZHRoLCAgICAgICAgICBoZWlnaHQsICAgICAgICAgZmllbGRzX3NlYywgICAgIGNmcmVxICovCi0gICAgMCwgICAgICAxOTIwLCAgICAgICAgICAgMTA4MCwgICAgICAgICAgIDUwMDAwLCAgICAgICAgICAxMzMyMDAsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAyMzY4LCAgIDE5MjAsICAgICAgICAgICAyMzY4LCAgICAgICAgICAgMTk1MiwgICAgICAgICAgIDIwOTYsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMTI1LCAgIDEwODAsICAgICAgICAgICAxMTI1LCAgICAgICAgICAgMTA4MywgICAgICAgICAgIDEwODYsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA1LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xOTIwXzEwODBfNjAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTkyMCwgICAgICAgICAgIDEwODAsICAgICAgICAgICA1OTk0MCwgICAgICAgICAgMTU5ODQwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjM2OCwgICAxOTIwLCAgICAgICAgICAgMjM2OCwgICAgICAgICAgIDE5NTIsICAgICAgICAgICAyMDk2LAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTEyNSwgICAxMDgwLCAgICAgICAgICAgMTEyNSwgICAgICAgICAgIDEwODMsICAgICAgICAgICAxMDg2LAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgNiwgICAgICAxLCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTkyMF8xMDgwXzcyLAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE5MjAsICAgICAgICAgICAxMDgwLCAgICAgICAgICAgNzIwMDAsICAgICAgICAgIDIxNjAyMywKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDI1NjAsICAgMTkyMCwgICAgICAgICAgIDI1NjAsICAgICAgICAgICAxOTY4LCAgICAgICAgICAgMjE4NCwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDExNzIsICAgMTA4MCwgICAgICAgICAgIDExNzIsICAgICAgICAgICAxMDgzLCAgICAgICAgICAgMTA4NiwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDgsICAgICAgMSwgICAgICAgICAgICAgIDAKLSAgfSwKLQotICB7Ci0gICAgREJFX1ZUXzE5MjBfMTIwMF81MCwKLSAgICAvKiBmbGFncywgIHdpZHRoLCAgICAgICAgICBoZWlnaHQsICAgICAgICAgZmllbGRzX3NlYywgICAgIGNmcmVxICovCi0gICAgMCwgICAgICAxOTIwLCAgICAgICAgICAgMTIwMCwgICAgICAgICAgIDUwMDAwLCAgICAgICAgICAxNjE1MDAsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAyNTg0LCAgIDE5MjAsICAgICAgICAgICAyNTg0LCAgICAgICAgICAgMTk4NCwgICAgICAgICAgIDIyNDAsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMjUwLCAgIDEyMDAsICAgICAgICAgICAxMjUwLCAgICAgICAgICAgMTIwMywgICAgICAgICAgIDEyMDYsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA2LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xOTIwXzEyMDBfNjAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTkyMCwgICAgICAgICAgIDEyMDAsICAgICAgICAgICA1OTk0MCwgICAgICAgICAgMTkzODAwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjU4NCwgICAxOTIwLCAgICAgICAgICAgMjU4NCwgICAgICAgICAgIDE5ODQsICAgICAgICAgICAyMjQwLAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTI1MCwgICAxMjAwLCAgICAgICAgICAgMTI1MCwgICAgICAgICAgIDEyMDMsICAgICAgICAgICAxMjA2LAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgMjksICAgICA0LCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTkyMF8xMjAwXzY2LAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE5MjAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNjYwMDAsICAgICAgICAgIDIxMzE4MCwKL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iBBTAogCi1hc21saW5rYWdlIGxvbmcgY29tcGF0X3N5c19zZW5kbXNnKGludCBmZCwgc3RydWN0IGNvbXBhdF9tc2doZHIgX191c2VyICptc2csIHVuc2lnbmVkIGludCBmbGFncykKK0NPTVBBVF9TWVNDQUxMX0RFRklORTMoc2VuZG1zZywgaW50LCBmZCwgc3RydWN0IGNvbXBhdF9tc2doZHIgX191c2VyICosIG1zZywgdW5zaWduZWQgaW50LCBmbGFncykKIHsKIAlpZiAoZmxhZ3MgJiBNU0dfQ01TR19DT01QQVQpCiAJCXJldHVybiAtRUlOVkFMOwogCXJldHVybiBfX3N5c19zZW5kbXNnKGZkLCAoc3RydWN0IG1zZ2hkciBfX3VzZXIgKiltc2csIGZsYWdzIHwgTVNHX0NNU0dfQ09NUEFUKTsKIH0KIAotYXNtbGlua2FnZSBsb25nIGNvbXBhdF9zeXNfc2VuZG1tc2coaW50IGZkLCBzdHJ1Y3QgY29tcGF0X21tc2doZHIgX191c2VyICptbXNnLAotCQkJCSAgICB1bnNpZ25lZCBpbnQgdmxlbiwgdW5zaWduZWQgaW50IGZsYWdzKQorQ09NUEFUX1NZU0NBTExfREVGSU5FNChzZW5kbW1zZywgaW50LCBmZCwgc3RydWN0IGNvbXBhdF9tbXNnaGRyIF9fdXNlciAqLCBtbXNnLAorCQkgICAgICAgdW5zaWduZWQgaW50LCB2bGVuLCB1bnNpZ25lZCBpbnQsIGZsYWdzKQogewogCWlmIChmbGFncyAmIE1TR19DTVNHX0NPTVBBVCkKIAkJcmV0dXJuIC1FSU5WQUw7CkBAIC03NTEsMjggKzc1MSwyOCBAQAogCQkJICAgICAgZmxhZ3MgfCBNU0dfQ01TR19DT01QQVQpOwogfQogCi1hc21saW5rYWdlIGxvbmcgY29tcGF0X3N5c19yZWN2bXNnKGludCBmZCwgc3RydWN0IGNvbXBhdF9tc2doZHIgX191c2VyICptc2csIHVuc2lnbmVkIGludCBmbGFncykKK0NPTVBBVF9TWVNDQUxMX0RFRklORTMocmVjd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UbylbeXlpXSA9IChGcm9tKVt5eWldOwkJXAotCX0JCQkJCVwKKyMgICBkZWZpbmUgWVlDT1BZKERzdCwgU3JjLCBDb3VudCkgICAgICAgICAgICAgIFwKKyAgICAgIGRvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICBZWVNJWkVfVCB5eWk7ICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICBmb3IgKHl5aSA9IDA7IHl5aSA8IChDb3VudCk7IHl5aSsrKSAgIFwKKyAgICAgICAgICAgIChEc3QpW3l5aV0gPSAoU3JjKVt5eWldOyAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgIHdoaWxlIChZWUlEICgwKSkKICMgIGVuZGlmCiAjIGVuZGlmCkBAIC01MTMsNyArNTQxLDcgQEAKIH07CiAjZW5kaWYKIAotI2lmIFlZREVCVUcgfHwgWVlFUlJPUl9WRVJCT1NFIHx8IFlZVE9LRU5fVEFCTEUKKyNpZiBZWURFQlVHIHx8IFlZRVJST1JfVkVSQk9TRSB8fCAwCiAvKiBZWVROQU1FW1NZTUJPTC1OVU1dIC0tIFN0cmluZyBuYW1lIG9mIHRoZSBzeW1ib2wgU1lNQk9MLU5VTS4KICAgIEZpcnN0LCB0aGUgdGVybWluYWxzLCB0aGVuLCBzdGFydGluZyBhdCBZWU5UT0tFTlMsIG5vbnRlcm1pbmFscy4gICovCiBzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgeXl0bmFtZVtdID0KQEAgLTUzMCw3ICs1NTgsNyBAQAogICAiaW50ZWdlcl9leHByIiwgImludGVnZXJfdHJpbmFyeSIsICJpbnRlZ2VyX29yIiwgImludGVnZXJfYW5kIiwKICAgImludGVnZXJfYml0b3IiLCAiaW50ZWdlcl9iaXR4b3IiL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bHZhbCA9IChWYWx1ZSk7CQkJCQkJXAotICAgICAgWVlQT1BTVEFDSyAoMSk7CQkJCQkJXAotICAgICAgZ290byB5eWJhY2t1cDsJCQkJCQlcCi0gICAgfQkJCQkJCQkJXAotICBlbHNlCQkJCQkJCQlcCi0gICAgewkJCQkJCQkJXAorI2RlZmluZSBZWUJBQ0tVUChUb2tlbiwgVmFsdWUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK2RvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgIGlmICh5eWNoYXIgPT0gWVlFTVBUWSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgIHl5Y2hhciA9IChUb2tlbik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICB5eWx2YWwgPSAoVmFsdWUpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgWVlQT1BTVEFDSyAoeXlsZW4pOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgIHl5c3RhdGUgPSAqeXlzc3A7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICBnb3RvIHl5YmFja3VwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAog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Xl0bmFtZVt5eXhdKTsKLSAgICAgICAgICAgICAgICBpZiAoISAoeXlzaXplIDw9IHl5c2l6ZTEKLSAgICAgICAgICAgICAgICAgICAgICAgJiYgeXlzaXplMSA8PSBZWVNUQUNLX0FMTE9DX01BWElNVU0pKQotICAgICAgICAgICAgICAgICAgcmV0dXJuIDI7Ci0gICAgICAgICAgICAgICAgeXlzaXplID0geXlzaXplMTsKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBZWVNJWkVfVCB5eXNpemUxID0geXlzaXplICsgeXl0bmFtZXJyIChZWV9OVUxMLCB5eXRuYW1lW3l5eF0pOworICAgICAgICAgICAgICAgICAgaWYgKCEgKHl5c2l6ZSA8PSB5eXNpemUxCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgeXlzaXplMSA8PSBZWVNUQUNLX0FMTE9DX01BWElNVU0pKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjsKKyAgICAgICAgICAgICAgICAgIHl5c2l6ZSA9IHl5c2l6ZTE7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xMTcyLDEwICsxMTcyLDEyIEBACiAjIHVuZGVmIFlZQ0FTRV8KICAgICB9CiAKLSAgeXlzaXplMSA9IHl5c2l6ZSArIHl5c3RybGVuICh5eWZvcm1hdCk7Ci0gIGlmICghICh5eXNpemUgPD0geXlzaXplMSAmJiB5eXNpemUxIDw9IFlZU1RBQ0tfQUxMT0NfTUFYSU1VTSkpCi0gICAgcmV0dXJuIDI7Ci0gIHl5c2l6ZSA9IHl5c2l6ZTE7CisgIHsKKyAgICBZWVNJWkVfVCB5eXNpemUxID0geXlzaXplICsgeXlzdHJsZW4gKHl5Zm9ybWF0KTsKKyAgICBpZiAoISAoeXlzaXplIDw9IHl5c2l6ZTEgJiYgeXlzaXplMSA8PSBZWVNUQUNLX0FMTE9DX01BWElNVU0pKQorICAgICAgcmV0dXJuIDI7CisgICAgeXl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mZpbGVuYW1lLCBjb25zdCB2b2lkICpibG9iKQogewogCWludCBmZCA9IDE7CS8qIGFzc3VtZSBzdGRvdXQgKi8KQEAgLTMyOSwzICszNDksMTAwIEBACiAJCXJldHVybiAtMTsKIAlyZXR1cm4gMDsKIH0KKwordm9pZCB1dGlsZmR0X3ByaW50X2RhdGEoY29uc3QgY2hhciAqZGF0YSwgaW50IGxlbikKK3sKKwlpbnQgaTsKKwljb25zdCBjaGFyICpwID0gZGF0YTsKKwljb25zdCBjaGFyICpzOworCisJLyogbm8gZGF0YSwgZG9uJ3QgcHJpbnQgKi8KKwlpZiAobGVuID09IDApCisJCXJldHVybjsKKworCWlmICh1dGlsX2lzX3ByaW50YWJsZV9zdHJpbmcoZGF0YSwgbGVuKSkgeworCQlwcmludGYoIiA9ICIpOworCisJCXMgPSBkYXRhOworCQlkbyB7CisJCQlwcmludGYoIlwiJXNcIiIsIHMpOworCQkJcyArPSBzdHJsZW4ocykgKyAxOworCQkJaWYgKHMgPCBkYXRhICsgbGVuKQorCQkJCXByaW50ZigiLCAiKTsKKwkJfSB3aGlsZSAocyA8IGRhdGEgKyBsZW4pOworCisJfSBlbHNlIGlmICgobGVuICUgNCkgPT0gMCkgeworCQljb25zdCB1aW50MzJfdCAqY2VsbCA9IChjb25zdCB1aW50MzJfdCAqKWRhdGE7CisKKwkJcHJpbnRmKCIgPSA8Iik7CisJCWZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gNCkKKwkJCXByaW50ZigiMHglMDh4JXMiLCBmZHQzMl90b19jcHUoY2VsbFtpXSksCisJCQkgICAgICAgaSA8IChsZW4gLSA0KSA/ICIgIiA6ICIiKTsKKwkJcHJpbnRmKCI+Iik7CisJfSBlbHNlIHsKKwkJcHJpbnRmKCIgPSBbIik7CisJCWZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykKKwkJCXByaW50ZigiJTAyeCVzIiwgKnArKywgaSA8IGxlbiAtIDEgPyAiICIgOiAiIik7CisJCXByaW50ZigiX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2RlYyAqY29kZWMgPSBkZXZfZ2V0X2RydmRhdGEoZGV2KTsKKwlpbnQgaSwgbGVuID0gMDsKKwltdXRleF9sb2NrKCZjb2RlYy0+dXNlcl9tdXRleCk7CisJZm9yIChpID0gMDsgaSA8IGNvZGVjLT5oaW50cy51c2VkOyBpKyspIHsKKwkJc3RydWN0IGhkYV9oaW50ICpoaW50ID0gc25kX2FycmF5X2VsZW0oJmNvZGVjLT5oaW50cywgaSk7CisJCWxlbiArPSBzbnByaW50ZihidWYgKyBsZW4sIFBBR0VfU0laRSAtIGxlbiwKKwkJCQkiJXMgPSAlc1xuIiwgaGludC0+a2V5LCBoaW50LT52YWwpOworCX0KKwltdXRleF91bmxvY2soJmNvZGVjLT51c2VyX211dGV4KTsKKwlyZXR1cm4gbGVuOworfQorCitzdGF0aWMgc3RydWN0IGhkYV9oaW50ICpnZXRfaGludChzdHJ1Y3QgaGRhX2NvZGVjICpjb2RlYywgY29uc3QgY2hhciAqa2V5KQoreworCWludCBpOworCisJZm9yIChpID0gMDsgaSA8IGNvZGVjLT5oaW50cy51c2VkOyBpKyspIHsKKwkJc3RydWN0IGhkYV9oaW50ICpoaW50ID0gc25kX2FycmF5X2VsZW0oJmNvZGVjLT5oaW50cywgaSk7CisJCWlmICghc3RyY21wKGhpbnQtPmtleSwga2V5KSkKKwkJCXJldHVybiBoaW50OworCX0KKwlyZXR1cm4gTlVMTDsKK30KKworc3RhdGljIHZvaWQgcmVtb3ZlX3RyYWlsX3NwYWNlcyhjaGFyICpzdHIpCit7CisJY2hhciAqcDsKKwlpZiAoISpzdHIpCisJCXJldHVybjsKKwlwID0gc3RyICsgc3RybGVuKHN0cikgLSAxOworCWZvciAoOyBpc3NwYWNlKCpwKTsgcC0tKSB7CisJCSpwID0gMDsKKwkJaWYgKHAgPT0gc3RyKQorCQkJcmV0dXJuOworCX0KK30KKworI2RlZmluZSBNQVhfSElOVFMJMTAyNAorCitzdGF0aWMgaW50IHBhcnNlX2hpbnRzKHN0cnV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WRkciA9IDB4JXhcbiIsCisJZGV2X2RiZyhzb25pYy0+Y2FyZC0+ZGV2LCAicHJvZ3JhbSBkbWFjOiBhZGRyID0gMHgleCwgcGFkZHIgPSAweCV4XG4iLAogCSAgICAgICBhZGRyLCBpbmwoc29uaWMtPmRtYWNfcG9ydCArIFNWX0RNQV9BRERSMCkpOwogI2VuZGlmCiB9CkBAIC0zNTcsMTA1ICszNTcsMTA1IEBACiAjaWYgMAogc3RhdGljIHZvaWQgc25kX3NvbmljdmliZXNfZGVidWcoc3RydWN0IHNvbmljdmliZXMgKiBzb25pYykKIHsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiU1YgUkVHUzogICAgICAgICAgSU5ERVggPSAweCUwMnggICIsIGluYihTVl9SRUcoc29uaWMsIElOREVYKSkpOwotCXByaW50aygiICAgICAgICAgICAgICAgICBTVEFUVVMgPSAweCUwMnhcbiIsIGluYihTVl9SRUcoc29uaWMsIFNUQVRVUykpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAwOiBsZWZ0IGlucHV0ICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDAwKSk7Ci0JcHJpbnRrKCIgIDB4MjA6IHN5bnRoIHJhdGUgbG93ICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjApKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAxOiByaWdodCBpbnB1dCAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDAxKSk7Ci0JcHJpbnRrKCIgIDB4MjE6IHN5bnRoIHJhdGUgaGlnaCA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjEpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAyOiBsZWZ0IEFVWDEgICAgICAgPSAweCUwMnggICIsIHN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l9ERUJVRwotCSAgICAgICAiICAweDE1OiByZXZpc2lvbiAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE1KSk7Ci0JcHJpbnRrKCIgIDB4MzU6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzUpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE2OiBBREMgb3V0cHV0IGN0cmwgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE2KSk7Ci0JcHJpbnRrKCIgIDB4MzY6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzYpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE3OiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE3KSk7Ci0JcHJpbnRrKCIgIDB4Mzc6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzcpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE4OiBETUEgQSB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE4KSk7Ci0JcHJpbnRrKCIgIDB4Mzg6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzgpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE5OiBETUEgQSBsb3dlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE5KSk7Ci0JcHJpbnRrKCIgIDB4Mzk6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzkpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFhOiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFhKSk7Ci0JcHJpbnRrKCIgIDB4M2E6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2EpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFiOiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFiKSk7Ci0JcHJpbnRrKCIgIDB4M2I6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2IpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFjOiBETUEgQyB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFjKSk7Ci0JcHJpbnRrKCIgIDB4M2M6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2MpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFkOiBETUEgQyB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFkKSk7Ci0JcHJpbnRrKCIgIDB4M2Q6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2QpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFlOiBQQ00gcmF0ZSBsb3cgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKH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KworCXJldCA9IHJzbmRfZG1hX2luaXQocHJpdiwKKwkJCSAgICByc25kX21vZF90b19kbWEobW9kKSwKKwkJCSAgICBpc19wbGF5LAorCQkJICAgIHNyYy0+aW5mby0+ZG1hX2lkKTsKKwlpZiAocmV0IDwgMCkKKwkJZGV2X2VycihkZXYsICJTUkMgRE1BIGZhaWxlZFxuIik7CisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX3JlbW92ZV9nZW4yKHN0cnVjdCByc25kX21vZCAqbW9kLAorCQkJCXN0cnVjdCByc25kX2RhaSAqcmRhaSwKKwkJCQlzdHJ1Y3QgcnNuZF9kYWlfc3RyZWFtICppbykKK3sKKwlyc25kX2RtYV9xdWl0KHJzbmRfbW9kX3RvX3ByaXYobW9kKSwgcnNuZF9tb2RfdG9fZG1hKG1vZCkpOworCisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgcnNuZF9zcmNfaW5pdF9nZW4yKHN0cnVjdCByc25kX21vZCAqbW9kLAorCQkJICAgICAgc3RydWN0IHJzbmRfZGFpICpyZGFpLAorCQkJICAgICAgc3RydWN0IHJzbmRfZGFpX3N0cmVhbSAqaW8pCit7CisJaW50IHJldDsKKworCXJldCA9IHJzbmRfc3JjX2luaXQobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF9yYXRlX2dlbjIobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF90aW1pbmdfZ2VuMihtb2QsIHJkYWksIGlvKTsKKwlpZiAocmV0IDwgMCkKKwkJcmV0dXJuIHJldDsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX3N0YXJ0X2dlbjIoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICAgc3Ryd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AmZGksIHBpLAorCQkJCQkJCSBuZWVkX3Vud2luZF9pbmZvLCBhcmcpOworCX0KKyNlbmRpZgorCisJcmV0dXJuIC1FSU5WQUw7Cit9CisKK3N0YXRpYyBpbnQgYWNjZXNzX2ZwcmVnKHVud19hZGRyX3NwYWNlX3QgX19tYXliZV91bnVzZWQgYXMsCisJCQl1bndfcmVnbnVtX3QgX19tYXliZV91bnVzZWQgbnVtLAorCQkJdW53X2ZwcmVnX3QgX19tYXliZV91bnVzZWQgKnZhbCwKKwkJCWludCBfX21heWJlX3VudXNlZCBfX3dyaXRlLAorCQkJdm9pZCBfX21heWJlX3VudXNlZCAqYXJnKQoreworCXByX2VycigidW53aW5kOiBhY2Nlc3NfZnByZWcgdW5zdXBwb3J0ZWRcbiIpOworCXJldHVybiAtVU5XX0VJTlZBTDsKK30KKworc3RhdGljIGludCBnZXRfZHluX2luZm9fbGlzdF9hZGRyKHVud19hZGRyX3NwYWNlX3QgX19tYXliZV91bnVzZWQgYXMsCisJCQkJICB1bndfd29yZF90IF9fbWF5YmVfdW51c2VkICpkaWxfYWRkciwKKwkJCQkgIHZvaWQgX19tYXliZV91bnVzZWQgKmFyZykKK3sKKwlyZXR1cm4gLVVOV19FTk9JTkZPOworfQorCitzdGF0aWMgaW50IHJlc3VtZSh1bndfYWRkcl9zcGFjZV90IF9fbWF5YmVfdW51c2VkIGFzLAorCQkgIHVud19jdXJzb3JfdCBfX21heWJlX3VudXNlZCAqY3UsCisJCSAgdm9pZCBfX21heWJlX3VudXNlZCAqYXJnKQoreworCXByX2VycigidW53aW5kOiByZXN1bWUgdW5zdXBwb3J0ZWRcbiIpOworCXJldHVybiAtVU5XX0VJTlZBTDsKK30KKworc3RhdGljIGludAorZ2V0X3Byb2NfbmFtZSh1bndfYWRkcl9zcGFjZV90IF9fbWF5YmVfdW51c2VkIGFzLAorCSAgICAgIHVud193b3JkX3QgX19tYXliZV91bnVzZWQgYWRkciwKKwkJY2hhciBfX21heWJlX3VudXNlZCAqY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