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5lIERDX01hY0xlbiAgICAgICAgICAgICAgIChCWVRFKTEyDQorI2RlZmluZSBEQ19JbWVpTGVuICAgICAgICAgICAgICAoQllURSk4DQorI2RlZmluZSBNU05fTUFYX05WSU5GT19MRU4gICAgICAyMA0KKyNkZWZpbmUgTVNJTkZPX01BWF9OVklORk9fTEVOICAgMjAwDQorI2RlZmluZSBNRE1WRVJTSU9OX01BWF9MRU4gICAgICA2NA0KKyNkZWZpbmUgYkluc2lkZShkYXRhLCB1cCwgZG93bikgKCgoZGF0YSkgPD0gKHVwKSAmJiAoZGF0YSkgPj0gKGRvd24pKSB8fCBcDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGRhdGEpID49ICh1cCkgJiYgKGRhdGEpIDw9IChkb3duKSkpDQordHlwZWRlZiB1bnNpZ25lZCBsb25nIHUzMl90Ow0KKwkNCisjaWZuZGVmIFNNRU1DUFkNCisjZGVmaW5lIFNNRU1DUFkoZHN0LHNyYyxsZW4pICAgICAgICAgICAgbWVtY3B5KGRzdCxzcmMsbGVuKQ0KKyNlbmRpZg0KKw0KKy8qKg0KKyAqIEBicmllZiBaTURNVkVSU0lPTs/s06bP+8+iveG5uczlDQorICogQHBhcmFtIHJlc3VsdCAgveG5+8LrIEFUX1JTUF9PSy9BVF9SU1BfRVJSDQorICogQHBhcmFtIG1kbVZlciAgbW9kZW2w5rG+usUNCisgKi8NCit0eXBlZGVmIHN0cnVjdA0KK3sNCisgICAgY2hhciBtZG1WZXJbTURNVkVSU0lPTl9NQVhfTEVOXTsgDQorICAgIGludCByZXN1bHQ7DQorfUFUX01ETVZFUlNJT05fUlNQX0lORk87DQorDQorLy9zdGF0aWMgY2hhciBtZG1WZXJbTURNVkVSU0lPTl9NQVhfTEVOXSA9IHswfTsvL9PD09q8x8K8WkdNUiC72Li0veG5+w0KKw0KK3N0cnVjdCBmbGFzaF9kZHJfaW5mb3sNCisgICAgY2hhciBtYW51WzMyXTsNCisgICAgY2hhciBtb2RlbFszMl07DQorICAgIGNoYXIgc2l6ZVszMl07DQorICAgIGNoYXIgb3RoZXJbMzJdOw0KK307DQorDQorc3RydWN0IGxjZF9pbmZvDQorew0KKyAgICBjaGFyIG1hbnVbMzJdOw0KKyAgICBjaGFyIGljWzMyXTsNCisgICAgY2hhciByZXNvbHV0aW9uWzMyXTsNCit9Ow0KKw0KK3N0cnVjdCB3aWZpX2luZm8NCit7DQorICAgIGNoYXIgbWFudVszMl07DQorICAgIGNoYXIgaWNbMzJdOw0KK307DQorc3RydWN0IGNwdV9pbmZvew0KKyAgICBjaGFyIG1hbnVbMzJdOw0KKyAgICBjaGFyIG1vZGVsWzMyXTsNCit9Ow0KKw0KKy8qIERhdGEgc3RydWN0dXJlIGZvciBNRDUgKE1lc3NhZ2UtRGlnZXN0KSBjb21wdXRhdGlvbiAqLw0KK3R5cGVkZWYgc3RydWN0IHsNCisgIHUzMl90IGlbMl07ICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIF9iaXRzXyBoYW5kbGVkIG1vZCAyXjY0ICovDQorICB1MzJfdCBidWZbNF07ICAgICAgICAgICAgIC8qIHNjcmF0Y2ggYnVmZmVyICovDQorICB1bnNpZ25lZCBjaGFyIGluWzY0XTsgICAgIC8qIGlucHV0IGJ1ZmZlciAqLw0KKyAgdW5zaWduZWQgY2hhciBkaWdlc3RbMTZdOyAvKiBhY3R1YWwgZGlnZXN0IGFmdGVyIG1kNV9maW5hbCBjYWxsICovDQorfSBtZDVfY3R4Ow0KKw0KKw0KK2V4dGVybiB2b2lkIGF0X2NvbnRleHRfY2huX2luZm9fbW9kKGNoYXIgKmF0X3BhcmFzKTsNCisNCisvKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqKiAgTWVzc2FnZS1kaWdlc3Qgcm91dGluZXM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAq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Kys7DQorICB9DQorICBjdHgtPmlbMF0gKz0gKCh1MzJfdClsZW4gPDwgMyk7DQorICBjdHgtPmlbMV0gKz0gKCh1MzJfdClsZW4gPj4gMjkpOw0KKw0KKyAgd2hpbGUgKGxlbi0tKSB7DQorICAgIC8qIGFkZCBuZXcgY2hhcmFjdGVyIHRvIGJ1ZmZlciwgaW5jcmVtZW50IG1kaSAqLw0KKyAgICBjdHgtPmluW21kaSsrXSA9ICpidWYrKzsNCisNCisgICAgLyogdHJhbnNmb3JtIGlmIG5lY2Vzc2FyeSAqLw0KKyAgICBpZiAobWRpID09IDB4NDApIHsNCisgICAgICBmb3IgKGkgPSAwLCBpaSA9IDA7IGkgPCAxNjsgaSsrLCBpaSArPSA0KSB7DQorICAgICAgICBpbltpXSA9ICgoKHUzMl90KWN0eC0+aW5baWkrM10pIDw8IDI0KSB8DQorICAgICAgICAgICAgICAgICgoKHUzMl90KWN0eC0+aW5baWkrMl0pIDw8IDE2KSB8DQorICAgICAgICAgICAgICAgICgoKHUzMl90KWN0eC0+aW5baWkrMV0pIDw8IDgpICB8DQorICAgICAgICAgICAgICAgICgodTMyX3QpY3R4LT5pbltpaV0pOw0KKyAgICAgIH0NCisgICAgICB0cmFuc2Zvcm0gKGN0eC0+YnVmLCBpbik7DQorICAgICAgbWRpID0gMDsNCisgICAgfQ0KKyAgfQ0KK30NCisNCisvKiBUaGUgcm91dGluZSBtZDVfZmluYWwgdGVybWluYXRlcyB0aGUgbWVzc2FnZS1kaWdlc3QgY29tcHV0YXRpb24gYW5kDQorICAgZW5kcyB3aXRoIHRoZSBkZXNpcmVkIG1lc3NhZ2UgZGlnZXN0IGluIGN0eC0+ZGlnZXN0WzAuLi4xNV0uDQorICovDQorDQordm9pZCBtZDVfZmluYWwodW5zaWduZWQgY2hhciBoYXNoW10sIG1kNV9jdHggKmN0eCkNCit7DQorICB1MzJfdCBpblsxNl07DQorICBpbnQgbWRpOw0KKyAgdW5zaWduZWQgaW50IGksIGlpOw0KKyAg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ltNYWNpbmRleF07DQorICAgICAgICBpZiAoIShiSW5zaWRlKGNobWFjLCAnMCcsICc5JykgfHwgYkluc2lkZShjaG1hYywgJ2EnLCAnZicpIHx8IGJJbnNpZGUoY2htYWMsICdBJywgJ0YnKSkpDQorICAgICAgICB7DQorICAgICAgICAgICAgYXRfcHJpbnQoQVRfREVCVUcsIm1hYyBpcyBub3QgaGV4IHN0clxyIik7DQorICAgICAgICAgICAgcmV0dXJuIEZBTFNFOw0KKyAgICAgICAgfQ0KKwl9DQorICAgIHJldHVybiBUUlVFOw0KK30NCitzdGF0aWMgY2hhciBBc2NpaTJCQ0QoY2hhciBpQXNjaWkpDQorew0KKyAgICBjaGFyIGlCQ0Q7DQorDQorICAgIGlmICggYkluc2lkZShpQXNjaWksICcwJywgJzknKSkNCisgICAgew0KKyAgICAgICAgaUJDRCA9IGlBc2NpaSAtICcwJzsNCisNCisgICAgfQ0KKyAgICBlbHNlIGlmIChiSW5zaWRlKGlBc2NpaSwgJ2EnLCAnZicpKQ0KKyAgICB7DQorICAgICAgICBpQkNEID0gaUFzY2lpIC0gJ2EnICsgMHgwYTsNCisNCisgICAgfQ0KKyAgICBlbHNlIGlmIChiSW5zaWRlKGlBc2NpaSwgJ0EnLCAnRicpKQ0KKyAgICB7DQorICAgICAgICBpQkNEID0gaUFzY2lpIC0gJ0EnICsgMHgwYTsNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIHJldHVybiAtMTsNCisgICAgfQ0KKw0KKyAgICByZXR1cm4gaUJDRDsNCisNCit9DQorDQorc3RhdGljIGNoYXIgQkNEMkFzY2lpKGNoYXIgaUJDRCkNCit7DQorICAgIGNoYXIgaUFzY2lpOw0KKw0KKyAgICBpZiAoYkluc2lkZShpQkNELCAweDAwLCAweDA5KSkNCisgICAgew0KKyAgICAgICAgaUFzY2lpID0gKHVuc2lnbmVkIGNoYXIpKGlCQ0QgKyAnMCcpOw0KKyAgICB9DQorICAgIGVsc2UgaWYgKGJJbnNpZGUoaUJDRCwgMHgwYSwgMHgwZikpDQorICAgIHsNCisgICAgICAgIGlBc2NpaSA9ICh1bnNpZ25lZCBjaGFyKSgoaUJDRCAtIDB4MGEpICsgJ0EnKTsNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIHJldHVybiAtMTsNCisgICAgfQ0KKyAgICByZXR1cm4gaUFzY2lpOw0KK30NCisNCitzdGF0aWMgaW50IElzSW1laVN0clZhbGlkKGNoYXIqIGltZWlTdHIpDQorew0KKyAgICBpbnQgaSA9IDA7DQorICAgIGZvciAoOyBpIDwgMTU7ICsraSkNCisgICAgew0KKyAgICAgICAgaWYgKGltZWlTdHJbaV0gPCAnMCcgfHwgaW1laVN0cltpXSA+ICc5JykNCisgICAgICAgIHsNCisgICAgICAgICAgICByZXR1cm4gRkFMU0U7DQorICAgICAgICB9DQorICAgIH0NCisgICAgcmV0dXJuIFRSVUU7DQorfQ0KKw0KK3N0YXRpYyBsb25nIENoYXIySW50KGNoYXIgY2hyKQ0KK3sNCisgICAgbG9uZyB2YWx1ZSA9IDA7DQorICAgIHZhbHVlID0gIChjaHIgLSAnMCcpOw0KKyAgICByZXR1cm4gdmFsdWU7DQorfQ0KKw0KK3N0YXRpYyBjaGFyIEludDJDaGFyKGxvbmcgdmFsdWUpDQorew0KKyAgICBjaGFyIGNoID0gJzAnK3ZhbHVlOw0KKyAgICByZXR1cm4gY2g7DQorfQ0KKw0KK3N0YXRpYyB1bnNpZ25lZCBsb25nIERDX1dyaXRlaW1laShjaGFyICogaW1laXN0cikNCit7DQorICAgIGludCAgICAgSW1laWluZGV4ID0wLGNoZWNraW5kZXg9MDsNCisgICAgQllURSAgICBhYkltZWlbRENfSW1laUxlbl09ezB9Ow0KKyAgICBCWVRFICAgIEluZGV4MT0wLEluZGV4Mj0wOw0KKyAgICANCisgICAgZm9yKEltZWlpbmRleD0wO2ltZWlzdHJbSW1laWluZGV4XSE9J1wwJztJbWVpaW5kZXgrPTIpDQorICAgIHsgICAgDQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiSW1laWluZGV4PSAlZFxyXG4iLEltZWlpbmRleCk7DQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiaW1laXN0clslZF09ICVjXHJcbiIsSW1laWluZGV4LGltZWlzdHJbSW1laWluZGV4XSk7DQorDQorICAgICAgICBJbmRleDE9Q2hhcjJJbnQoKGNoYXIpaW1laXN0cltJbWVpaW5kZXhdKTsgICAgICANCisgICAgICAgIGF0X3ByaW50KEFUX0RFQlVHLCJJbmRleDE9ICVkXHIiLEluZGV4MSk7DQorICAgICAgICANCisgICAgICAgIGlmKChpbWVpc3RyW0ltZWlpbmRleCsxXSkhPSdcMCcpDQorICAgICAgICB7DQorICAgICAgICANCisgICAgICAgICAgICBJbmRleDI9IENoYXIySW50KChjaGFyKWltZWlzdHJbSW1laWluZGV4KzFdKTsNCisgICAgICAgICAgICBhdF9wcmludChBVF9ERUJVRywiSW5kZXgyPSAlZCwgSW5kZXgyPDw0ID0leCAsIChJbmRleDI8PDQpJkluZGV4MSA9ICV4XHJcbiIsSW5kZXgyLEluZGV4Mjw8NCwoSW5kZXgyPDw0KXxJbmRleDEpOw0KKw0KKyAgICAgICAgICAgIGFiSW1laVtJbWVpaW5kZXgvMl09KEluZGV4Mjw8NCl8SW5kZXgxOw0KKyAgICAgICAgICAgIGF0X3ByaW50KEFUX0RFQlVHLCJhYkltZWlbJWRdPSAleFxyXG4iLEltZWlpbmRleC8yLGFiSW1laVtJbWVpaW5kZXgvMl0pOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGFiSW1laVtJbWVpaW5kZXgvMl09MHhGMHxJbmRleDE7DQorICAgICAgICAgICAgYXRfcHJpbnQoQVRfREVCVUcsImFiSW1laVslZF09ICV4XHJcbiIsSW1laWluZGV4LzIsYWJJbWVpW0ltZWlpbmRleC8yXSk7DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorICAgIH0NCisgICAgZm9yKGNoZWNraW5kZXg9MDtjaGVja2luZGV4PDg7Y2hlY2tpbmRleCsrKQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiYWJJbWVpWyVkXSA9ICV4XHJcbiIsY2hlY2tpbmRleCxhYkltZWlbY2hlY2tpbmRleF0pOw0KKyAgICB9DQorDQorICAgIGlmKENQTlZfRVJST1IgPT0gYW10X252cm9fd3JpdGUoT1NfRkxBU0hfQU1UX0NPTU1fUk9fSU1FSV9BRERSRVNTLCBzaXplb2YoYWJJbWVpKSwgYWJJbWVpKSkNCisgICAgew0KKyAgICAgICAgYXRfcHJpbnQoQVRfRVJSLCJXcml0ZSBhbXQgaW1laSBmYWlsZWRcclxuIik7DQorICAgICAgICByZXR1cm4gIC0xOw0KKyAgICB9DQorDQorICAgIHJldHVybiAwOw0KK30NCisNCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBEQ19Xcml0ZU1hY0FkZHINCisqILmmxNzD6Mr2OiBBU0NJScLr16q7u7PJQkNEwuujrLKiIL2rTUFDtdjWt9C0yOu1vU5W1tANCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitzdGF0aWMgdW5zaWduZWQgbG9uZyBEQ19Xcml0ZU1hY0FkZHIoY2hhciAqbWFjc3RyKQ0KK3sNCisgICAgdW5zaWduZWQgbG9uZyAgIE1hY2luZGV4ID0gMDsNCisgICAgdW5zaWduZWQgY2hhciAgIGFiTWFjW09TX0ZMQVNIX0FNVF9DT01NX1JPX1dJRklNQUNfU0laRV0gPSB7MH07DQorICAgIHVuc2lnbmVkIGNoYXIgICBJbmRleDEgPSAwOw0KKyAgICB1bnNpZ25lZCBjaGFyICAgSW5kZXgyID0gMDsNCisNCisJaWYoIWlzX21hY192YWxpZChtYWNzdHIpKQ0KKwl7DQorCSAgICAgYXRfcHJpbnQoQVRfREVCVUcsIm1hYyBpcyBub3QgaGV4IHN0clxyIik7DQorICAgICAgICAgcmV0dXJuIC0xOw0KKwl9DQorDQorICAgIC8qQVNDSUnC69equ7uzyUJDRMLrKi8NCisgICAgZm9yIChNYWNpbmRleCA9IDA7IG1hY3N0cltNYWNpbmRleF0gIT0gJ1wwJyAmJiAoTWFjaW5kZXggPCBPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDX1NJWkUpOyBNYWNpbmRleCArPSAyKQ0KKyAgICB7DQorICAgICAgICBJbmRleDEgPSAodW5zaWduZWQgY2hhcilBc2NpaTJCQ0QoKGNoYXIpbWFjc3RyW01hY2luZGV4XSk7DQorICAgICAgICBJbmRleDIgPSAodW5zaWduZWQgY2hhcilBc2NpaTJCQ0QoKGNoYXIpbWFjc3RyW01hY2luZGV4ICsgMV0pOw0KKyAgICAgICAgYWJNYWNbTWFjaW5kZXgvMl09KEluZGV4MTw8NCl8SW5kZXgyOw0KKyAgICB9DQorICAgIA0KKyAgICBpZiAoQ1BOVl9FUlJPUiA9PSBhbXRfbnZyb193cml0ZShPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDX0FERFJFU1MsIE9TX0ZMQVNIX0FNVF9DT01NX1JPX1dJRklNQUNfU0laRSwgYWJNYWMpKQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiV3JpdGUgYW10IG1hYyBmYWlsZWRcciIpOw0KKyAgICAgICAgcmV0dXJuICAtMTsNCisgICAgfQ0KKw0KKyAgICByZXR1cm4gIDA7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IERDX1dyaXRlTWFjMkFkZHINCisqILmmxNzD6Mr2OiBBU0NJScLr16q7u7PJQkNEwuujrLKiIL2rTUFDtdjWt9C0yOu1vU5W1tANCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitzdGF0aWMgdW5zaWduZWQgbG9uZyBEQ19Xcml0ZU1hYzJBZGRyKGNoYXIgKm1hY3N0cikNCit7DQorICAgIHVuc2lnbmVkIGxvbmcgICBNYWNpbmRleCA9IDA7DQorICAgIHVuc2lnbmVkIGNoYXIgICBhYk1hY1tPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDMl9TSVpFXSA9IHswfTsNCisgICAgdW5zaWduZWQgY2hhciAgIEluZGV4MSA9IDA7DQorICAgIHVuc2lnbmVkIGNoYXIgICBJbmRleDIgPSAwOw0KKwkNCisJaWYoIWlzX21hY192YWxpZChtYWNzdHIpKQ0KKwl7DQorCSAgICAgYXRfcHJpbnQoQVRfREVCVUcsIm1hYyBpcyBub3QgaGV4IHN0clxyIik7DQorICAgICAgICAgcmV0dXJuIC0xOw0KKwl9DQorDQorICAgIC8qQVNDSUnC69equ7uzyUJDRMLrKi8NCisgICAgZm9yIChNYWNpbmRleCA9IDA7IG1hY3N0cltNYWNpbmRleF0gIT0gJ1wwJyAmJiAoTWFjaW5kZXggPCBPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDMl9TSVpFKTsgTWFjaW5kZXggKz0gMikNCisgICAgew0KKyAgICAgICAgSW5kZXgxID0gKHVuc2lnbmVkIGNoYXIpQXNjaWkyQkNEKChjaGFyKW1hY3N0cltNYWNpbmRleF0pOw0KKyAgICAgICAgSW5kZXgyID0gKHVuc2lnbmVkIGNoYXIpQXNjaWkyQkNEKChjaGFyKW1hY3N0cltNYWNpbmRleCArIDFdKTsNCisJCWFiTWFjW01hY2luZGV4LzJdPShJbmRleDE8PDQpfEluZGV4MjsNCisgICAgfQ0KKyAgICANCisgICAgaWYgKENQTlZfRVJST1I9PSBhbXRfbnZyb193cml0ZShPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDMl9BRERSRVNTLCBPU19GTEFTSF9BTVRfQ09NTV9ST19XSUZJTUFDMl9TSVpFLCBhYk1hYykpDQorICAgIHsNCisgICAgICAgIGF0X3ByaW50KEFUX0RFQlVHLCJXcml0ZSBhbXQgbWFjIGZhaWxlZFxyIik7DQorICAgICAgICByZXR1cm4gLTE7DQorICAgIH0NCisNCisgICAgcmV0dXJuIDA7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IERDX1dyaXRlUko0NU1hY0FkZHINCisqILmmxNzD6Mr2OiBBU0NJScLr16q7u7PJQkNEwuujrLKiIL2rTUFDtdjWt9C0yOu1vU5W1tANCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCit1bnNpZ25lZCBsb25nIERDX1dyaXRlUko0NU1hY0FkZHIoY2hhciAqbWFjc3RyKQ0KK3sNCisgICAgdW5zaWduZWQgbG9uZyAgIE1hY2luZGV4ID0gMDsNCisgICAgdW5zaWduZWQgY2hhciAgIGFiTWFjW09TX0ZMQVNIX0FNVF9DT01NX1JPX0VUSE1BQ19TSVpFXSA9IHswfTsNCisgICAgdW5zaWduZWQgY2hhciAgIEluZGV4MSA9IDA7DQorICAgIHVuc2lnbmVkIGNoYXIgICBJbmRleDIgPSAwOw0KKw0KKwlpZighaXNfbWFjX3ZhbGlkKG1hY3N0cikpDQorCXsNCisJICAgICBhdF9wcmludChBVF9ERUJVRywibWFjIGlzIG5vdCBoZXggc3RyXHIiKTsNCisgICAgICAgICByZXR1cm4gLTE7DQorCX0NCisNCisgICAgLypBU0NJScLr16q7u7PJQkNEwusqLw0KKyAgICBmb3IgKE1hY2luZGV4ID0gMDsgbWFjc3RyW01hY2luZGV4XSAhPSAnXDAnICYmIChNYWNpbmRleCA8IE9TX0ZMQVNIX0FNVF9DT01NX1JPX0VUSE1BQ19TSVpFKTsgTWFjaW5kZXggKz0gMikNCisgICAgew0KKyAgICAgICAgSW5kZXgxID0gKHVuc2lnbmVkIGNoYXIpQXNjaWkyQkNEKChjaGFyKW1hY3N0cltNYWNpbmRleF0pOw0KKyAgICAgICAgSW5kZXgyID0gKHVuc2lnbmVkIGNoYXIpQXNjaWkyQkNEKChjaGFyKW1hY3N0cltNYWNpbmRleCArIDFdKTsNCisgICAgICAgIGFiTWFjW01hY2luZGV4LzJdPShJbmRleDE8PDQpfEluZGV4MjsNCisgICAgfQ0KKw0KKyAgICBpZiAoQ1BOVl9FUlJPUj09IGFtdF9udnJvX3dyaXRlKE9TX0ZMQVNIX0FNVF9DT01NX1JPX0VUSE1BQ19BRERSRVNTLCBPU19GTEFTSF9BTVRfQ09NTV9ST19FVEhNQUNfU0laRSwgYWJNYWMpKQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiV3JpdGUgYW10IGV0aG1hYyBmYWlsZWRcciIpOw0KKyAgICAgICAgcmV0dXJuIC0xOw0KKyAgICB9DQorDQorICAgIHJldHVybiAwOw0KK30NCisNCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBEQ19Xcml0ZU1hY0FkZHINCisqILmmxNzD6Mr2OiBBU0NJScLr16q7u7PJQkNEwuujrLKiIL2rVVNCIE1BQ7XY1rfQtMjrtb1OVtbQDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorc3RhdGljIHVuc2lnbmVkIGxvbmcgRENfV3JpdGVVU0JNYWNBZGRyKGNoYXIgKm1hY3N0cikNCit7DQorICAgIHVuc2lnbmVkIGxvbmcgICBNYWNpbmRleCA9IDA7DQorICAgIHVuc2lnbmVkIGNoYXIgICBhYk1hY1tPU19GTEFTSF9BTVRfQ09NTV9ST19VU0JNQUNfU0laRV0gPSB7MH07DQorICAgIHVuc2lnbmVkIGNoYXIgICBJbmRleDEgPSAwOw0KKyAgICB1bnNpZ25lZCBjaGFyICAgSW5kZXgyID0gMDsNCisNCisJaWYoIWlzX21hY192YWxpZChtYWNzdHIpKQ0KKwl7DQorCSAgICAgYXRfcHJpbnQoQVRfREVCVUcsIm1hYyBpcyBub3QgaGV4IHN0clxyIik7DQorICAgICAgICAgcmV0dXJuIC0xOw0KKwl9DQorDQorICAgIC8qQVNDSUnC69equ7uzyUJDRMLrKi8NCisgICAgZm9yIChNYWNpbmRleCA9IDA7IG1hY3N0cltNYWNpbmRleF0gIT0gJ1wwJyAmJiAoTWFjaW5kZXggPCBPU19GTEFTSF9BTVRfQ09NTV9ST19VU0JNQUNfU0laRSk7IE1hY2luZGV4ICs9IDIpDQorICAgIHsNCisgICAgICAgIEluZGV4MSA9ICh1bnNpZ25lZCBjaGFyKUFzY2lpMkJDRCgoY2hhciltYWNzdHJbTWFjaW5kZXhdKTsNCisgICAgICAgIEluZGV4MiA9ICh1bnNpZ25lZCBjaGFyKUFzY2lpMkJDRCgoY2hhciltYWNzdHJbTWFjaW5kZXggKyAxXSk7DQorICAgICAgICBhYk1hY1tNYWNpbmRleC8yXT0oSW5kZXgxPDw0KXxJbmRleDI7DQorICAgIH0NCisgICAgDQorICAgIGlmIChDUE5WX0VSUk9SID09IGFtdF9udnJvX3dyaXRlKE9TX0ZMQVNIX0FNVF9DT01NX1JPX1VTQk1BQ19BRERSRVNTLCBPU19GTEFTSF9BTVRfQ09NTV9ST19VU0JNQUNfU0laRSwgYWJNYWMpKQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9ERUJVRywiV3JpdGUgYW10IHVzYiBtYWMgZmFpbGVkXHIiKTsNCisgICAgICAgIHJldHVybiAgLTE7DQorICAgIH0NCisNCisgICAgcmV0dXJuICAwOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBEQ19Xcml0ZU1hY0FkZHINCisqILmmxNzD6Mr2OiBBU0NJScLr16q7u7PJQkNEwuujrLKiIL2rR01BQ7XY1rfQtMjrtb1OVtbQDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorc3RhdGljIHVuc2lnbmVkIGxvbmcgRENfV3JpdGVHbWFjQWRkcihjaGFyICptYWNzdHIpDQorew0KKyAgICB1bnNpZ25lZCBsb25nICAgTWFjaW5kZXggPSAwOw0KKyAgICB1bnNpZ25lZCBjaGFyICAgYWJNYWNbT1NfRkxBU0hfQU1UX0NPTU1fUk9fR01BQ19TSVpFXSA9IHswfTsNCisgICAgdW5zaWduZWQgY2hhciAgIEluZGV4MSA9IDA7DQorICAgIHVuc2lnbmVkIGNoYXIgICBJbmRleDIgPSAwOw0KKw0KKwlpZighaXNfbWFjX3ZhbGlkKG1hY3N0cikpDQorCXsNCisJICAgICBhdF9wcmludChBVF9ERUJVRywibWFjIGlzIG5vdCBoZXggc3RyXHIiKTsNCisgICAgICAgICByZXR1cm4gLTE7DQorCX0NCisNCisgICAgLypBU0NJScLr16q7u7PJQkNEwusqLw0KKyAgICBmb3IgKE1hY2luZGV4ID0gMDsgbWFjc3RyW01hY2luZGV4XSAhPSAnXDAnICYmIChNYWNpbmRleCA8IE9TX0ZMQVNIX0FNVF9DT01NX1JPX0dNQUNfU0laRSk7IE1hY2luZGV4ICs9IDIpDQorICAgIHsNCisgICAgICAgIEluZGV4MSA9ICh1bnNpZ25lZCBjaGFyKUFzY2lpMkJDRCgoY2hhciltYWNzdHJbTWFjaW5kZXhdKTsNCisgICAgICAgIEluZGV4MiA9ICh1bnNpZ25lZCBjaGFyKUFzY2lpMkJDRCgoY2hhciltYWNzdHJbTWFjaW5kZXggKyAxXSk7DQorICAgICAgICBhYk1hY1tNYWNpbmRleC8yXT0oSW5kZXgxPDw0KXxJbmRleDI7DQorICAgIH0NCisNCisgICAgaWYgKENQTlZfRVJST1IgPT0gYW10X252cm9fd3JpdGUoT1NfRkxBU0hfQU1UX0NPTU1fUk9fR01BQ19BRERSRVNTLCBPU19GTEFTSF9BTVRfQ09NTV9ST19HTUFDX1NJWkUsIGFiTWFjKSkNCisgICAgew0KKyAgICAgICAgYXRfcHJpbnQoQVRfREVCVUcsIldyaXRlIGFtdCBHbWFjIGZhaWxlZFxyIik7DQorICAgICAgICByZXR1cm4gIC0xOw0KKyAgICB9DQorDQorICAgIHJldHVybiAgMDsNCit9DQorDQorDQorc3RhdGljIGludCBya2V5ZGNfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICoqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgaW50IHJldENv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pyZXNfbXNnKTsNCisgICAgfQ0KKyAgICBlbHNlIGlmKHN0cnN0cihhdF9wYXJhcywgIkxDRCIpKQ0KKyAgICB7ICAgDQorICAgICAgICByZXRDb2RlID0gc3lzY2FsbChHRVRfTENEX0lORk8sbGNkSW5mby5tYW51LGxjZEluZm8uaWMsbGNkSW5mby5yZXNvbHV0aW9uKTsNCisgICAgICAgIGlmKHJldENvZGUgPCAwKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIGF0X3ByaW50KEFUX0VSUiwicmtleWRjX2FjdF9mdW5jOiBzeXNjYWxsIEdFVF9MQ0RfSU5GTyBmYWlsZWQgXG4iKTsNCisJCSAgICBmcmVlKGF0X3N0cik7DQorICAgICAgICAgICAgcmV0dXJuIEFUX0VORDsNCisgICAgICAgIH0NCisgICAgICAgIGF0X3ByaW50KEFUX0VSUiwicmtleWRjX2FjdF9mdW5jOiBsY2RJbmZvLm1hbnUgPSAlcyxpYyA9ICVzLHJlc29sdXRpb24gPSVzXG4iLGxjZEluZm8ubWFudSxsY2RJbmZvLmljLGxjZEluZm8ucmVzb2x1dGlvbik7DQorICAgICAgICBzbnByaW50ZigoY2hhciopYXRfc3RyLDY0LCJcclxuJXM/JXM/TkE/TkE/JXNcclxuIixsY2RJbmZvLm1hbnUsbGNkSW5mby5pYyxsY2RJbmZvLnJlc29sdXRpb24pOw0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9zdHI7DQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgIH0NCisgICAgZWxzZSBpZihzdHJzdHIoYXRfcGFyYXMsICJXSUZJIikpDQorICAgIHsgICANCisgICAgICAgIHJldENvZGUgPSBzeXNjYWxsKEdFVF9XSUZJX0lORk8sd2lmaUluZm8ubWFudSx3aWZpSW5mby5pYyk7DQorICAgICAgICBpZihyZXRDb2RlIDwgMCkNCisgICAgICAgIHsNCisgICAgICAgICAgICBhdF9wcmludChBVF9FUlIsInJrZXlkY19hY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kE/TkFcclxuIixjcHVJbmZvLm1hbnUsY3B1SW5mby5tb2RlbCk7DQorICAgICAgICAqcmVzX21zZyA9IGF0X3N0cjsNCisgICAgICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgfQ0KKwllbHNlDQorCXsNCisJICAgIGZyZWUoYXRfc3RyKTsNCisJfQ0KKyAgICANCisgICAgcmV0dXJuIEFUX0VORDsNCisgICAgDQorfQ0KKw0KK2ludCBwb3dlcm9mZl9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKipyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICBzeXN0ZW0oInBvd2Vyb2ZmIik7DQorICAgIC8vIGFkZCBieSBob3V3ZWlmZW5nIGZvciB6aGFuZ3dlaSAyMDIwMDcwNywgc3lzdGVtuq/K/bKisrvKx9K7tqjNrLK91rTQ0A0KKyAgICAqcmVzX21zZyA9IGF0X29rX2J1aWxkKCk7DQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogY2hpcF9wbGF0Zm9ybV9yZWFkX2FjdF9mdW5jDQorKiC5psTcw+jK9jogcmV0dXJuIGNoaXAgcGxhdGZvcm0gMTo3NTIwVjMgMjo3MTAwDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IGNoaXBfcGxhdGZvcm1fcmVhZF9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKiAqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgY2hhciBUbXBDaGlwUGxhdGZvcm1bMzJdICAgID17MH07DQorICAgIHNucHJpbnRmKChjaGFyICopVG1wQ2hpcFBsYXRmb3JtLCAzMiwiMSIpOw0KKyAgICAqcmVzX21zZyA9IGF0X3F1ZXJ5X3Jlc3VsdF9idWlsZCgiUExBVEZPUk0iLFRtcENoaXBQbGF0Zm9ybSk7DQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgICAgDQorICAgIHJldHVybiBBVF9FTkQ7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IGltZWlSZWFkX2FjdF9mdW5jDQorKiC5psTcw+jK9jogtsFpbWVpusUNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgaW1laVJlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGludCByZXRDb2RlID0gIC0xOw0KKyAgICBjaGFyIFRtcEltZWlbRENfSW1laUxlbl09IHswfTsgLy9pbWVps6S2yNfutPPWtQ0KKyAgICBpbnQgYWJJbWVpaW5kZXggPSAwLGltZWlzdHJpbmRleCA9IDA7DQorICAgIHN0YXRpYyBjaGFyIGltZWlzdHJbMipEQ19JbWVpTGVuXSA9IHswfTsNCisgICA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Ow0KKwlpZihhdF9zdHIpDQorCXsNCisJICAgIHNwcmludGYoYXRfc3RyLCJcclxuJXNcclxuT0tcclxuIixpbWVpc3RyKTsNCisJICAgICpyZXNfbXNnID0gYXRfc3RyOw0KKwkgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKwl9DQorICAgIHJldHVybiBBVF9FTkQ7DQorfQ0KKw0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IGltZWlXcml0ZV9hY3RfZnVuYw0KKyoguabE3MPoyvY6INC0aW1labrFDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IGltZWlXcml0ZV9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKiAqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgLy9sb25nIHJldENvZGUgPSAtMTsNCisgICAgY2hhciAqYXRfc3RyID0gTlVMTDsgDQorICAgIGNoYXIgSW1laXN0clsyKkRDX0ltZWlMZW5dPSB7MH07DQorDQorICAgIA0KKyAgICBhdF9zdHIgPSBhdF9wYXJhczsgIA0KKyAgICANCisgICAgYXRfcHJpbnQoQVRfREVCVUcsImltZWlXcml0ZV9hY3RfZnVuYyA9ICVzLlxuIiwgYXRfc3RyKTsNCisNCisgICAgLy9pZiAoKHN0cnN0cigoY29uc3QgY2hhciAqKWF0X3N0ciwiXHIiKS0oY2hhciAqKWF0X3N0cikhPSAoMipEQ19JbWVpTGVuLTEpIHx8ICFJc0ltZWlTdHJWYWxpZChhdF9zdHIpKQ0KKyAgICBpZiAoc3RybGVuKGF0X3BhcmFzKSAhPSAoMipEQ19JbWVpTGVuLTEpIHx8ICFJc0ltZWlTdHJWYWxpZChhdF9zdHIpKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsNCisgICAgICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsgICAgIA0KKyAgICB9DQorICAgIGVsc2UNCisgICAgew0KKyAgICAgICAgaWYgKC0xID09RENfV3JpdGVpbWVpKChjaGFyICopYXRfc3RyKSkNCisgICAgICAgIHsNCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgICAgICAgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOyAgICAgDQorICAgICAgICAgICAgcmV0dXJuIEFUX0VORDsgIA0KKyAgICAgICAgfQ0KKyAgICAgICAgDQorICAgICAgICBtZW1jcHkoSW1laXN0cixhdF9zdHIsMipEQ19JbWVpTGVuLTEpOw0KKyAgICAgICAgSW1laXN0clsyKkRDX0ltZWlMZW4tMV0gPSAnXDAnOw0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoIk1PRElNRUkiLEltZWlzdHIpOw0KKyAgICAgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKyAgICB9DQorDQorICAgIHJldHVybiBBVF9FTkQ7ICANCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogc3NpZFJlYWRfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiC78cihU1NJRLrFDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE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cmxlbigqcmVzX21zZyk7DQorICAgIHJldHVybiBBVF9FTkQ7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IHNzaWRXcml0ZV9hY3RfZnVuYw0KKyoguabE3MPoyvY6INC0U1NJRLrFDQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6ILWxU1NJRLrFuMSx5MqxYXRzZXJ2ZXLW97avyc+xqLj4Y3RybaOsY3Rybb2rU1NJRLrF0LTI605W1tANCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgc3NpZFdyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICB1bnNpZ25lZCBpbnQgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICBhdF9wcmludChBVF9FUlIsImF0X3BhcmFzPSVzXG4iLGF0X3BhcmFzKTsNCisgICAgDQorICAgIGF0X3N0ciA9IGF0X3BhcmFzOyAgDQorDQorICAgIHJldENvZGUgPSBjcG52X052SXRlbVdyaXRlKFpQU19SRUZfTVNJTkZPX1NTSURfQkFTRV9BRERSLCAodW5zaWduZWQgY2hhciopYXRfc3RyLCBzdHJsZW4oYXRfc3RyKSk7DQorICAgIGF0X3ByaW50KEFUX0VSUiwiYXRfc3RyPSVzXG4iLGF0X3N0cik7DQorICAgIGF0X3ByaW50KEFUX0VSUiwicmV0Q29kZT0lZFxuIixyZXRDb2RlKTsNCisNCisgICAgaWYoQ1BOVl9FUlJPUiA9PSByZXRDb2RlKQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9FUlIsImNwbnZfTnZJdGVtV3JpdGUgc3NpZCBmYWlsICFcbiIpOw0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOw0KKyAgICAgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOyAgICAgDQorICAgICAgICByZXR1cm4gQVRfRU5EOyAgDQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgICAgICBhdF9wcmludChBVF9FUlIsImNwbnZfTnZJdGVtV3JpdGUgc3NpZCBzdWNjZXNzICFcbiIpOw0KKyAgICB9DQorDQorICAgIGNmZ19zZXQoInpzc2lkIixhdF9zdHIpOyAgICANCisNCisgICAgcmV0Q29kZSA9IGNwbnZfTnZyYW1GbHVzaCgpOw0KKyAgICANCisgICAgaWYgKHJldENvZGUgPT0gQ1BOVl9PSykNCisgICAgew0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoIlNTSUQiLGF0X3N0cik7DQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7ICAgDQorICAgICAgICBhdF9wcmludChBVF9FUlIsImNwbnZfTnZyYW1GbHVzaCBzc2lkIGZhaWwgIVxuIik7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgIH0NCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKw0KKyAgICByZXR1cm4gQVRfRU5EOw0KKw0KK30NCisNCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiB2ZXJzaW9uVHlwZVNldF9hY3RfZnVuYw0KKyoguabE3MPoyvY6IMno1sOw5rG+wODQzaOsQU1UsOaxvi+087Dmsb4NCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zogQVQrWlZFUlNJT05UWVBFPTDOqrTzsOaxvqOsQVQrWlZFUlNJT05UWVBFPTHOqkFNVLDmsb4NCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgdmVyc2lvblR5cGVTZXRfYWN0X2Z1bmMoaW50IGF0X2ZkLCBjaGFyICogYXRfcGFyYXMsdm9pZCAqKnJlc19tc2csIGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICBsb25nICAgIHJldENvZGUgPSAgLTE7DQorICAgIGNoYXIgICAqYXRfc3RyICA9IE5VTEw7IA0KKyAgICBpbnQgICAgIG50eXBlICAgPSAtMTsgICANCisgICAgDQorICAgIGF0X3ByaW50KEFUX0VSUiwiYXRfcGFyYXM9JXNcbiIsIGF0X3BhcmFzKTsNCisgICAgYXRfc3RyID0gYXRfcGFyYXM7ICANCisNCisgICAgdW5zaWduZWQgY2hhciBib290bW9kZVtdID0gezB4NTQsIDB4NER9Ow0KKwl1bnNpZ25lZCBjaGFyIGF0bW9kZVtdID0gezB4NDEsIDB4NTR9Ow0KKyAgICBnZXRfYXRfY21kX3BhcmFtX2ludChhdF9zdHIsICZudHlwZSwgKGNvbnN0IGNoYXIgKiopJmF0X3N0cik7DQorICAgIA0KKyAgICBpZighaXNfYXRfY21kX2VuZChhdF9zdHIpKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsgDQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgICAgICByZXR1cm4gQVRfRU5EOw0KKyAgICB9ICAgDQorDQorICAgIGlmKG50eXBlID09IDEpDQorICAgIHsNCisgICAgICAgIHJldENvZGUgPSBhbXRfc2V0X2Jvb3Rtb2RlKGJvb3Rtb2RlKTsNCisgICAgfQ0KKyAgICBlbHNlIGlmKG50eXBlID09IDApDQorICAgIHsNCisgICAgICAgIG1lbXNldChib290bW9kZSwgMHhGRiwgMik7DQorICAgICAgICByZXRDb2RlID0gYW10X3NldF9ib290bW9kZShib290bW9kZSk7DQorICAgIH0NCisJZWxzZSBpZihudHlwZSA9PSAyKQ0KKwl7DQorCQlyZXRDb2RlID0gYW10X3NldF9hbXRfYXRtb2RlKGJvb3Rtb2RlLGF0bW9kZSk7DQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsgDQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgICAgICByZXR1cm4gQVRfRU5EOw0KKyAgICB9DQorICAgIGlmIChyZXRDb2RlID09IDApDQorICAgIHsNCisgICAgICAgIGlmIChudHlwZSA9PSAwKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJ2ZXJzaW9uVHlwZSIsIjAiKTsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2UgaWYobnR5cGUgPT0gMSkNCisgICAgICAgIHsNCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X3F1ZXJ5X3Jlc3VsdF9idWlsZCgidmVyc2lvblR5cGUiLCIxIik7DQorICAgICAgICB9DQorCQllbHNlIGlmKG50eXBlID09IDIpDQorICAgICAgICB7DQorICAgICAgICAgICAgKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoInZlcnNpb25UeXBlIiwiMiIpOw0KKyAgICAgICAgfQ0KKyAgICB9DQorICAgIGVsc2UNCisgICAgew0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOyANCisgICAgfSAgDQorICAgIA0KKyAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgIA0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBtYWNSZWFkX2FjdF9mdW5jDQorKiC5psTcw+jK9jogtsFNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6IE5W1tBNQUO12Na3zqpCQ0TC66Os0OjSqteqs8lBU0NJScLrDQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IG1hY1JlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGludCByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciBUbXBNYWNBZGRyW0NvbW1fREVWX01TSU5GT19NQVhfV0lGSU1BQ19BcmVhX0xlbl0gPSB7MH07Ly9pbWVps6S2yNfutPPWtQ0KKyAgICBjaGFyIHN0clsxM107DQorICAgIHVuc2lnbmVkIGxvbmcgYWJNYWNpbmRleCA9IDA7DQorICAgIHN0YXRpYyBjaGFyIG1hY3N0clsyICogQVRfQ01EX01BWCAtIDFdID0gezB9Ow0KKw0KKyAgICByZXRDb2RlID0gY3Budl9Odkl0ZW1SZWFkKE9TX0ZMQVNIX0FNVF9DT01NX1JPX1dJRklNQUNfQUREUkVTUywgKHVuc2lnbmVkIGNoYX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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IG1hY1dyaXRlX2FjdF9mdW5jDQorKiC5psTcw+jK9jog0LRNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IG1hY1dyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICAvL2xvbmcgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICAvL3pPc3NfQVNTRVJUKGF0X3BhcmFzIT1OVUxMKTsNCisgICAgYXRfc3RyID0gYXRfcGFyYXM7ICANCisNCisgICAgaWYgKHN0cmxlbihhdF9zdHIpICE9IERDX01hY0xlbikNCisgICAgew0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUEFSQU1fSU5WQUxJRCk7DQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgICAgICBpZiAoLTEgPT0gRENfV3JpdGVNYWNBZGRyKChjaGFyICopYXRfc3RyKSkNCisgICAgICAgIHsgICAgICAgICAgICAgICAgDQorICAgICAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIC8vKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoIk1BQyIsYXRfc3RyKTsNCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X29rX2J1aWxkKCk7DQorICAgICAgICB9DQorICAgIH0gICANCisgICAgDQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogd2lmaWtleVJlYWRfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiC78cihV2lmaUtlebXE1rUNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgd2lmaWtleVJlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGludCByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciBUbXBXaWZpS2V5W1pQU19SRUZfTVNJTkZPX01BWF9ORVdXSUZJS0VZX0xFTisxXT17MH07DQorICAgIA0KKyAgICByZXRDb2RlID0gY3Budl9Odkl0ZW1SZWFkKFpQU19SRUZfTVNJTkZPX05FV1dJRklLRVlfQkFTRV9BRERSLCAodW5zaWduZWQgY2hhciAqKVRtcFdpZmlLZXksIFpQU19SRUZfTVNJTkZPX01BWF9ORVdXSUZJS0VZX0xFTik7DQorCVRtcFdpZmlLZXlbWlBTX1JFRl9NU0lORk9fTUFYX05FV1dJRklLRVlfTEVOXSA9ICdcMCc7DQorCS8vek9zc19BU1NFUlQocmV0Q29kZSE9Wk9TU19FUlJPUik7IA0KKyAgICBpZihDUE5WX0VSUk9SID09IHJldENvZGUpDQorICAgIHsNCisgICAgICAgICBhdF9wcmludChBVF9FUlIsImNwbnZfTnZJdGVtUmVhZCB3aWZpa2V5IGZhaWwgIVxuIik7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7ICAgICANCisgICAgICAgICByZXR1cm4gQVRfRU5EOyANCisgICAgfQ0KKyAgICAvL3N0cmNweShUbXBXaWZpS2V5LCAoY29uc3QgY2hhciopY2ZnX2dldCgiendpZmlrZXkiKSk7DQorDQorICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJXSUZJS0VZIixUbXBXaWZpS2V5KTsNCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKw0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiB3aWZpa2V5V3JpdGVfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiDQtFdJRkkgS0VZtcTWtQ0KKyogss7K/cu1w/c6IChJTikNCisqICAgICAgICAgICAgICAgICAgICAgICAgIChPVVQpDQorKiC3tSC72CDWtTogzt4NCisqIMbky/zLtcP3Og0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KK2ludCB3aWZpa2V5V3JpdGVfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7DQorICAgIC8vY2hhciAqcFN0clZhbHVlID0gTlVMTDsNCisgICAgdW5zaWduZWQgbG9uZyByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisNCisgICAgLy96T3NzX0FTU0VSVChhdF9wYXJhcyE9TlVMTCk7DQorICAgIGF0X3N0ciA9IGF0X3BhcmFzOyAgDQorICAgIGlmKHN0cmxlbihhdF9zdHIpPiBaUFNfUkVGX01TSU5GT19NQVhfTkVXV0lGSUtFWV9MRU4pDQorICAgIHsgICAgICAgDQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsgICAgICAgDQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7ICAgICANCisgICAgICAgIHJldHVybiBBVF9FTkQ7DQorICAgIH0NCisNCisgICAgcmV0Q29kZSA9IGNwbnZfTnZJdGVtV3JpdGUoWlBTX1JFRl9NU0lORk9fTkVXV0lGSUtFWV9CQVNFX0FERFIsICh1bnNpZ25lZCBjaGFyICopYXRfc3RyLCBzdHJsZW4oYXRfc3RyKSk7DQorICAgIC8vY2ZnX3NldCgiendpZmlrZXkiLGF0X3N0cik7DQorICAgIA0KKyAgICBpZiAocmV0Q29kZSA9PSBDUE5WX09LKQ0KKyAgICB7DQorICAgICAgICByZXRDb2RlID0gY3Budl9OdnJhbUZsdXNoKCk7DQorDQorICAgICAgICBpZiAocmV0Q29kZSA9PSBDUE5WX09LKQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJXSUZJS0VZIixhdF9zdHIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfZXJyX2J1aWxkKEFURVJSX1BST0NfRkFJTEVEKTsNCisgICAgICAgIH0NCisgICAgICAgDQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgIH0NCisNCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiByajQ1TWFjQWRkclJlYWRfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiC2wU1BQ7XY1rcNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zogTlbW0E1BQ7XY1rfOqkJDRMLro6zQ6NKq16qzyUFTQ0lJwusNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgcmo0NU1hY0FkZHJSZWFkX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICB1bnNpZ25lZCBsb25nICAgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgICAgICAgICAgICBUbXBNYWNBZGRyW09TX0ZMQVNIX0FNVF9DT01NX1JPX0VUSE1BQ19TSVpFXSA9IHswfTsNCisgICAgY2hhciAgICAgICAgICAgIHN0clsxM107DQorICAgIGxvbmcgICAgICAgICAgICBhYk1hY2luZGV4ID0gMDsNCisgICAgc3RhdGljIGNoYXIgICAgIG1hY3N0clsyICogT1NfRkxBU0hfQU1UX0NPTU1fUk9fRVRITUFDX1NJWkUgLSAxXSA9IHswfTsNCisgICAgDQorICAgIHJldENvZGUgPSBjcG52X052SXRlbVJlYWQoT1NfRkxBU0h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gPSBzdHJsZW4oKnJlc19tc2cpOw0KKw0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiByajQ1TWFjQWRkV3JpdGVfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiDQtE1BQ7XY1rcNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zogTlbW0E1BQ7XY1rfOqkJDRMLro6zQ6NKq16qzyUFTQ0lJwusNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgcmo0NU1hY0FkZFdyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICAvL2xvbmcgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICAvL3pPc3NfQVNTRVJUKGF0X3BhcmFzIT1OVUxMKTsNCisgICAgYXRfc3RyID0gYXRfcGFyYXM7ICANCisNCisgICAgaWYgKHN0cmxlbihhdF9zdHIpIT0gRENfTWFjTGVuKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIGlmICgtMSA9PSBEQ19Xcml0ZVJKNDVNYWNBZGRyKChjaGFyICopYXRfc3RyKSkNCisgICAgICAgIHsgICAgICAgICAgICAgICAgDQorICAgICAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJFVEhNQUMiLGF0X3N0cik7DQorICAgICAgICB9DQorICAgIH0gICANCisgICAgDQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogbWFjMlJlYWRfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiC2wU1BQ7XY1rcNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zogTlbW0E1BQ7XY1rfOqkJDRMLro6zQ6NKq16qzyUFTQ0lJwusNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgbWFjMlJlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGxvbmcgICByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciAgICAgICAgICAgIFRtcE1hY0FkZHJbT1NfRkxBU0hfQU1UX0NPTU1fUk9fV0lGSU1BQzJfU0laRV0gPSB7MH07Ly9pbWVps6S2yNfutPPWtQ0KKyAgICBjaGFyICAgICAgICAgICAgc3RyWzEzXTsNCisgICAgbG9uZyAgICAgICAgICAgIGFiTWFjaW5kZXggPSAwOw0KKyAgICBz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ICAgKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoIk1BQzIiLG1hY3N0cik7DQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogbWFjMldyaXRlX2FjdF9mdW5jDQorKiC5psTcw+jK9jog0LRNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IG1hYzJXcml0ZV9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKiAqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgLy9sb25nICAgICByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciAgICAgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICAvL3pPc3NfQVNTRVJUKGF0X3BhcmFzIT1OVUxMKTsNCisgICAgYXRfc3RyID0gYXRfcGFyYXM7ICANCisNCisgICAgaWYgKHN0cmxlbihhdF9zdHIpIT0gRENfTWFjTGVuKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIGlmICgtMSA9PSBEQ19Xcml0ZU1hYzJBZGRyKChjaGFyICopYXRfc3RyKSkNCisgICAgICAgIHsgICAgICAgICAgICAgICAgDQorICAgICAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJNQUMyIixhdF9zdHIpOw0KKyAgICAgICAgfQ0KKyAgICB9ICAgDQorICAgIA0KKyAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorDQorICAgIHJldHVybiBBVF9FTkQ7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IHVzYm1hY1JlYWRfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiC2wVVTQiBNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6IE5W1tBNQUO12Na3zqpCQ0TC66Os0OjSqteqs8lBU0NJScLrDQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IHVzYm1hY1JlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGxvbmcgICByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciAgICAgICAgICAgIFRtcE1hY0FkZHJbT1NfRkxBU0hfQU1UX0NPTU1fUk9fVVNCTUFDX1NJWkVdID0gezB9Oy8vaW1labOktsjX7rTz1rUNCisgICAgY2hhciAgICAgICAgICAgIHN0clsxM107DQorICAgIGxvbmcgICAgICAgICAgICBhYk1hY2luZGV4ID0gMDsNCisgICAgc3RhdGljIGNoYXIgICAgIG1hY3N0clsyICogT1NfRkxBU0hfQU1UX0NPTU1fUk9fVVNCTUFDX1NJWkUgLSAxXSA9IHswfTsNCisNCisgICAgcmV0Q29kZSA9IGNwbnZfTnZJdGVtUmVhZChPU19GTEFTSF9BTVRfQ09NTV9ST19VU0JNQUNfQUREUkVTUywgKFVJTlQ4ICopVG1wTWFjQWRkciwgT1NfRkxBU0hfQU1UX0NPTU1fUk9fVVNCTUFDX1NJWkUpOw0KKyAgICANCisgICAgaWYgKENQTlZfRVJST1IgPT0gcmV0Q29kZSApDQorICAgIHsNCisgICAgICAgICpyZXNfbXNnID0gYXRfZXJyX2J1aWxkKEFURVJSX1BST0NfRkFJTEVEKTsNCisgICAgICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsgICAgIA0KKyAgICAgICAgcmV0dXJuIEFUX0VORDsNCisgICAgfQ0KKw0KKyAgICAvKiBNQUO12Na316q7u0JDRMLr16q7u86qQXNjaWkgICovDQorICAgIG1lbXNldChzdHIsIDAsIDEzKTsNCisNCisgICAgZm9yIChhYk1hY2luZGV4ID0gMDsgYWJNYWNpbmRleDwgMTI7IGFiTWFjaW5kZXggKz0gMikNCisgICAgew0KKyAgICAgICAgc3RyW2FiTWFjaW5kZXhdID0gKChUbXBNYWNBZGRyW2FiTWFjaW5kZXgvMl0pID4+IDQpICYgMHgwRjsNCisgICAgICAgIHN0clthYk1hY2luZGV4KzFdID0gVG1wTWFjQWRkclthYk1hY2luZGV4LzJdICYgMHgwRjsNCisNCisgICAgICAgIG1hY3N0clthYk1hY2luZGV4XSA9IEJDRDJBc2NpaShzdHJbYWJNYWNpbmRleF0pOw0KKyAgICAgICAgbWFjc3RyW2FiTWFjaW5kZXgrMV0gPSBCQ0QyQXNjaWkoc3RyW2FiTWFjaW5kZXgrMV0pOw0KKyAgICB9DQorDQorICAgIC8qIE1BQ7XY1rfXqru7veHK+CovDQorICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJVU0JNQUMiLG1hY3N0cik7DQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorKiC6r8r9w/uzxjogdXNibWFjV3JpdGVfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiDQtFVTQiBNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IHVzYm1hY1dyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICAvL2xvbmcgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICAvL3pPc3NfQVNTRVJUKGF0X3BhcmFzIT1OVUxMKTsNCisgICAgYXRfc3RyID0gYXRfcGFyYXM7ICANCisNCisgICAgaWYgKHN0cmxlbihhdF9zdHIpIT0gRENfTWFjTGVuKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIGlmICgtMSA9PSBEQ19Xcml0ZVVTQk1hY0FkZHIoKGNoYXIgKilhdF9zdHIpKQ0KKyAgICAgICAgeyAgICAgICAgICAgICAgICANCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgICAgICB9DQorICAgICAgICBlbHNlDQorICAgICAgICB7DQorICAgICAgICAgICAgKnJlc19tc2cgPSBhdF9xdWVyeV9yZXN1bHRfYnVpbGQoIlVTQk1BQyIsYXRfc3RyKTsNCisgICAgICAgIH0NCisgICAgfSAgIA0KKyAgICANCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKw0KKyAgICByZXR1cm4gQVRfRU5EOw0KKw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBnbWFjUmVhZF9hY3RfZnVuYw0KKyoguabE3MPoyvY6ILbBR01BQ7XY1rcNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zogTlbW0E1BQ7XY1rfOqkJDRMLro6zQ6NKq16qzyUFTQ0lJwusNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCitpbnQgZ21hY1JlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGxvbmcgICByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciAgICAgICAgICAgIFRtcE1hY0FkZHJbT1NfRkxBU0hfQU1UX0NPTU1fUk9fR01BQ19TSVpFXSA9IHswfTsvL2ltZWmzpLbI1+6089a1DQorICAgIGNoYXIgICAgICAgICAgICBzdHJbMTNdOw0KKyAgICBsb25nICAgICAgICAgICAgYWJNYWNpbmRleCA9IDA7DQ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F1ZXJ5X3Jlc3VsdF9idWlsZCgiR01BQyIsbWFjc3RyKTsNCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBnbWFjV3JpdGVfYWN0X2Z1bmMNCisqILmmxNzD6Mr2OiDQtEdNQUO12Na3DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IGdtYWNXcml0ZV9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKiAqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgLy9sb25nIHJldENvZGUgPSBDUE5WX0VSUk9SOw0KKyAgICBjaGFyICphdF9zdHIgPSBOVUxMOyANCisNCisgICAgLy96T3NzX0FTU0VSVChhdF9wYXJhcyE9TlVMTCk7DQorICAgIGF0X3N0ciA9IGF0X3BhcmFzOyAgDQorDQorICAgIGlmIChzdHJsZW4oYXRfc3RyKSE9IERDX01hY0xlbikNCisgICAgew0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUEFSQU1fSU5WQUxJRCk7DQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgICAgICBpZiAoLTEgPT0gRENfV3JpdGVHbWFjQWRkcigoY2hhciAqKWF0X3N0cikpDQorICAgICAgICB7ICAgICAgICAgICAgICAgIA0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfZXJyX2J1aWxkKEFURVJSX1BST0NfRkFJTEVEKTsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2UNCisgICAgICAgIHsNCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X3F1ZXJ5X3Jlc3VsdF9idWlsZCgiR01BQyIsYXRfc3RyKTsNCisgICAgICAgIH0NCisgICAgfSAgIA0KKyAgICANCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKw0KKyAgICByZXR1cm4gQVRfRU5EOw0KKyAgIA0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiBiYXRkZXRSZWFkX2FjdF9mdW5jDQorKiC5psTcw+jK9jogu/HIoUJBVERFVLXE1rUNCisqILLOyv3LtcP3OiAoSU4pDQorKiAgICAgICAgICAgICAgICAgICAgICAgICAoT1VUKQ0KKyogt7Ugu9gg1rU6IM7eDQorKiDG5Mv8y7XD9zoNCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitpbnQgYmF0ZGV0UmVhZF9hY3RfZnVuYyhpbnQgYXRfZmQsY2hhciAqIGF0X3BhcmFzLHZvaWQgKiAqcmVzX21zZyxpbnQgKiByZXNfbXNnbGVuKQ0KK3sNCisgICAgdW5zaWduZWQgaW50IHJldENvZGUgICAgICAgID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciBUbXBCYXRkZXRbMzJdICA9IHswfTsNCisgICAgaW50ICBudl92YWx1ZSAgICAgICA9ICAwOw0KKyAgICAgICAgDQorICAgIHJldENvZGUgPSBjcG52X052SXRlbVJlYWQoRFJWX1BFUklfTlZfQUREUiwgKHVuc2lnbmVkIGNoYXIgKikmbnZfdmFsdWUsIDEpOw0KKyAgICANCisgICAgYXRfcHJpbnQoQVRfREVCVUcsICJiYXRkZXRSZWFkX2FjdF9mdW5jOm52X3ZhbHVlID0gJWRcbiIsIG52X3ZhbHVlKTsNCisgICAgDQorICAgIHNucHJpbnRmKChjaGFyICopVG1wQmF0ZGV0LCAzMiwgIiVkIiwgbnZfdmFsdWUpOw0KKwlpZihyZXRDb2RlICE9IENQTlZfRVJST1IpDQorCXsNCisgICAgCSpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJCQVRERVQiLCBUbXBCYXRkZXQpOw0KKyAgICAJKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKwl9DQorCWVsc2UNCisJew0KKwkJKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOw0KKyAgICAgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKwl9DQorICAgIHJldHVybiBBVF9FTkQ7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyoguq/K/cP7s8Y6IGJhdGRldFdyaXRlX2FjdF9mdW5jDQorKiC5psTcw+jK9jog0LRCQVRERVS1xNa1DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6DQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IGJhdGRldFdyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorCWNoYXIgICAgICAgICAgKmF0X3N0ciAgICAgICAgID0gTlVMTDsNCisgICAgLy9jaGFyICAgICAgICAgICpwU3RyVmFsdWUgICAgICA9IE5VTEw7DQorICAgIC8vY2h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isgICAgICAgIAkqcmVzX21zZyA9IGF0X3F1ZXJ5X3Jlc3VsdF9idWlsZCgiQkFUREVUIiwiMSIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJCQVRERVQiLCIwIik7DQorICAgICAgICB9DQorCX0NCisgICAgZWxzZQ0KKyAgICB7DQorICAgIAkqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgIH0NCisgICAgICAgICAgICAgICAgDQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQoraW50IG1zblJlYWRfYWN0X2Z1bmMoaW50IGF0X2ZkLGNoYXIgKiBhdF9wYXJhcyx2b2lkICogKnJlc19tc2csaW50ICogcmVzX21zZ2xlbikNCit7DQorICAgIHVuc2lnbmVkIGludCByZXRDb2RlID0gQ1BOVl9FUlJPUjsNCisgICAgY2hhciBUbXBNU05bTVNOX01BWF9OVklORk9fTEVOKzFdPSB7MH07DQorICAgICANCisgICAgcmV0Q29kZSA9IGNwbnZfTnZJdGVtUmVhZChPU19GTEFTSF9BTVRfQ09NTV9ST19NU2VyaWFsTnVtX0FERFJFU1MsIChVSU5UOCAqKVRtcE1TTiwgTVNOX01BWF9OVklORk9fTEVOKTsNCisJVG1wTVNOW01TTl9NQVhfTlZJTkZPX0xFTl0gPSAnXDAnOw0KKyAgICBpZihyZXRDb2RlICE9IENQTlZfRVJST1IpDQorICAgIHsNCisgICAgICAgICpyZXNfbXNnID0gYXRfcXVlcnlfcmVzdWx0X2J1aWxkKCJNU04iLFRtcE1TTik7DQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7ICAgDQorICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QUk9DX0ZBSUxFRCk7DQorICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgIH0NCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQoraW50IG1zbldyaXRlX2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICB1bnNpZ25lZCBpbnQgcmV0Q29kZSA9IENQTlZfRVJST1I7DQorICAgIGNoYXIgKmF0X3N0ciA9IE5VTEw7IA0KKw0KKyAgICBpZihOVUxMICE9YXRfcGFyYXMpDQorICAgIHsNCisgICAgICAgIGF0X3N0ciA9IGF0X3BhcmFzOyANCisgICAgICAgIGF0X3ByaW50KEFUX0RFQlVHLCJtc25Xcml0ZV9hY3RfZnVuYyA9ICVzLlxuIiwgYXRfc3RyKTsNCisgICAgICAgIGlmKChzdHJsZW4oYXRfc3RyKSA+PSAxMikgJiYgKHN0cmxlbihhdF9zdHIpIDw9IDIwKSkNCisgICAgICAgIHsNCisgICAgICAgICAgICByZXRDb2RlID0gYW10X252cm9fd3JpdGUoT1NfRkxBU0hfQU1UX0NPTU1fUk9fTVNlcmlhbE51bV9BRERSRVNTLCBNU05fTUFYX05WSU5GT19MRU4sICh1bnNpZ25lZCBjaGFyICopYXRfc3RyKTsNCisgICAgICAgICAgICBpZihyZXRDb2RlICE9IENQTlZfRVJST1IpDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICAqcmVzX21zZyA9IGF0X29rX2J1aWxkKCk7DQorICAgICAgICAgICAgICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgICAgICAgICAgICAgcmV0dXJuIEFUX0VORDsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQ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k7DQorICAgIHJldHVybiBBVF9FTkQ7ICAgIA0KK30NCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisqILqvyv3D+7PGOiB6c29mdHJlc2V0X2FjdF9mdW5jDQorKiC5psTcw+jK9jogyejWw8jtvP7W2Mb0DQorKiCyzsr9y7XD9zogKElOKQ0KKyogICAgICAgICAgICAgICAgICAgICAgICAgKE9VVCkNCisqILe1ILvYINa1OiDO3g0KKyogxuTL/Mu1w/c6IA0KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KK2ludCB6c29mdHJlc2V0X2FjdF9mdW5jKGludCBhdF9mZCxjaGFyICogYXRfcGFyYXMsdm9pZCAqICpyZXNfbXNnLGludCAqIHJlc19tc2dsZW4pDQorew0KKyAgICAvL2NoYXIgKnBQdHIgPSBOVUxMOyANCisgICAgDQorICAgIC8vek9zc19TeXNTb2Z0UmVzZXQoU1lTX1JFU0VUX1RPX05PUk1BTCk7ICANCisgICAgaXBjX3NlbmRfbWVzc2FnZShNT0RVTEVfSURfQVRfQ1RMLE1PRFVMRV9JRF9NQUlOX0NUUkwsIE1TR19DTURfUkVTVEFSVF9SRVFVRVNULCAwLCBOVUxMLDApOw0KKw0KKyAgICAqcmVzX21zZyA9IGF0X3F1ZXJ5X3Jlc3VsdF9idWlsZCgiWlNPRlRSRVNFVCIsICIiKTsNCisgICAgKnJlc19tc2dsZW4gPSBzdHJsZW4oKnJlc19tc2cpOw0KKyAgICANCisgICAgcmV0dXJuIEFUX0VORDsgIA0KK30NCisNCitpbnQgZXh0X3JhbWR1bXBfZnVuYyhjaGFyICphdF9wYXJhcywgdm9pZCAqKiByZXNfbXNnKQ0KK3sNCisgICAgYXNzZXJ0KDApOw0KKyAgICByZXR1cm4gQVRfRU5EOw0KK30NCisNCitpbnQgem1vZGVTZ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PSBhbXRfc2V0X2Jvb3Rtb2RlKGJvb3Rtb2RlKTsNCisgICAgICAgICAgICBicmVhazsNCisgICAgICAgIH0NCisgICAgICAgIGNhc2UgMTovL2RlYnVnIG1vZGUNCisgICAgICAgIHsNCisgICAgICAgICAgICBudl9zZXRfaXRlbShOVl9STywgInVzYl9tb2RldHlwZSIsICJkZWJ1ZyIsIDEpOw0KKyAgICAgICAgICAgIGJvb3Rtb2RlWzFdID0weDAxOw0KKyAgICAgICAgICAgIHJldENvZGUgPSBhbXRfc2V0X2Jvb3Rtb2RlKGJvb3Rtb2RlKTsNCisgICAgICAgICAgICBicmVhazsNCisgICAgICAgIH0NCisgICAgICAgIGNhc2UgMjovL2ZhY3RvcnkgbW9kZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIG52X3NldF9pdGVtKE5WX1JPLCAidXNiX21vZGV0eXBlIiwgImZhY3RvcnkiLCAxKTsNCisgICAgICAgICAgICBib290bW9kZVsxXSA9MHgwMjsNCisgICAgICAgICAgICByZXRDb2RlID0gYW10X3NldF9ib290bW9kZShib290bW9kZSk7DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorICAgICAgICBjYXNlIDM6Ly9hbXQgbW9kZQ0KKyAgICAgICAgew0KKyAgICAgICAgICAgIC8vbnZfc2V0X2l0ZW0oTlZfUk8sICJ1c2JfbW9kZXR5cGUiLCAiYW10IiwgMSk7DQorICAgICAgICAgICAgcmV0Q29kZSA9IGFtdF9zZXRfYm9vdG1vZGUoYm9vdG1vZGUpOw0KKyAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZGVmYXVsdDoNCisgICAgICAgIHsNCisgICAgICAgICAgICAqcmVzX21zZyA9IGF0X2Vycl9idWlsZChBVEVSUl9QQVJBTV9JTlZBTElEKTsNCisgICAgICAgICAgICAqcmVzX21zZ2xlbiA9IHN0cmxlbigqcmVzX21zZyk7DQorICAgICAgICAgICAgcmV0dXJuIEFUX0VORDsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICBudl9jb21taXQoTlZfUk8pOw0KKyAgICANCisgICAgYXRfcHJpbnQoQVRfREVCVUcsInptb2RlU2V0X2FjdF9mdW5jOnJldENvZGUgPT0gJWRcbiIsIHJldENvZGUpOw0KKyAgICBpZiAocmV0Q29kZSA9PSAwKQ0KKyAgICB7DQorICAgICAgICAqcmVzX21zZyA9IGF0X29rX2J1aWxkKCk7ICAgDQorICAgIH0NCisgICAgZWxzZQ0KKyAgICB7ICAgICAgIA0KKyAgICAgICAgKnJlc19tc2cgPSBhdF9lcnJfYnVpbGQoQVRFUlJfUFJPQ19GQUlMRUQpOyANCisgICAgfSAgDQorICAgICpyZXNfbXNnbGVuID0gc3RybGVuKCpyZXNfbXNnKTsNCisgICAgcmV0dXJuIEFUX0VORDsNCit9DQorDQoraW50IHdyaXRlX3NlY3VyaXR5X2luZm8oaW50IGF0X2ZkLCBjaGFyICphdF9wYXJhcywgdm9pZCAqKnJlc19tc2csIGludCAqcmVzX21zZ2xlbikNCit7DQorICAgIFVJTlQzMiBwdWJLZXlIYXNoWzRdID0gezB9Ow0KKyAgICBVSU5UMzIgc2VjdXJlRmxhZyA9IDB4RkY7DQorICAgIFRfWkRydkVmdXNlX1NlY3VyZSBlZnVzZUluZm8gPSB7ezB9fTsNCisgICAgY2hhciBzdHJWYWx1ZVsxNl07DQorICAgIGNoYXIgc3RyTG9nWzI1Nl0gPSB7MH07DQorICAgIG1kNV9jdHggc3RTdGM7DQorICAgIGludCBpOw0KKwlpbnQgZWZ1c2VfZmQgPSAtMTsNCisJLy9pbnQgcmV0ID0gLTE7DQorDQorICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqu/HIobmr1L9oYXNoKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorICAgIC8vILvxyKG5q9S/DQorCWVmdXNlX2ZkID0gb3BlbigiL2Rldi9lZnVzZSIsIE9fUkRXUik7DQorCWlmIChlZnVzZV9mZCA8IDApIHsNCisJ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RyTG9nWzBdID0gJ1wwJzsNCisgICAgZm9yIChpID0gMDsgaSA8IHNpemVvZihwdWJLZXlIYXNoKS9zaXplb2YoVUlOVDMyKTsgaSsrKQ0KKyAgICB7DQorICAgICAgICBwdWJLZXlIYXNoW2ldID0gKChwdWJLZXlIYXNoW2ldICYgMHhmZjAwMDAwMCkgPj4gMjQpDQorICAgICAgICAgICAgICAgICAgICAgICAgfCAoKHB1YktleUhhc2hbaV0gJiAweDAwZmYwMDAwKSA+Pgk4KQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHwgKChwdWJLZXlIYXNoW2ldICYgMHgwMDAwZmYwMCkgPDwJOCkNCisgICAgICAgICAgICAgICAgICAgICAgICB8ICgocHViS2V5SGFzaFtpXSAmIDB4MDAwMDAwZmYpIDw8IDI0KSA7DQorDQorICAgICAgICBzcHJpbnRmKHN0clZhbHVlLCAiJTA4bFgiLCBwdWJLZXlIYXNoW2ldKTsNCisgICAgICAgIHN0cmNhdChzdHJMb2csIHN0clZhbHVlKTsNCisgICAgfQ0KKw0KKyAgICBhdF9wcmludChBVF9OT1JNQUwsICJQdWJsaWMga2V5IGhhc2g6ICVzXHIiLCBzdHJMb2cpOw0KKwkNCisJLyoqKioqKioqKioqKioqKioqKioqKioqKiq9q7CyyKvQxc+i0LTI62VmdXNlKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorCQ0KKwlpZiAobWVtY21wKGVmdXNlSW5mby5wdWJLZXlIYXNoLCBwdWJLZXlIYXNoLCBzaXplb2YocHViS2V5SGFzaCkpICE9IDApDQorCXsNCisJCS8vILmr1L9oYXNo1rXQtMjrZWZ1c2UNCisJCWlmIChpb2N0bChlZnVzZV9mZCAsIEVGVVNFX1NFVF9QVUJfS0VZX0hBU0gsIHB1YktleUhhc2gpICE9IDApDQorCQl7DQorCSAgICAJYXRfcHJpbnQoQVRfRVJSLCAiV3JpdGUgcHVibGljIGtleSBoYXNoIHRvIGVmdXNlIGZhaWwhXHIiKTsNCisJCQkqcmV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