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cmssIHRoZSBsYXllciBpcyBsaWtlOgorCisgICAgICAgICAgICAgICAgICAgTVRECisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICAgICAgICAgICAgIG0yNXA4MAorICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisJICAgICAgIFNQSSBidXMgZHJpdmVyCisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKwkgICAgICAgIFNQSSBOT1IgY2hpcAorCisgICBBZnRlciB0aGlzIGZyYW1ld29yaywgdGhlIGxheWVyIGlzIGxpa2U6CisgICAgICAgICAgICAgICAgICAgTVRECisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICAgICAgICAgU1BJIE5PUiBmcmFtZXdvcmsKKyAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAgICAgICAgICAgbTI1cDgwCisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKwkgICAgICAgU1BJIGJ1cyBkcml2ZXIKKyAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCSAgICAgICBTUEkgTk9SIGNoaXAKKworICBXaXRoIHRoZSBTUEkgTk9SIGNvbnRyb2xsZXIgZHJpdmVyIChGcmVlc2NhbGUgUXVhZFNQSSksIGl0IGxvb2tzIGxpa2U6CisgICAgICAgICAgICAgICAgICAgTVRECisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICAgICAgICAgU1BJIE5PUiBmcmFtZXdvcmsKKyAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAgICAgICAgIGZzbC1xdWFkU1BJCisgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKwkgICAgICAgU1BJIE5PUiBjaGlwCisKK1BhcnQgSUlJIC0gSG93IGNhbi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4CisgICAgYnBmX21vdiBSNSwgOQorICAgIGJwZl9jYWxsIGJhcgorICAgIGJwZl9hZGQgUjAsIFI3CisgICAgYnBmX2V4aXQKKworICBBZnRlciBKSVQgdG8geDg2XzY0IG1heSBsb29rIGxpa2U6CisKKyAgICBwdXNoICVyYnAKKyAgICBtb3YgJXJzcCwlcmJwCisgICAgc3ViICQweDIyOCwlcnNwCisgICAgbW92ICVyYngsLTB4MjI4KCVyYnApCisgICAgbW92ICVyMTMsLTB4MjIwKCVyYnApCisgICAgbW92ICVyZGksJXJieAorICAgIG1vdiAkMHgyLCVlc2kKKyAgICBtb3YgJDB4MywlZWR4CisgICAgbW92ICQweDQsJWVjeAorICAgIG1vdiAkMHg1LCVyOGQKKyAgICBjYWxscSBmb28KKyAgICBtb3YgJXJheCwlcjEzCisgICAgbW92ICVyYngsJXJkaQorICAgIG1vdiAkMHgyLCVlc2kKKyAgICBtb3YgJDB4MywlZWR4CisgICAgbW92ICQweDQsJWVjeAorICAgIG1vdiAkMHg1LCVyOGQKKyAgICBjYWxscSBiYXIKKyAgICBhZGQgJXIxMywlcmF4CisgICAgbW92IC0weDIyOCglcmJwKSwlcmJ4CisgICAgbW92IC0weDIyMCglcmJwKSwlcjEzCisgICAgbGVhdmVxCisgICAgcmV0cQorCisgIFdoaWNoIGlzIGluIHRoaXMgZXhhbXBsZSBlcXVpdmFsZW50IGluIEMgdG86CisKKyAgICB1NjQgYnBmX2ZpbHRlcih1NjQgY3R4KQorICAgIHsKKyAgICAgICAgcmV0dXJuIGZvbyhjdHgsIDIsIDMsIDQsIDUpICsgYmFyKGN0eCwgNiwgNywgOCwgOSk7CisgICAgfQorCisgIEluLWtlcm5lbCBmdW5jdGlvbnMgZm9vKCkgYW5kIGJhcigpIHdpdGggcHJvdG90eXBlOiB1NjQgKCopKHU2NCBhcmcxLCB1NjQKKyAgYXJnMiwgdTY0IGFyZzMsIHU2NCBhcmc0LCB1NjQgYXJnNSk7IHdpbGwgcmVjZWl2ZSBhc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S0tLS0tLS0tLS0tLS0tLS0tKworICB8ICAgNCBiaXRzICAgICAgIHwgIDEgYml0IHwgICAzIGJpdHMgICAgICAgICAgIHwKKyAgfCBvcGVyYXRpb24gY29kZSB8IHNvdXJjZSB8IGluc3RydWN0aW9uIGNsYXNzICB8CisgICstLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tKworICAoTVNCKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExTQikKKworVGhyZWUgTFNCIGJpdHMgc3RvcmUgaW5zdHJ1Y3Rpb24gY2xhc3Mgd2hpY2ggaXMgb25lIG9mOgorCisgIENsYXNzaWMgQlBGIGNsYXNzZXM6ICAgIGVCUEYgY2xhc3NlczoKKworICBCUEZfTEQgICAgMHgwMCAgICAgICAgICBCUEZfTEQgICAgMHgwMAorICBCUEZfTERYICAgMHgwMSAgICAgICAgICBCUEZfTERYICAgMHgwMQorICBCUEZfU1QgICAgMHgwMiAgICAgICAgICBCUEZfU1QgICAgMHgwMgorICBCUEZfU1RYICAgMHgwMyAgICAgICAgICBCUEZfU1RYICAgMHgwMworICBCUEZfQUxVICAgMHgwNCAgICAgICAgICBCUEZfQUxVICAgMHgwNAorICBCUEZfSk1QICAgMHgwNSAgICAgICAgICBCUEZfSk1QICAgMHgwNQorICBCUEZfUkVUICAgMHgwNiAgICAgICAgICBbIGNsYXNzIDYgdW51c2VkLCBmb3IgZnV0dXJlIGlmIG5lZWRlZCBdCisgIEJQRl9NSVNDICAweDA3ICAgICAgICAgIEJQRl9BTFU2NCAweDA3CisKK1doZW4gQlBGX0NMQVNTKGNvZGUpID09IEJQRl9BTFUgb3IgQlBGX0pNUCwgNHRoIGJpdCBlbmNvZGVzIHNvdXJjZSBvcGVyYW5kIC4uLgorCisgIEJQRl9LICAgICAweDAwCisgIEJQRl9YICAgICAweDA4CisKKyAqIGluIGNsYXNzaWMgQlBGLCB0aGlzIG1lYW5zOgorCisgIEJQ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gICAgICAgU01JLCAgICBGLCAgMSwgICAgICBSICApLAorCUNNRCggIE1JX1dBSVRfRk9SX0VWRU5ULCAgICAgICAgICAgICAgICBTTUksICAgIEYsICAxLCAgICAgIE0gICksCisJQ01EKCAgTUlfQVJCX0NIRUNLLCAgICAgICAgICAgICAgICAgICAgIFNNSSwgICAgRiwgIDEsICAgICAgUyAgKSwKKwlDTUQoICBNSV9SRVBPUlRfSEVBRCwgICAgICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1JX1NVU1BFTkRfRkxVU0gsICAgICAgICAgICAgICAgICBTTUksICAgIEYsICAxLCAgICAgIFMgICksCisJQ01EKCAgTUlfU0VNQVBIT1JFX01CT1gsICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4RkYsICAgUiAgKSwKKwlDTUQoICBNSV9TVE9SRV9EV09SRF9JTkRFWCwgICAgICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBSICApLAorCUNNRCggIE1JX0xPQURfUkVHSVNURVJfSU1NKDEpLCAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIFcsCisJICAgICAgLnJlZyA9IHsgLm9mZnNldCA9IDEsIC5tYXNrID0gMHgwMDdGRkZGQyB9ICAgICAgICAgICAgICAgKSwKKwlDTUQoICBNSV9TVE9SRV9SRUdJU1RFUl9NRU0oMSksICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBXIHwgQiwKKwkgICAgICAucmVnID0geyAub2Zmc2V0ID0gMSwgLm1hc2sgPSAweDAwN0ZGRkZDIH0sCisJICAgICAgLmJpdHMgPSB7eworCQkJLm9mZnNldCA9IDAsCisJCQkubWFzayA9IE1JX0dMT0JBTF9HVFQsCisJCQkuZXhwZWN0ZWQgPSAwLAorCSAgICAgIH19LAkJCQkJCSAgICAgICApLAorCUNNRCggIE1JX0xPQURfUkVHSVNURVJfTUVNLCAgICAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIFcgfCBCLAorCSAgICAgIC5yZWcgPSB7IC5vZmZzZXQgPSAxLCAubWFzayA9IDB4MDA3RkZGRkMgfSwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMCwKKwkJCS5tYXNrID0gTUlfR0xPQkFMX0dUVCwKKwkJCS5leHBlY3RlZCA9IDAsCisJICAgICAgfX0sCQkJCQkJICAgICAgICksCisJQ01EKCAgTUlfQkFUQ0hfQlVGRkVSX1NUQVJULCAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4RkYsICAgUyAgKSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZHJtX2k5MTVfY21kX2Rlc2NyaXB0b3IgcmVuZGVyX2NtZHNbXSA9IHsKKwlDTUQoICBNSV9GTFVTSCwgICAgICAgICAgICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1JX0FSQl9PTl9PRkYsICAgICAgICAgICAgICAgICAgICBTTUksICAgIEYsICAxLCAgICAgIFIgICksCisJQ01EKCAgTUlfUFJFRElDQVRFLCAgICAgICAgICAgICAgICAgICAgIFNNSSwgICAgRiwgIDEsICAgICAgUyAgKSwKKwlDTUQoICBNSV9UT1BPTE9HWV9GSUxURVIsICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1JX0RJU1BMQVlfRkxJUCwgICAgICAgICAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIFIgICksCisJQ01EKCAgTUlfU0VUX0NPTlRFWFQsICAgICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4RkYsICAgUiAgKSwKKwlDTUQoICBNSV9VUkJfQ0xFQVIsICAgICAgICAgICAgICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBTICApLAorCUNNRCggIE1JX1NUT1JFX0RXT1JEX0lNTSwgICAgICAgICAgICAgICBTTUksICAgIUYsICAweDNGLCAgIEIsCisJICAgICAgLmJpdHMgPSB7eworCQkJLm9mZnNldCA9IDAsCisJCQkubWFzayA9IE1JX0dMT0JBTF9HVFQsCisJCQkuZXhwZWN0ZWQgPSAwLAorCSAgICAgIH19LAkJCQkJCSAgICAgICApLAorCUNNRCggIE1JX1VQREFURV9HVFQsICAgICAgICAgICAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIFIgICksCisJQ01EKCAgTUlfQ0xGTFVTSCwgICAgICAgICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4M0ZGLCAgQiwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMCwKKwkJCS5tYXNrID0gTUlfR0xPQkFMX0dUVCwKKwkJCS5leHBlY3RlZCA9IDAsCisJICAgICAgfX0sCQkJCQkJICAgICAgICksCisJQ01EKCAgTUlfUkVQT1JUX1BFUkZfQ09VTlQsICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4M0YsICAgQiwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMSwKKwkJCS5tYXNrID0gTUlfUkVQT1JUX1BFUkZfQ09VTlRfR0dUVCwKKwkJCS5leHBlY3RlZCA9IDAsCisJICAgICAgfX0sCQkJCQkJICAgICAgICksCisJQ01EKCAgTUlfQ09ORElUSU9OQUxfQkFUQ0hfQlVGRkVSX0VORCwgIFNNSSwgICAhRiwgIDB4RkYsICAgQiwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMCwKKwkJCS5tYXNrID0gTUlfR0xPQkFMX0dUVCwKKwkJCS5leHBlY3RlZCA9IDAsCisJICAgICAgfX0sCQkJCQkJICAgICAgICksCisJQ01EKCAgR0ZYX09QXzNEU1RBVEVfVkZfU1RBVElTVElDUywgICAgIFMzRCwgICAgRiwgIDEsICAgICAgUyAgKSwKKwlDTUQoICBQSVBFTElORV9TRUxFQ1QsICAgICAgICAgICAgICAgICAgUzNELCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1FRElBX1ZGRV9TVEFURSwJCQlTM0QsICAgIUYsICAweEZGRkYsIEIsCisJICAgICAgLmJpdHMgPSB7eworCQkJLm9mZnNldCA9IDIsCisJCQkubWFzayA9IE1FRElBX1ZGRV9TVEFURV9NTUlPX0FDQ0VTU19NQVNLLAorCQkJLmV4cGVjdGVkID0gMCwKKwkgICAgICB9fSwJCQkJCQkgICAgICAgKSwKKwlDTUQoICBHUEdQVV9PQkpFQ1QsICAgICAgICAgICAgICAgICAgICAgUzNELCAgICFGLCAgMHhGRiwgICBTICApLAorCUNNRCggIEdQR1BVX1dBTEtFUiwgICAgICAgICAgICAgICAgICAgICBTM0QsICAgIUYsICAweEZGLCAgIFMgICksCisJQ01EKCAgR0ZYX09QXzNEU1RBVEVfU09fREVDTF9MSVNULCAgICAgIFMzRCwgICAhRiwgIDB4MUZGLCAgUyAgKSwKKwlDTUQoICBHRlhfT1BfUElQRV9DT05UUk9MKDUpLCAgICAgICAgICAgUzNELCAgICFGLCAgMHhGRiwgICBCLAorCSAgICAgIC5iaXRzID0ge3sKKwkJCS5vZmZzZXQgPSAxLAorCQkJLm1hc2sgPSAoUElQRV9DT05UUk9MX01NSU9fV1JJVEUgfCBQSVBFX0NPTlRST0xfTk9USUZZKSwKKwkJCS5leHBlY3RlZCA9IDAsCisJICAgICAgfSwKKwkgICAgICB7CisJCQkub2Zmc2V0ID0gMSwKKwkJICAgICAgICAubWFzayA9IChQSVBFX0NPTlRST0xfR0xPQkFMX0dUVF9JVkIgfAorCQkJCSBQSVBFX0NPTlRST0xfU1RPUkVfREFUQV9JTkRFWCksCisJCQkuZXhwZWN0ZWQgPSAwLAorCQkJLmNvbmRpdGlvbl9vZmZzZXQgPSAxLAorCQkJLmNvbmRpdGlvbl9tYXNrID0gUElQRV9DT05UUk9MX1BPU1RfU1lOQ19PUF9NQVNLLAorCSAgICAgIH19LAkJCQkJCSAgICAgICApLAorfTsKKworc3RhdGljIGNvbnN0IHN0cnVjdCBkcm1faTkxNV9jbWRfZGVzY3JpcHRvciBoc3dfcmVuZGVyX2NtZHNbXSA9IHsKKwlDTUQoICBNSV9TRVRfUFJFRElDQVRFLCAgICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1JX1JTX0NPTlRST0wsICAgICAgICAgICAgICAgICAgICBTTUksICAgIEYsICAxLCAgICAgIFMgICksCisJQ01EKCAgTUlfVVJCX0FUT01JQ19BTExPQywgICAgICAgICAgICAgIFNNSSwgICAgRiwgIDEsICAgICAgUyAgKSwKKwlDTUQoICBNSV9SU19DT05URVhULCAgICAgICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBTICApLAorCUNNRCggIE1JX0xPQURfU0NBTl9MSU5FU19JTkNMLCAgICAgICAgICBTTUksICAgIUYsICAweDNGLCAgIE0gICksCisJQ01EKCAgTUlfTE9BRF9TQ0FOX0xJTkVTX0VYQ0wsICAgICAgICAgIFNNSSwgICAhRiwgIDB4M0YsICAgUiAgKSwKKwlDTUQoICBNSV9MT0FEX1JFR0lTVEVSX1JFRywgICAgICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBSICApLAorCUNNRCggIE1JX1JTX1NUT1JFX0RBVEFfSU1NLCAgICAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIFMgICksCisJQ01EKCAgTUlfTE9BRF9VUkJfTUVNLCAgICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4RkYsICAgUyAgKSwKKwlDTUQoICBNSV9TVE9SRV9VUkJfTUVNLCAgICAgICAgICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBTICApLAorCUNNRCggIEdGWF9PUF8zRFNUQVRFX0RYOV9DT05TVEFOVEZfVlMsICBTM0QsICAgIUYsICAweDdGRiwgIFMgICksCisJQ01EKCAgR0ZYX09QXzNEU1RBVEVfRFg5X0NPTlNUQU5URl9QUywgIFMzRCwgICAhRiwgIDB4N0ZGLCAgUyAgKSwKKworCUNNRCggIEdGWF9PUF8zRFNUQVRFX0JJTkRJTkdfVEFCTEVfRURJVF9WUywgIFMzRCwgICAhRiwgIDB4MUZGLCAgUyAgKSwKKwlDTUQoICBHRlhfT1BfM0RTVEFURV9CSU5ESU5HX1RBQkxFX0VESVRfR1MsICBTM0QsICAgIUYsICAweDFGRiwgIFMgICksCisJQ01EKCAgR0ZYX09QXzNEU1RBVEVfQklORElOR19UQUJMRV9FRElUX0hTLCAgUzNELCAgICFGLCAgMHgxRkYsICBTICApLAorCUNNRCggIEdGWF9PUF8zRFNUQVRFX0JJTkRJTkdfVEFCTEVfRURJVF9EUywgIFMzRCwgICAhRiwgIDB4MUZGLCAgUyAgKSwKKwlDTUQoICBHRlhfT1BfM0RTVEFURV9CSU5ESU5HX1RBQkxFX0VESVRfUFMsICBTM0QsICAgIUYsICAweDFGRiwgIFMgICksCit9OworCitzdGF0aWMgY29uc3Qgc3RydWN0IGRybV9pOTE1X2NtZF9kZXNjcmlwdG9yIHZpZGVvX2NtZHNbXSA9IHsKKwlDTUQoICBNSV9BUkJfT05fT0ZGLCAgICAgICAgICAgICAgICAgICAgU01JLCAgICBGLCAgMSwgICAgICBSICApLAorCUNNRCggIE1JX1NUT1JFX0RXT1JEX0lNTSwgICAgICAgICAgICAgICBTTUksICAgIUYsICAweEZGLCAgIEIsCisJICAgICAgLmJpdHMgPSB7eworCQkJLm9mZnNldCA9IDAsCisJCQkubWFzayA9IE1JX0dMT0JBTF9HVFQsCisJCQkuZXhwZWN0ZWQgPSAwLAorCSAgICAgIH19LAkJCQkJCSAgICAgICApLAorCUNNRCggIE1JX1VQREFURV9HVFQsICAgICAgICAgICAgICAgICAgICBTTUksICAgIUYsICAweDNGLCAgIFIgICksCisJQ01EKCAgTUlfRkxVU0hfRFcsICAgICAgICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4M0YsICAgQiwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMCwKKwkJCS5tYXNrID0gTUlfRkxVU0hfRFdfTk9USUZZLAorCQkJLmV4cGVjdGV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SywKKwkgICAgICB9fSwJCQkJCQkgICAgICAgKSwKKwlDTUQoICBNSV9DT05ESVRJT05BTF9CQVRDSF9CVUZGRVJfRU5ELCAgU01JLCAgICFGLCAgMHhGRiwgICBCLAorCSAgICAgIC5iaXRzID0ge3sKKwkJCS5vZmZzZXQgPSAwLAorCQkJLm1hc2sgPSBNSV9HTE9CQUxfR1RULAorCQkJLmV4cGVjdGVkID0gMCwKKwkgICAgICB9fSwJCQkJCQkgICAgICAgKSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZHJtX2k5MTVfY21kX2Rlc2NyaXB0b3IgYmx0X2NtZHNbXSA9IHsKKwlDTUQoICBNSV9ESVNQTEFZX0ZMSVAsICAgICAgICAgICAgICAgICAgU01JLCAgICFGLCAgMHhGRiwgICBSICApLAorCUNNRCggIE1JX1NUT1JFX0RXT1JEX0lNTSwgICAgICAgICAgICAgICBTTUksICAgIUYsICAweDNGRiwgIEIsCisJICAgICAgLmJpdHMgPSB7eworCQkJLm9mZnNldCA9IDAsCisJCQkubWFzayA9IE1JX0dMT0JBTF9HVFQsCisJCQkuZXhwZWN0ZWQgPSAwLAorCSAgICAgIH19LAkJCQkJCSAgICAgICApLAorCUNNRCggIE1JX1VQREFURV9HVFQsICAgICAgICAgICAgICAgICAgICBTTUksICAgIUYsICAweDNGLCAgIFIgICksCisJQ01EKCAgTUlfRkxVU0hfRFcsICAgICAgICAgICAgICAgICAgICAgIFNNSSwgICAhRiwgIDB4M0YsICAgQiwKKwkgICAgICAuYml0cyA9IHt7CisJCQkub2Zmc2V0ID0gMCwKKwkJCS5tYXNrID0gTUlfRkxVU0hfRFdfTk9USUZZLAorCQkJLmV4cGVjdGVkID0gMCwKKwkgICAgICB9LAorCSAgICAgIHsKKwkJCS5vZmZzZXQgPSAxLAorCQkJLm1hc2sgPSBNSV9GTFVTSF9EV19VU0VfR1RULAorCQkJLmV4cGVjdGVkID0gMCwKKwkJCS5jb25kaXRpb25fb2Zmc2V0ID0gMC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H0KIAorLyoqCisgICogYmR3X3VwZGF0ZV9wbV9pcnEgLSB1cGRhdGUgR1QgaW50ZXJydXB0IDIKKyAgKiBAZGV2X3ByaXY6IGRyaXZlciBwcml2YXRlCisgICogQGludGVycnVwdF9tYXNrOiBtYXNrIG9mIGludGVycnVwdCBiaXRzIHRvIHVwZGF0ZQorICAqIEBlbmFibGVkX2lycV9tYXNrOiBtYXNrIG9mIGludGVycnVwdCBiaXRzIHRvIGVuYWJsZQorICAqCisgICogQ29waWVkIGZyb20gdGhlIHNuYiBmdW5jdGlvbiwgdXBkYXRlZCB3aXRoIHJlbGV2YW50IHJlZ2lzdGVyIG9mZnNldHMKKyAgKi8KK3N0YXRpYyB2b2lkIGJkd191cGRhdGVfcG1faXJxKHN0cnVjdCBkcm1faTkxNV9wcml2YXRlICpkZXZfcHJpdiwKKwkJCSAgICAgIHVpbnQzMl90IGludGVycnVwdF9tYXNrLAorCQkJICAgICAgdWludDMyX3QgZW5hYmxlZF9pcnFfbWFzaykKK3sKKwl1aW50MzJfdCBuZXdfdmFsOworCisJYXNzZXJ0X3NwaW5fbG9ja2VkKCZkZXZfcHJpdi0+aXJxX2xvY2spOworCisJaWYgKFdBUk5fT04oZGV2X3ByaXYtPnBtLmlycXNfZGlzYWJsZWQpKQorCQlyZXR1cm47CisKKwluZXdfdmFsID0gZGV2X3ByaXYtPnBtX2lycV9tYXNrOworCW5ld192YWwgJj0gfmludGVycnVwdF9tYXNrOworCW5ld192YWwgfD0gKH5lbmFibGVkX2lycV9tYXNrICYgaW50ZXJydXB0X21hc2spOworCisJaWYgKG5ld192YWwgIT0gZGV2X3ByaXYtPnBtX2lycV9tYXNrKSB7CisJCWRldl9wcml2LT5wbV9pcnFfbWFzayA9IG5ld192YWw7CisJCUk5MTVfV1JJVEUoR0VOOF9HVF9JTVIoMiksIGRldl9wcml2LT5wbV9pcnFfbWFzayk7CisJCVBPU1RJTkdfUkVBRChHRU44X0dUX0lNUigyKSk7CisJfQorfQorCit2b2lk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kZW8gc2lnbmFsIGluIGFuZAorICogYXJvdW5kIHRoZSB2ZXJ0aWNhbCBibGFua2luZyBwZXJpb2QuCisgKgorICogQXNzdW1wdGlvbnMgYWJvdXQgdGhlIGZpY3RpdGlvdXMgbW9kZSB1c2VkIGluIHRoaXMgZXhhbXBsZToKKyAqICB2Ymxhbmtfc3RhcnQgPj0gMworICogIHZzeW5jX3N0YXJ0ID0gdmJsYW5rX3N0YXJ0ICsgMQorICogIHZzeW5jX2VuZCA9IHZibGFua19zdGFydCArIDIKKyAqICB2dG90YWwgPSB2Ymxhbmtfc3RhcnQgKyAzCisgKgorICogICAgICAgICAgIHN0YXJ0IG9mIHZibGFuazoKKyAqICAgICAgICAgICBsYXRjaCBkb3VibGUgYnVmZmVyZWQgcmVnaXN0ZXJzCisgKiAgICAgICAgICAgaW5jcmVtZW50IGZyYW1lIGNvdW50ZXIgKGN0ZyspCisgKiAgICAgICAgICAgZ2VuZXJhdGUgc3RhcnQgb2YgdmJsYW5rIGludGVycnVwdCAoZ2VuNCspCisgKiAgICAgICAgICAgfAorICogICAgICAgICAgIHwgICAgICAgICAgZnJhbWUgc3RhcnQ6CisgKiAgICAgICAgICAgfCAgICAgICAgICBnZW5lcmF0ZSBmcmFtZSBzdGFydCBpbnRlcnJ1cHQgKGFrYS4gdmJsYW5rIGludGVycnVwdCkgKGdtY2gpCisgKiAgICAgICAgICAgfCAgICAgICAgICBtYXkgYmUgc2hpZnRlZCBmb3J3YXJkIDEtMyBleHRyYSBsaW5lcyB2aWEgUElQRUNPTkYKKyAqICAgICAgICAgICB8ICAgICAgICAgIHwKKyAqICAgICAgICAgICB8ICAgICAgICAgIHwgIHN0YXJ0IG9mIHZzeW5jOgorICogICAgICAgICAgIHwgICAgICAgICAgfCAgZ2VuZXJhdGUgdnN5bmMgaW50ZXJydXB0CisgKiAgICAgICAgICAgfCAgICAgICAgICB8ICB8CisgKiBfX194eHh4X19fICAgIF9fX3h4eHhfX18gICAgX19feHh4eF9fXyAgICBfX194eHh4X19fICAgIF9fX3h4eHhfX18gICAgX19feHh4eAorICogICAgICAgLiAgIFxocy8gICAuICAgICAgXGhzLyAgICAgICAgICBcaHMvICAgICAgICAgIFxocy8gICAuICAgICAgXGhzLworICogLS0tLXZhLS0tPiA8LS0tLS0tLS0tLS0tLS0tLS12Yi0tLS0tLS0tLS0tLS0tLS0tLS0tPiA8LS0tLS0tLS12YS0tLS0tLS0tLS0tLS0KKyAqICAgICAgIHwgICAgICAgICAgfCAgICAgICA8LS0tLXZzLS0tLS0+ICAgICAgICAgICAgICAgICAgICAgfAorICogLXZicy0tLS0tPiA8LS0tdmJzKzEtLS0+IDwtLS12YnMrMi0tLT4gPC0tLS0tMC0tLS0tPiA8LS0tLS0xLS0tLS0+IDwtLS0tLTItLS0gKHNjYW5saW5lIGNvdW50ZXIgZ2VuMikKKyAqIC12YnMtMi0tLT4gPC0tLXZicy0xLS0tPiA8LS0tdmJzLS0tLS0+IDwtLS12YnMrMS0tLT4gPC0tLXZicysyLS0tPiA8LS0tLS0wLS0tIChzY2FubGluZSBjb3VudGVyIGdlbjMrKQorICogLXZicy0yLS0tPiA8LS0tdmJzLTItLS0+IDwtLS12YnMtMS0tLT4gPC0tLXZicy0tLS0tPiA8LS0tdmJzKzEtLS0+IDwtLS12YnMrMi0gKHNjYW5saW5lIGNvdW50ZXIgaHN3KyBoZG1pKQorICogICAgICAgfCAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8CisgKiAgICAgICBsYXN0IHZpc2libGUgcGl4ZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0IHZpc2libGUgcGl4ZWwKKyAqICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5jcmVtZW50IGZyYW1lIGNvdW50ZXIgKGdlbjMvNCkKKyAqICAgICAgICAgICAgICAgICAgcGl4ZWwgY291bnRlciA9IHZibGFua19zd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OworCisJLyogY2xrIHplcm8gY291bnQgKi8KKwljbGtfemVyb19jbnQgPSBESVZfUk9VTkRfVVAoCisJCQkodGNsa19wcmVwYXJlX2Nsa3plcm8gLQl0aHNfcHJlcGFyZV9ucykKKwkJCSogdWlfZGVuLCAyICogdWlfbnVtKTsKKworCS8qIHRyYWlsIGNvdW50ICovCisJdGNsa190cmFpbF9ucyA9IG1heChtaXBpX2NvbmZpZy0+dGNsa190cmFpbCwgbWlwaV9jb25maWctPnRoc190cmFpbCk7CisJdHJhaWxfY250ID0gRElWX1JPVU5EX1VQKHRjbGtfdHJhaWxfbnMgKiB1aV9kZW4sIDIgKiB1aV9udW0pOworCisJaWYgKHByZXBhcmVfY250ID4gUFJFUEFSRV9DTlRfTUFYIHx8CisJCWV4aXRfemVyb19jbnQgPiBFWElUX1pFUk9fQ05UX01BWCB8fAorCQljbGtfemVyb19jbnQgPiBDTEtfWkVST19DTlRfTUFYIHx8CisJCXRyYWlsX2NudCA+IFRSQUlMX0NOVF9NQVgpCisJCURSTV9ERUJVR19EUklWRVIoIlZhbHVlcyBjcm9zc2luZyBtYXhpbXVtIGxpbWl0cywgcmVzdHJpY3RpbmcgdG8gbWF4IHZhbHVlc1xuIik7CisKKwlpZiAocHJlcGFyZV9jbnQgPiBQUkVQQVJFX0NOVF9NQVgpCisJCXByZXBhcmVfY250ID0gUFJFUEFSRV9DTlRfTUFYOworCisJaWYgKGV4aXRfemVyb19jbnQgPiBFWElUX1pFUk9fQ05UX01BWCkKKwkJZXhpdF96ZXJvX2NudCA9IEVYSVRfWkVST19DTlRfTUFYOworCisJaWYgKGNsa196ZXJvX2NudCA+IENMS19aRVJPX0NOVF9NQVgpCisJCWNsa196ZXJvX2NudCA9IENMS19aRVJPX0NOVF9NQVg7CisKKwlpZiAodHJhaWxfY250ID4gVFJBSUxfQ05UX01BWCkKKwkJdHJhaWxfY250ID0gVFJBSUxfQ05UX01BWDsKKworCS8qIEIwODAgKi8KKwlpbnRlbF9kc2ktPmRw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F9kc2ktPmhzX3RvX2xwX2NvdW50ICs9IGV4dHJhX2J5dGVfY291bnQ7CisKKwkvKiBCMDg4ICovCisJLyogTFAgLT4gSFMgZm9yIGNsb2NrIGxhbmVzCisJICogTFAgY2xrIHN5bmMgKyBMUDExICsgTFAwMSArIHRjbGtfcHJlcGFyZSArIHRjbGtfemVybyArCisJICoJCQkJCQlleHRyYSBieXRlIGNvdW50CisJICogMlRQTFggKyAxVExQWCArIDEgVFBMWChpbiBucykgKyBwcmVwYXJlX2NudCAqIDIgKyBjbGtfemVyb19jbnQgKgorCSAqCQkJCQkyKGluIFVJKSArIGV4dHJhIGJ5dGUgY291bnQKKwkgKiBJbiBieXRlY2xrcyA9ICg0VExQWCArIHByZXBhcmVfY250ICogMiArIGNsa196ZXJvX2NudCAqMiAoaW4gVUkpKSAvCisJICoJCQkJCTggKyBleHRyYSBieXRlIGNvdW50CisJICovCisJaW50ZWxfZHNpLT5jbGtfbHBfdG9faHNfY291bnQgPQorCQlESVZfUk9VTkRfVVAoCisJCQk0ICogdGxweF91aSArIHByZXBhcmVfY250ICogMiArCisJCQljbGtfemVyb19jbnQgKiAyLAorCQkJOCk7CisKKwlpbnRlbF9kc2ktPmNsa19scF90b19oc19jb3VudCArPSBleHRyYV9ieXRlX2NvdW50OworCisJLyogSFMtPkxQIGZvciBDbG9jayBMYW5lcworCSAqIExvdyBQb3dlciBjbG9jayBzeW5jaHJvbmlzYXRpb25zICsgMVR4IGJ5dGVjbGsgKyB0Y2xrX3RyYWlsICsKKwkgKgkJCQkJCUV4dHJhIGJ5dGUgY291bnQKKwkgKiAyVExQWCArIDhVSSArICh0cmFpbF9jb3VudCoyKShpbiBVSSkgKyBFeHRyYSBieXRlIGNvdW50CisJICogSW4gYnl0ZWNsa3MgPSAoMipUTHB4KGluIFVJKSArIHRyYWlsX2NvdW50KjIgKzgpKGluIFVJKS84ICsKKwkgKgkJCQkJCUV4dHJhIGJ5dGUgY291bnQKKwkgKi8KKwlpbnRlbF9kc2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oZGlzcC0+aHBkLCBzZW5kLCBjb25uLT5pbmRleCk7CisJbm91dmVhdV9ldmVudF9nZXQoY29ubi0+aHBkLmV2ZW50KTsKK30KKworc3RhdGljIGludAorbnZrbV9jb25uZWN0b3JfaHBkKHZvaWQgKmRhdGEsIHUzMiB0eXBlLCBpbnQgaW5kZXgpCit7CisJc3RydWN0IG52a21fY29ubmVjdG9yICpjb25uID0gZGF0YTsKKwlEQkcoIkhQRDogJWRcbiIsIHR5cGUpOworCXNjaGVkdWxlX3dvcmsoJmNvbm4tPmhwZC53b3JrKTsKKwlyZXR1cm4gTlZLTV9FVkVOVF9EUk9QOworfQorCitpbnQKK19udmttX2Nvbm5lY3Rvcl9maW5pKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqb2JqZWN0LCBib29sIHN1c3BlbmQpCit7CisJc3RydWN0IG52a21fY29ubmVjdG9yICpjb25uID0gKHZvaWQgKilvYmplY3Q7CisJaWYgKGNvbm4tPmhwZC5ldmVudCkKKwkJbm91dmVhdV9ldmVudF9wdXQoY29ubi0+aHBkLmV2ZW50KTsKKwlyZXR1cm4gbm91dmVhdV9vYmplY3RfZmluaSgmY29ubi0+YmFzZSwgc3VzcGVuZCk7Cit9CisKK2ludAorX252a21fY29ubmVjdG9yX2luaXQoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICpvYmplY3QpCit7CisJc3RydWN0IG52a21fY29ubmVjdG9yICpjb25uID0gKHZvaWQgKilvYmplY3Q7CisJaW50IHJldCA9IG5vdXZlYXVfb2JqZWN0X2luaXQoJmNvbm4tPmJhc2UpOworCWlmIChyZXQgPT0gMCkgeworCQlpZiAoY29ubi0+aHBkLmV2ZW50KQorCQkJbm91dmVhdV9ldmVudF9nZXQoY29ubi0+aHBkLmV2ZW50KTsKKwl9CisJcmV0dXJuIHJldDsKK30KKwordm9pZAorX252a21fY29ubmVjdG9yX2R0b3Ioc3RydWN0IG5vdXZlYXVfb2JqZWN0ICpvYmplY3QpCit7CisJc3RydWN0IG52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N0IG52a21fY29ubmVjdG9yICpkaXNwID0gKGQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX252a21fY29ubmVjdG9yX2R0b3IobnZfb2JqZWN0KGRpc3ApKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBudmttX2Nvbm5lY3Rvcl9pbml0KGQpICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3QgbnZrbV9jb25uZWN0b3IgKmRpc3AgPSAoZCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbnZrbV9jb25uZWN0b3JfaW5pdChudl9vYmplY3QoZGlzcCkpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisjZGVmaW5lIG52a21fY29ubmVjdG9yX2ZpbmkoZCxzKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX2Nvbm5lY3RvciAqZGlzcCA9IChkKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9udmttX2Nvbm5lY3Rvcl9maW5pKG52X29iamVjdChkaXNwKSwgKHMpKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKworaW50IG52a21fY29ubmVjdG9yX2NyZWF0ZV8oc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkJICAgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosIHN0cnVjdCBudmJpb3NfY29ubkUgKiwKKwkJCSAgIGludCwgaW50LCB2b2lkICoqKTsKKworaW50ICBfbnZrbV9jb25uZWN0b3JfY3RvcihzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwgc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosCisJCQkgIHN0cnVjdCBub3V2ZWF1X29jbGFzcyAqLCB2b2lkICosIHUzMiwKKwkJCSAgc3RydWN0IG5vdXZlYXVfb2JqZWN0ICoqKTsKK3ZvaWQgX252a21fY29ubmVjdG9yX2R0b3Ioc3RydWN0IG5vdXZlYXVfb2JqZWN0ICopOworaW50ICBfbnZrbV9jb25uZWN0b3JfaW5pdChzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKik7CitpbnQgIF9udmttX2Nvbm5lY3Rvcl9maW5pKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBib29sKTsKKworc3RydWN0IG52a21fY29ubmVjdG9yX2ltcGwgeworCXN0cnVjdCBub3V2ZWF1X29jbGFzcyBiYXNlOworfTsKKworI2lmbmRlZiBNU0cKKyNkZWZpbmUgTVNHKGwsZixhLi4uKSBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG52a21fY29ubmVjdG9yICpfY29ubiA9ICh2b2lkICopY29ubjsgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJbnZfIyNsKG52X29iamVjdChjb25uKS0+ZW5naW5lLCAiJTAyeDolMDJ4JTAyeDogImYsIF9jb25uLT5pbmRleCwgICAgICBcCisJICAgICAgIF9jb25uLT5pbmZvLmxvY2F0aW9uLCBfY29ubi0+aW5mby50eXBlLCAjI2EpOyAgICAgICAgICAgICAgICAgICBcCit9IHdoaWxlKDApCisjZGVmaW5lIERCRyhmLGEuLi4pIE1TRyhkZWJ1ZywgZiwgIyNhKQorI2RlZmluZSBFUlIoZixhLi4uKSBNU0coZXJyb3IsIGYsICMjYSkKKyNlbmRpZgorCisjZW5kaWYKZGlmZiAtLWdpdCBhL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvZW5naW5lL2Rpc3AvZHBvcnQuYyBiL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvZW5naW5lL2Rpc3AvZHBvcnQuYwppbmRleCAzY2EyZDI1Li4z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luaW5nIGNvbXBsZXRlXG4iKTsKKwlhdG9taWNfc2V0KCZvdXRwLT5sdC5kb25lLCAxKTsKKwl3YWtlX3VwKCZvdXRwLT5sdC53YWl0KTsKKwlub3V2ZWF1X2V2ZW50X2dldChvdXRwLT5pcnEpOwogfQpkaWZmIC0tZ2l0IGEvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9lbmdpbmUvZGlzcC9kcG9ydC5oIGIvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9lbmdpbmUvZGlzcC9kcG9ydC5oCmluZGV4IDBlMWJiZDEuLjU2MjhkMmQgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvZW5naW5lL2Rpc3AvZHBvcnQuaAorKysgYi9kcml2ZXJzL2dwdS9kcm0vbm91dmVhdS9jb3JlL2VuZ2luZS9kaXNwL2Rwb3J0LmgKQEAgLTIsMTkgKzIsMTggQEAKICNkZWZpbmUgX19OVktNX0RJU1BfRFBPUlRfSF9fCiAKIC8qIERQQ0QgUmVjZWl2ZXIgQ2FwYWJpbGl0aWVzICovCi0jZGVmaW5lIERQQ0RfUkMwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwCi0jZGVmaW5lIERQQ0RfUkMwMF9EUENEX1JFViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweGZmCi0jZGVmaW5lIERQQ0RfUkMwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxCi0jZGVmaW5lIERQQ0RfUkMwMV9NQVhfTElOS19SQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweGZmCisjZGVmaW5lIERQQ0RfUkMwMF9EUENEX1JFViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAwCisjZGVmaW5lIERQQ0RfUkMwMV9NQVhfTElOS19SQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAxCiAjZGVmaW5lIERQQ0RfUkMwMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAyCiAjZGVmaW5lIERQQ0RfUkMwMl9FTkhBTkNFRF9GUkFNRV9DQVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwCisjZGVmaW5lIERQQ0RfUkMwMl9UUFMzX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwCiAjZGVmaW5lIERQQ0RfUkMwMl9NQVhfTEFORV9DT1VOVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDFmCiAjZGVmaW5lIERQQ0RfUkMwMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDAzCiAjZGVmaW5lIERQQ0RfUkMwM19NQVhfRE9XTlNQUkVBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAxCisjZGVmaW5lIERQQ0RfUkMwRV9BVVhfUkRfSU5URVJWQUwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMDBlCiAKIC8qIERQQ0QgTGluayBDb25maWd1cmF0aW9uICovCi0jZGVmaW5lIERQQ0RfTEMwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwCi0jZGVmaW5lIERQQ0RfTEMwMF9MSU5LX0JXX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweGZmCisjZGVmaW5lIERQQ0RfTEMwMF9MSU5LX0JXX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAwCiAjZGVmaW5lIERQQ0RfTEMwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDAwMTAxCiAjZGVmaW5lIERQQ0RfTEMwMV9FTkhBTkNFRF9GUkFNRV9FTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDgwCiAjZGVmaW5lIERQQ0RfTEMwMV9MQU5FX0NPVU5UX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDFmCkBAIC0yNSw2ICsyNCwxNiBAQAogI2RlZmluZSBEUENEX0xDMDNfUFJFX0VNUEhBU0lTX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxOAogI2RlZmluZSBEUENEX0xDMDNfTUFYX1NXSU5HX1JFQUNIRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNAogI2RlZmluZSBEUENEX0xDMDNfVk9MVEFHRV9TV0lOR19TRVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMworI2RlZmluZSBEUENEX0xDMEYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDEwZgorI2RlZmluZSBEUENEX0xDMEZfTEFORTFfTUFYX1BPU1RfQ1VSU09SMl9SRUFDSEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MAorI2RlZmluZSBEUENEX0xDMEZfTEFORTFfUE9TVF9DVVJTT1IyX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMAorI2RlZmluZSBEUENEX0xDMEZfTEFORTBfTUFYX1BPU1RfQ1VSU09SMl9SRUFDSEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBEUENEX0xDMEZfTEFORTBfUE9TVF9DVVJTT1IyX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMworI2RlZmluZSBEUENEX0xDMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDExMAorI2RlZmluZSBEUENEX0xDMTBfTEFORTNfTUFYX1BPU1RfQ1VSU09SMl9SRUFDSEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg0MAorI2RlZmluZSBEUENEX0xDMTBfTEFORTNfUE9TVF9DVVJTT1IyX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMAorI2RlZmluZSBEUENEX0xDMTBfTEFORTJfTUFYX1BPU1RfQ1VSU09SMl9SRUFDSEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwNAorI2RlZmluZSBEUENEX0xDMTBfTEFORTJfUE9TVF9DVVJTT1IyX1NFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMwogCiAvKiBEUENEIExpbmsvU2luayBTdGF0dXMgKi8KICNkZWZpbmUgRFBDRF9MUzAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MDAyMDIKQEAgLTU1LDI0ICs2NCwxMiBAQAogI2RlZmluZSBEUENEX0xTMDdfTEFORTNfVk9MVEFHRV9TV0lORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMAogI2RlZmluZSBEUENEX0xTMDdfTEFORTJfUFJFX0VNUEhBU0lTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwYwogI2RlZmluZSBEUENEX0xTMDdfTEFORTJfVk9MVEFHRV9TV0lORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMworI2RlZmluZSBEUENEX0xTMEMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDIwYworI2RlZmluZSBEU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oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmJjNzZmYmYKLS0tIC9kZXYvbnVsbAorKysgYi9kcml2ZXJzL2dwdS9kcm0vbm91dmVhdS9jb3JlL2VuZ2luZS9kaXNwL291dHAuaApAQCAtMCwwICsxLDU5IEBACisjaWZuZGVmIF9fTlZLTV9ESVNQX09VVFBfSF9fCisjZGVmaW5lIF9fTlZLTV9ESVNQX09VVFBfSF9fCisKKyNpbmNsdWRlICJwcml2LmgiCisKK3N0cnVjdCBudmttX291dHB1dCB7CisJc3RydWN0IG5vdXZlYXVfb2JqZWN0IGJhc2U7CisJc3RydWN0IGxpc3RfaGVhZCBoZWFkOworCisJc3RydWN0IGRjYl9vdXRwdXQgaW5mbzsKKwlpbnQgaW5kZXg7CisKKwlzdHJ1Y3Qgbm91dmVhdV9pMmNfcG9ydCAqcG9ydDsKKwlzdHJ1Y3Qgbm91dmVhdV9pMmNfcG9ydCAqZWRpZDsKKworCXN0cnVjdCBudmttX2Nvbm5lY3RvciAqY29ubjsKK307CisKKyNkZWZpbmUgbnZrbV9vdXRwdXRfY3JlYXRlKHAsZSxjLGIsaSxkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJbnZrbV9vdXRwdXRfY3JlYXRlXygocCksIChlKSwgKGMpLCAoYiksIChpKSwgc2l6ZW9mKCoqZCksICh2b2lkICoqKWQpCisjZGVmaW5lIG52a21fb3V0cHV0X2Rlc3Ryb3koZCkgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX291dHB1dCAqX291dHAgPSAoZCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9udmttX291dHB1dF9kdG9yKG52X29iamVjdChfb3V0cCkpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKyNkZWZpbmUgbnZrbV9vdXRwdXRfaW5pdChkKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG52a21fb3V0cHV0ICpfb3V0cCA9IChkKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX252a21fb3V0cHV0X2luaXQobnZfb2JqZWN0KF9vdXRwKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBudmttX291dHB1dF9maW5pKGQscykgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3QgbnZrbV9vdXRwdXQgKl9vdXRwID0gKGQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbnZrbV9vdXRwdXRfZmluaShudl9vYmplY3QoX291dHApLCAocykpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisKK2ludCBudmttX291dHB1dF9jcmVhdGVfKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwKKwkJCXN0cnVjdCBub3V2ZWF1X29jbGFzcyAqLCBzdHJ1Y3QgZGNiX291dHB1dCAqLAorCQkJaW50LCBpbnQsIHZvaWQgKiopOworCitpbnQgIF9udmttX291dHB1dF9jdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwKKwkJICAgICAgIHN0cnVjdCBub3V2ZWF1X29jbGFzcyAqLCB2b2lkICosIHUzMiwKKwkJICAgICAgIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKik7Cit2b2lkIF9udmttX291dHB1dF9kdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKK2ludCAgX252a21fb3V0cHV0X2luaXQoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICopOworaW50ICBfbnZrbV9vdXRwdXRfZmluaShzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwgYm9vbCk7CisKK3N0cnVjdCBudmttX291dHB1dF9pbXBsIHsKKwlzdHJ1Y3Qgbm91dmVhdV9vY2xhc3MgYmFzZTsKK307CisKKyNpZm5kZWYgTVNHCisjZGVmaW5lIE1TRyhsLGYsYS4uLikgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX291dHB1dCAqX291dHAgPSAodm9pZCAqKW91dHA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW52XyMjbChudl9vYmplY3Qob3V0cCktPmVuZ2luZSwgIiUwMng6JTA0eDolMDR4OiAiZiwgX291dHAtPmluZGV4LCAgICAgXAorCSAgICAgICBfb3V0cC0+aW5mby5oYXNodCwgX291dHAtPmluZm8uaGFzaG0sICMjYSk7ICAgICAgICAgICAgICAgICAgICAgXAorfSB3aGlsZSgwKQorI2RlZmluZSBEQkcoZixhLi4uKSBNU0coZGVidWcsIGYsICMjYSkKKyNkZWZpbmUgRVJSKGYsYS4uLikgTVNHKGVycm9yLCBmLCAjI2EpCisjZW5kaWYKKworI2VuZGlmCmRpZmYgLS1naXQgYS9kcml2ZXJzL2dwdS9kcm0vbm91dmVhdS9jb3JlL2VuZ2luZS9kaXNwL291dHBkcC5jIGIvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9lbmdpbmUvZGlzcC9vdXRwZHAuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41MmMyOTljCi0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9lbmdpbmUvZGlzcC9vdXRwZHAuYwpAQCAtMCwwICsxLDI3NiBAQAorLyoKKyAqIENvcHlyaWdodCAyMDE0IFJlZCBIYXQgSW5jLgorICoKKyAqIFBlcm1pc3Npb24gaXMgaGVyZWJ5IGdyYW50ZW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Hdvcmtfc3RydWN0IHdvcms7CisJYXRvbWljX3QgcGVuZGluZzsKKwlib29sIHByZXNlbnQ7CisJdTggZHBjZFsxNl07CisKKwlzdHJ1Y3QgeworCQlzdHJ1Y3Qgd29ya19zdHJ1Y3Qgd29yazsKKwkJd2FpdF9xdWV1ZV9oZWFkX3Qgd2FpdDsKKwkJYXRvbWljX3QgZG9uZTsKKwl9IGx0OworfTsKKworI2RlZmluZSBudmttX291dHB1dF9kcF9jcmVhdGUocCxlLGMsYixpLGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwludmttX291dHB1dF9kcF9jcmVhdGVfKChwKSwgKGUpLCAoYyksIChiKSwgKGkpLCBzaXplb2YoKipkKSwgKHZvaWQgKiopZCkKKyNkZWZpbmUgbnZrbV9vdXRwdXRfZHBfZGVzdHJveShkKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG52a21fb3V0cHV0X2RwICpfb3V0cCA9IChkKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX252a21fb3V0cHV0X2RwX2R0b3IobnZfb2JqZWN0KF9vdXRwKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBudmttX291dHB1dF9kcF9pbml0KGQpICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3QgbnZrbV9vdXRwdXRfZHAgKl9vdXRwID0gKGQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbnZrbV9vdXRwdXRfZHBfaW5pdChudl9vYmplY3QoX291dHApKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisjZGVmaW5lIG52a21fb3V0cHV0X2RwX2ZpbmkoZCxzKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX291dHB1dF9kcCAqX291dHAgPSAoZCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9udmttX291dHB1dF9kcF9maW5pKG52X29iamVjdChfb3V0cCksIChzKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKworaW50IG52a21fb3V0cHV0X2RwX2NyZWF0ZV8oc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkJICAgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosIHN0cnVjdCBkY2Jfb3V0cHV0ICosCisJCQkgICBpbnQsIGludCwgdm9pZCAqKik7CisKK2ludCAgX252a21fb3V0cHV0X2RwX2N0b3Ioc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkJICBzdHJ1Y3Qgbm91dmVhdV9vY2xhc3MgKiwgdm9pZCAqLCB1MzIsCisJCQkgIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKik7Cit2b2lkIF9udmttX291dHB1dF9kcF9kdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKK2ludCAgX252a21fb3V0cHV0X2RwX2luaXQoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICopOworaW50ICBfbnZrbV9vdXRwdXRfZHBfZmluaShzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwgYm9vbCk7CisKK3N0cnVjdCBudmttX291dHB1dF9kcF9pbXBsIHsKKwlzdHJ1Y3QgbnZrbV9vdXRwdXRfaW1wbCBiYXNlOworCWludCAoKnBhdHRlcm4pKHN0cnVjdCBudmttX291dHB1dF9kcCAqLCBpbnQpOworCWludCAoKmxua19wd3IpKHN0cnVjdCBudmttX291dHB1dF9kcCAqLCBpbnQgbnIpOworCWludCAoKmxua19jdGwpKHN0cnVjdCBudmttX291dHB1dF9kcCAqLCBpbnQgbnIsIGludCBidywgYm9vbCBlZik7CisJaW50ICgqZHJ2X2N0bCkoc3RydWN0IG52a21fb3V0cHV0X2RwICosIGludCBsbiwgaW50IHZzLCBpbnQgcGUsIGludCBwYyk7Cit9OworCitpbnQgbnZrbV9vdXRwdXRfZHBfdHJhaW4oc3RydWN0IG52a21fb3V0cHV0ICosIHUzMiByYXRlLCBib29sIHdhaXQpOworCisjZW5kaWYKZGlmZiAtLWdpdCBhL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvZW5naW5lL2Rpc3AvcGlvcm52NTAuYyBiL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvZW5naW5lL2Rpc3AvcGlvcm52NTAuYwppbmRleCAyYzhjZTM1Li5mZTBmMjU2IDEwMDY0NAotLS0gYS9kcml2ZXJzL2dwdS9kcm0vbm91dmVhdS9jb3JlL2VuZ2luZS9kaXNwL3Bpb3JudjUwLmMKKysrIGIvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9lbmdpbmUvZGlzcC9waW9ybnY1MC5jCkBAIC0zMyw2OCArMzMsMTA3IEBACiAjaW5jbHVkZSAibnY1MC5oIgogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUTURTCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQKK252NTBfcGlvcl90bWRzX2N0b3Ioc3RydWN0IG5vdXZlYXVfb2JqZWN0ICpwYXJlbnQsCisJCSAgICBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKmVuZ2luZSwKKwkJICAgIHN0cnVjdCBub3V2ZWF1X29jbGFzcyAqb2NsYXNzLCB2b2lkICppbmZvLCB1MzIgaW5kZXgsCisJCSAgICBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKipwb2JqZWN0KQoreworCXN0cnVjdCBub3V2ZWF1X2kyYyAqaTJjID0gbm91dmVhdV9pMmMocGFyZW50KTsKKwlzdHJ1Y3QgbnZrbV9vdXRwdXQgKm91dHA7CisJaW50IHJldDsKKworCXJldCA9IG52a21fb3V0cHV0X2NyZWF0ZShwYXJlbnQsIGVuZ2luZSwgb2NsYXNzLCBpbmZvLCBpbmRleCwgJm91dHApOworCSpwb2JqZWN0ID0gbnZfb2JqZWN0KG91dHApOworCWlmIChyZXQpCisJCXJldHVybiByZXQ7CisKKwlvdXRwLT5lZGlkID0gaTJjLT5maW5kX3R5cGUoaTJjLCBOVl9JMkNfVFlQRV9FWFREREMob3V0cC0+aW5mby5leHRkZXYpKTsKKwlyZXR1cm4gMDsKK30KKworc3RydWN0IG52a21fb3V0cHV0X2ltcGwKK252NTBfcGlvcl90bWRzX2ltcGwgPSB7CisJLmJhc2UuaGFuZGxlID0gRENCX09VVFBVVF9UTURTIHwgMHgwMTAwLAorCS5iYXNlLm9mdW5jcyA9ICYoc3RydWN0IG5vdXZlYXVfb2Z1bmNzKSB7CisJCS5jdG9yID0gbnY1MF9waW9yX3RtZHNfY3RvciwKKwkJLmR0b3IgPSBfbnZrbV9vdXRwdXRfZHRvciwKKwkJLmluaXQgPSBfbnZrbV9vdXRwdXRfaW5pdCwKKwkJLmZpbmkgPSBfbnZrbV9vdXRwdXRfZmluaSwKKwl9LAorfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogRGlzcGxheVBvcnQKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBzdHJ1Y3Qgbm91dmVhdV9pMmNfcG9ydCAqCi1udjUwX3Bpb3JfZHBfZmluZChzdHJ1Y3Qgbm91dmVhdV9kaXNwICpkaXNwLCBzdHJ1Y3QgZGN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cm4gcmV0OworCisJb3V0cC0+YmFzZS5lZGlkID0gaTJjLT5maW5kX3R5cGUoaTJjLCBOVl9JMkNfVFlQRV9FWFRBVVgoCisJCQkJCSBvdXRwLT5iYXNlLmluZm8uZXh0ZGV2KSk7CisJcmV0dXJuIDA7Cit9CisKK3N0cnVjdCBudmttX291dHB1dF9kcF9pbXBsCitudjUwX3Bpb3JfZHBfaW1wbCA9IHsKKwkuYmFzZS5iYXNlLmhhbmRsZSA9IERDQl9PVVRQVVRfRFAgfCAweDAwMTAsCisJLmJhc2UuYmFzZS5vZnVuY3MgPSAmKHN0cnVjdCBub3V2ZWF1X29mdW5jcykgeworCQkuY3RvciA9IG52NTBfcGlvcl9kcF9jdG9yLAorCQkuZHRvciA9IF9udmttX291dHB1dF9kcF9kdG9yLAorCQkuaW5pdCA9IF9udmttX291dHB1dF9kcF9pbml0LAorCQkuZmluaSA9IF9udmttX291dHB1dF9kcF9maW5pLAorCX0sCiAJLnBhdHRlcm4gPSBudjUwX3Bpb3JfZHBfcGF0dGVybiwKKwkubG5rX3B3ciA9IG52NTBfcGlvcl9kcF9sbmtfcHdyLAogCS5sbmtfY3RsID0gbnY1MF9waW9yX2RwX2xua19jdGwsCiAJLmRydl9jdGwgPSBudjUwX3Bpb3JfZHBfZHJ2X2N0bCwKIH07CkBAIC0xMDIsNiArMTQxLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqIEdlbmVyYWwgUElPUiBoYW5kbGluZwogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiBpbnQKIG52NTBfcGlvcl9wb3dlcihzdHJ1Y3QgbnY1MF9kaXNwX3ByaXYgKnByaXYsIGludCBvciwgdTMyIGRhdGEpCiB7CmRpZmYgLS1naXQgYS9kcml2ZXJzL2dwdS9kcm0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AgICAgICAgICAgICAgXAorCXN0cnVjdCBub3V2ZWF1X2Rpc3AgKmRpc3AgPSAoZCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9ub3V2ZWF1X2Rpc3BfZHRvcihudl9vYmplY3QoZGlzcCkpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKyNkZWZpbmUgbm91dmVhdV9kaXNwX2luaXQoZCkgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG5vdXZlYXVfZGlzcCAqZGlzcCA9IChkKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX25vdXZlYXVfZGlzcF9pbml0KG52X29iamVjdChkaXNwKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBub3V2ZWF1X2Rpc3BfZmluaShkLHMpICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3Qgbm91dmVhdV9kaXNwICpkaXNwID0gKGQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbm91dmVhdV9kaXNwX2ZpbmkobnZfb2JqZWN0KGRpc3ApLCAocykpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisKK2ludCAgbm91dmVhdV9kaXNwX2NyZWF0ZV8oc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkJICBzdHJ1Y3Qgbm91dmVhdV9vY2xhc3MgKiwgaW50IGhlYWRzLAorCQkJICBjb25zdCBjaGFyICosIGNvbnN0IGNoYXIgKiwgaW50LCB2b2lkICoqKTsKK3ZvaWQgX25vdXZlYXVfZGlzcF9kdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKK2ludCAgX25vdXZlYX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pwcml2ID0gKHZvaWQgKiludl9vYmplY3QoY2hhbiktPmVuZ2luZTsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvaW5jbHVkZS9jb3JlL2NsYXNzLmggYi9kcml2ZXJzL2dwdS9kcm0vbm91dmVhdS9jb3JlL2luY2x1ZGUvY29yZS9jbGFzcy5oCmluZGV4IDljMGNkNzMuLmUwYzgxMmIgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvZ3B1L2RybS9ub3V2ZWF1L2NvcmUvaW5jbHVkZS9jb3JlL2NsYXNzLmgKKysrIGIvZHJpdmVycy9ncHUvZHJtL25vdXZlYXUvY29yZS9pbmNsdWRlL2NvcmUvY2xhc3MuaApAQCAtMjk1LDYgKzI5NSwxMCBAQAogI2RlZmluZSBOVjg0X0RJU1BfU09SX0hETUlfUFdSX1JFS0VZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDA3ZgogI2RlZmluZSBOVjUwX0RJU1BfU09SX0xWRFNfU0NSSVBUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAxMzAwMAogI2RlZmluZSBOVjUwX0RJU1BfU09SX0xWRFNfU0NSSVBUX0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwZmZmZgorI2RlZmluZSBOVjk0X0RJU1BfU09SX0RQX1BXUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAxNjAwMAorI2RlZmluZSBOVjk0X0RJU1BfU09SX0RQX1BXUl9TVEFURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMQorI2RlZmluZSBOVjk0X0RJU1BfU09SX0RQX1BXUl9TVEFURV9PRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgwMDAwMDAwMAorI2RlZmluZSBOVjk0X0RJU1BfU09SX0RQX1BXUl9TVEFURV9PTiAgIC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RF9JUlEpCit9OworCiBzdHJ1Y3Qgbm91dmVhdV9kaXNwIHsKIAlzdHJ1Y3Qgbm91dmVhdV9lbmdpbmUgYmFzZTsKKworCXN0cnVjdCBsaXN0X2hlYWQgb3V0cDsKKwlzdHJ1Y3Qgbm91dmVhdV9ldmVudCAqaHBkOworCiAJc3RydWN0IG5vdXZlYXVfZXZlbnQgKnZibGFuazsKIH07CiAKQEAgLTE3LDI1ICsyOCw2IEBACiAJcmV0dXJuICh2b2lkICopbnZfZGV2aWNlKG9iaiktPnN1YmRldltOVkRFVl9FTkdJTkVfRElTUF07CiB9CiAKLSNkZWZpbmUgbm91dmVhdV9kaXNwX2NyZWF0ZShwLGUsYyxoLGkseCxkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0Jbm91dmVhdV9kaXNwX2NyZWF0ZV8oKHApLCAoZSksIChjKSwgKGgpLCAoaSksICh4KSwgICAgICAgICAgICAgICAgICAgICBcCi0JCQkgICAgIHNpemVvZigqKmQpLCAodm9pZCAqKilkKQotI2RlZmluZSBub3V2ZWF1X2Rpc3BfZGVzdHJveShkKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlzdHJ1Y3Qgbm91dmVhdV9kaXNwICpkaXNwID0gKGQpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlfbm91dmVhdV9kaXNwX2R0b3IobnZfb2JqZWN0KGRpc3ApKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLX0pCi0jZGVmaW5lIG5vdXZlYXVfZGlzcF9pbml0KGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCW5vdXZlYXVfZW5naW5lX2luaXQoJihkKS0+YmFzZSkKLSNkZWZpbmUgbm91dmVhdV9kaXNwX2ZpbmkoZCxzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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WF1X2NzdGF0ZSAqKTsKIAlpbnQgICgqcHJvZykoc3RydWN0IG5vdXZlYXVfY2xvY2sgKik7CkBAIC0xMDYsOCArMTA4LDggQEAKIAlpbnQgbWRpdjsKIH07CiAKLSNkZWZpbmUgbm91dmVhdV9jbG9ja19jcmVhdGUocCxlLG8saSxkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0Jbm91dmVhdV9jbG9ja19jcmVhdGVfKChwKSwgKGUpLCAobyksIChpKSwgc2l6ZW9mKCoqZCksICh2b2lkICoqKWQpCisjZGVmaW5lIG5vdXZlYXVfY2xvY2tfY3JlYXRlKHAsZSxvLGkscixkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW5vdXZlYXVfY2xvY2tfY3JlYXRlXygocCksIChlKSwgKG8pLCAoaSksIChyKSwgc2l6ZW9mKCoqZCksICh2b2lkICoqKWQpCiAjZGVmaW5lIG5vdXZlYXVfY2xvY2tfZGVzdHJveShwKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCXN0cnVjdCBub3V2ZWF1X2Nsb2NrICpjbGsgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCV9ub3V2ZWF1X2Nsb2NrX2R0b3IobnZfb2JqZWN0KGNsaykpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMTIxLDcgKzEyMyw3IEBACiAKIGludCAgbm91dmVhdV9jbG9ja19jcmVhdGVfKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwKIAkJCSAgIHN0cnVjdCBub3V2ZWF1X29jbGFzcyAqLAotCQkJICAgc3RydWN0IG5vdXZlYXVfY2xvY2tzICosIGludCwgdm9pZCAqKik7CisJCQkgICBzdHJ1Y3Qgbm91dmVhdV9jbG9ja3MgKiwgYm9vbCwgaW50LC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koc3RydWN0IG5vdXZlYXVfZ3BpbyAqLCBpbnQgaWR4LCB1OCB0YWcsIHU4IGxpbmUsIGludCBzdGF0ZSk7CkBAIC0zMSwyMyArMzIsMTAgQEAKIAlyZXR1cm4gKHZvaWQgKiludl9kZXZpY2Uob2JqKS0+c3ViZGV2W05WREVWX1NVQkRFVl9HUElPXTsKIH0KIAotI2RlZmluZSBub3V2ZWF1X2dwaW9fY3JlYXRlKHAsZSxvLGwsZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlub3V2ZWF1X2dwaW9fY3JlYXRlXygocCksIChlKSwgKG8pLCAobCksIHNpemVvZigqKmQpLCAodm9pZCAqKilkKQotI2RlZmluZSBub3V2ZWF1X2dwaW9fZGVzdHJveShwKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlzdHJ1Y3Qgbm91dmVhdV9ncGlvICpncGlvID0gKHApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlfbm91dmVhdV9ncGlvX2R0b3IobnZfb2JqZWN0KGdwaW8pKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLX0pCi0jZGVmaW5lIG5vdXZlYXVfZ3Bpb19maW5pKHAscykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCW5vdXZlYXVfc3ViZGV2X2ZpbmkoJihwKS0+YmFzZSwgKHMpKQotCi1pbnQgIG5vdXZlYXVfZ3Bpb19jcmVhdGVfKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwKLQkJCSAgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosIGludCwgaW50LCB2b2lkICoqKTsKLXZvaWQgX25vdXZlYXVfZ3Bpb19kdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKLWludCAgbm91dmVhdV9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vcnQgKik7CiAKLQlpbnQgICgqYXV4KShzdHJ1Y3Qgbm91dmVhdV9pMmNfcG9ydCAqLCB1OCwgdTMyLCB1OCAqLCB1OCk7CisJaW50ICAoKmF1eCkoc3RydWN0IG5vdXZlYXVfaTJjX3BvcnQgKiwgYm9vbCwgdTgsIHUzMiwgdTggKiwgdTgpOwogCWludCAgKCpwYXR0ZXJuKShzdHJ1Y3Qgbm91dmVhdV9pMmNfcG9ydCAqLCBpbnQgcGF0dGVybik7CiAJaW50ICAoKmxua19jdGwpKHN0cnVjdCBub3V2ZWF1X2kyY19wb3J0ICosIGludCBuciwgaW50IGJ3LCBib29sIGVuaCk7CiAJaW50ICAoKmRydl9jdGwpKHN0cnVjdCBub3V2ZWF1X2kyY19wb3J0ICosIGludCBsYW5lLCBpbnQgc3csIGludCBwZSk7CiB9OwogCi0jZGVmaW5lIG5vdXZlYXVfaTJjX3BvcnRfY3JlYXRlKHAsZSxvLGksYSxmLGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCW5vdXZlYXVfaTJjX3BvcnRfY3JlYXRlXygocCksIChlKSwgKG8pLCAoaSksIChhKSwgKGYpLCAgICAgICAgICAgICAgICAgXAotCQkJCSBzaXplb2YoKipkKSwgKHZvaWQgKiopZCkKLSNkZWZpbmUgbm91dmVhdV9pMmNfcG9ydF9kZXN0cm95KHApICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0Jc3RydWN0IG5vdXZlYXVfaTJjX3BvcnQgKnBvcnQgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JX25vdXZlYXVfaTJjX3BvcnRfZHRvcihudl9vYmplY3QoaTJjKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi19KQotI2RlZmluZSBub3V2ZWF1X2kyY19wb3J0X2luaXQocCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlub3V2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I2RlZmluZSBub3V2ZWF1X2kyY19kZXN0cm95KHApICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlzdHJ1Y3Qgbm91dmVhdV9pMmMgKmkyYyA9IChwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlfbm91dmVhdV9pMmNfZHRvcihudl9vYmplY3QoaTJjKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLX0pCi0jZGVmaW5lIG5vdXZlYXVfaTJjX2luaXQocCkgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXN0cnVjdCBub3V2ZWF1X2kyYyAqaTJjID0gKHApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCV9ub3V2ZWF1X2kyY19pbml0KG52X29iamVjdChpMmMpKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotfSkKLSNkZWZpbmUgbm91dmVhdV9pMmNfZmluaShwLHMpICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0Jc3RydWN0IG5vdXZlYXVfaTJjICppMmMgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JX25vdXZlYXVfaTJjX2ZpbmkobnZfb2JqZWN0KGkyYyksIChzKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi19KQotCi1pbnQgbm91dmVhdV9pMmNfY3JlYXRlXyhzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwgc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosCi0JCQlzdHJ1Y3Qgbm91dmVhdV9vY2xhc3MgKiwgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosCi0JCQlpbnQsIHZvaWQgKiopOwotdm9pZCBfbm91dmVhdV9pMmNfZHRvcihzdHJ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bpb19pbml0KHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKLWludCAgbnY1MF9ncGlvX2Zpbmkoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIGJvb2wpOwotdm9pZCBudjUwX2dwaW9faW50cihzdHJ1Y3Qgbm91dmVhdV9zdWJkZXYgKik7Ci12b2lkIG52NTBfZ3Bpb19pbnRyX2VuYWJsZShzdHJ1Y3Qgbm91dmVhdV9ldmVudCAqLCBpbnQgbGluZSk7Ci12b2lkIG52NTBfZ3Bpb19pbnRyX2Rpc2FibGUoc3RydWN0IG5vdXZlYXVfZXZlbnQgKiwgaW50IGxpbmUpOworI2RlZmluZSBub3V2ZWF1X2dwaW9fY3JlYXRlKHAsZSxvLGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlub3V2ZWF1X2dwaW9fY3JlYXRlXygocCksIChlKSwgKG8pLCBzaXplb2YoKipkKSwgKHZvaWQgKiopZCkKKyNkZWZpbmUgbm91dmVhdV9ncGlvX2Rlc3Ryb3kocCkgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG5vdXZlYXVfZ3BpbyAqZ3BpbyA9IChwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX25vdXZlYXVfZ3Bpb19kdG9yKG52X29iamVjdChncGlvKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBub3V2ZWF1X2dwaW9faW5pdChwKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3Qgbm91dmVhdV9ncGlvICpncGlvID0gKHApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbm91dmVhdV9ncGlvX2luaXQobnZfb2JqZWN0KGdwaW8pKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAg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3aGlsZSAocGFkLT5wYXJlbnQpCisJCXBhZCA9IHBhZC0+cGFyZW50OworCXJldHVybiAodm9pZCAqKXBhZDsKK30KKworI2RlZmluZSBudmttX2kyY19wYWRfY3JlYXRlKHAsZSxvLGksZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwludmttX2kyY19wYWRfY3JlYXRlXygocCksIChlKSwgKG8pLCAoaSksIHNpemVvZigqKmQpLCAodm9pZCAqKilkKQorI2RlZmluZSBudmttX2kyY19wYWRfZGVzdHJveShwKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlzdHJ1Y3QgbnZrbV9pMmNfcGFkICpfcCA9IChwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlfbnZrbV9pMmNfcGFkX2R0b3IobnZfb2JqZWN0KF9wKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKK30pCisjZGVmaW5lIG52a21faTJjX3BhZF9pbml0KHApICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX2kyY19wYWQgKl9wID0gKHApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9udmttX2kyY19wYWRfaW5pdChudl9vYmplY3QoX3ApKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKyNkZWZpbmUgbnZrbV9pMmNfcGFkX2ZpbmkocCxzKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG52a21faTJjX3BhZCAqX3AgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX252a21faTJjX3BhZF9maW5pKG52X29iamVjdChfcCksIChzKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorCitpbnQgbnZrbV9pMmNfcGFkX2NyZWF0ZV8oc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkJIHN0cnVjdCBub3V2ZWF1X29jbGFzcyAqLCBpbnQgaW5kZXgsIGludCwgdm9pZCAqKik7CisKK2ludCBfbnZrbV9pMmNfcGFkX2N0b3Ioc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLAorCQkgICAgICAgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosIHZvaWQgKiwgdTMyLAorCQkgICAgICAgc3RydWN0IG5vdXZlYXVfb2JqZWN0ICoqKTsKKyNkZWZpbmUgX252a21faTJjX3BhZF9kdG9yIG5vdXZlYXVfb2JqZWN0X2Rlc3Ryb3kKK2ludCBfbnZrbV9pMmNfcGFkX2luaXQoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICopOworaW50IF9udmttX2kyY19wYWRfZmluaShzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwgYm9vbCk7CisKKyNpZm5kZWYgTVNHCisjZGVmaW5lIE1TRyhsLGYsYS4uLikgZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBudmttX2kyY19wYWQgKl9wYWQgPSAodm9pZCAqKXBhZDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW52XyMjbChudl9vYmplY3QoX3BhZCktPmVuZ2luZSwgIlBBRDolYzolMDJ4OiAiZiwgICAgICAgICAgICAgICAgICAgICAgXAorCSAgICAgICBfcGFkLT5pbmRleCA+PSAweDEwMCA/ICdYJyA6ICdTJywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCSAgICAgICBfcGFkLT5pbmRleCA+PSAweDEwMCA/IF9wYWQtPmluZGV4IC0gMHgxMDAgOiBfcGFkLT5pbmRleCwgIyNhKTsgX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ldi9pMmMuaD4KKworZXh0ZXJuIHN0cnVjdCBub3V2ZWF1X29jbGFzcyBudjA0X2kyY19wYWRfb2NsYXNzOworZXh0ZXJuIHN0cnVjdCBub3V2ZWF1X29jbGFzcyBudjk0X2kyY19wYWRfb2NsYXNzOworCisjZGVmaW5lIG5vdXZlYXVfaTJjX3BvcnRfY3JlYXRlKHAsZSxvLGksYSxmLGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW5vdXZlYXVfaTJjX3BvcnRfY3JlYXRlXygocCksIChlKSwgKG8pLCAoaSksIChhKSwgKGYpLCAgICAgICAgICAgICAgICAgXAorCQkJCSBzaXplb2YoKipkKSwgKHZvaWQgKiopZCkKKyNkZWZpbmUgbm91dmVhdV9pMmNfcG9ydF9kZXN0cm95KHApICh7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG5vdXZlYXVfaTJjX3BvcnQgKnBvcnQgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX25vdXZlYXVfaTJjX3BvcnRfZHRvcihudl9vYmplY3QoaTJjKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCit9KQorI2RlZmluZSBub3V2ZWF1X2kyY19wb3J0X2luaXQocCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlub3V2ZWF1X29iamVjdF9pbml0KCYocCktPmJhc2UpCisjZGVmaW5lIG5vdXZlYXVfaTJjX3BvcnRfZmluaShwLHMpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW5vdXZlYXVfb2JqZWN0X2ZpbmkoJihwKS0+YmFzZSwgKHMpKQorCitpbnQgbm91dmVhdV9pMmNfcG9ydF9jcmVhdGVfKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqLCBzdHJ1Y3Qgbm91dmVhdV9vYmplY3QgKiwKKwkJCSAgICAgc3RydWN0IG5vdXZlYXVfb2NsYXNzICosIHU4LAorCQkJICAgICBjb25zdCBzdHJ1Y3QgaTJjX2FsZ29yaXRobSAqLAorCQkJICAgICBjb25zdCBzdHJ1Y3Qgbm91dmVhdV9pMmNfZnVuYyAqLAorCQkJICAgICBpbnQsIHZvaWQgKiopOwordm9pZCBfbm91dmVhdV9pMmNfcG9ydF9kdG9yKHN0cnVjdCBub3V2ZWF1X29iamVjdCAqKTsKKyNkZWZpbmUgX25vdXZlYXVfaTJjX3BvcnRfaW5pdCBub3V2ZWF1X29iamVjdF9pbml0CitpbnQgIF9ub3V2ZWF1X2kyY19wb3J0X2Zpbmkoc3RydWN0IG5vdXZlYXVfb2JqZWN0ICosIGJvb2wpOworCisjZGVmaW5lIG5vdXZlYXVfaTJjX2NyZWF0ZShwLGUsbyxkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCW5vdXZlYXVfaTJjX2NyZWF0ZV8oKHApLCAoZSksIChvKSwgc2l6ZW9mKCoqZCksICh2b2lkICoqKWQpCisjZGVmaW5lIG5vdXZlYXVfaTJjX2Rlc3Ryb3kocCkgKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXN0cnVjdCBub3V2ZWF1X2kyYyAqaTJjID0gKHApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCV9ub3V2ZWF1X2kyY19kdG9yKG52X29iamVjdChpMmMpKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfSkKKyNkZWZpbmUgbm91dmVhdV9pMmNfaW5pdChwKSAoeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJc3RydWN0IG5vdXZlYXVfaTJjICppMmMgPSAocCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJX25vdXZlYXVfaTJjX2luaXQobnZfb2JqZWN0K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EwMjksMTggQEAKICNkZWZpbmUgSERNSTBfQVVESU9fUEFDS0VUX0NPTlRST0wgICAweDc0MDgKICMgICAgICAgZGVmaW5lIEhETUkwX0FVRElPX1NBTVBMRV9TRU5EICAoMSA8PCAwKQogIyAgICAgICBkZWZpbmUgSERNSTBfQVVESU9fREVMQVlfRU4oeCkgICgoKHgpICYgMykgPDwgNCkKKyMgICAgICAgZGVmaW5lIEhETUkwX0FVRElPX0RFTEFZX0VOX01BU0sJKDMgPDwgNCkKICMgICAgICAgZGVmaW5lIEhETUkwX0FVRElPX1NFTkRfTUFYX1BBQ0tFVFMgICgxIDw8IDgpCiAjICAgICAgIGRlZmluZSBIRE1JMF9BVURJT19URVNUX0VOICAgICAgICAgKDEgPDwgMTIpCiAjICAgICAgIGRlZmluZSBIRE1JMF9BVURJT19QQUNLRVRTX1BFUl9MSU5FKHgpICAoKCh4KSAmIDB4MWYpIDw8IDE2KQorIyAgICAgICBkZWZpbmUgSERNSTBfQVVESU9fUEFDS0VUU19QRVJfTElORV9NQVNLCSgweDFmIDw8IDE2KQogIyAgICAgICBkZWZpbmUgSERNSTBfQVVESU9fQ0hBTk5FTF9TV0FQICAgICgxIDw8IDI0KQogIyAgICAgICBkZWZpbmUgSERNSTBfNjA5NThfQ1NfVVBEQVRFICAgICAgICgxIDw8IDI2KQogIyAgICAgICBkZWZpbmUgSERNSTBfQVpfRk9STUFUX1dUUklHX01BU0sgICgxIDw8IDI4KQogIyAgICAgICBkZWZpbmUgSERNSTBfQVpfRk9STUFUX1dUUklHX0FDSyAgICgxIDw8IDI5KQogI2RlZmluZSBIRE1JMF9BVURJT19DUkNfQ09OVFJPTCAgICAgIDB4NzQwYwogIyAgICAgICBkZWZpbmUgSERNSTBfQVVESU9fQ1JDX0VOICAgICgxIDw8IDApCisjZGVmaW5lIERDRTNfSERNSTBfQUNSX1BBQ0tFVF9DT05UUk9MCTB4NzQwYwogI2RlZmluZSBIRE1JMF9WQklfUEFDS0VUX0NPTlRST0wgICA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ICAgICBkZWZpbmUgSERNSTBfR0VORVJJQzFfTElORSh4KSAgKCgoeCkgJiAweDNmKSA8PCAyNCkKKyMgICAgICAgZGVmaW5lIEhETUkwX0dFTkVSSUMxX0xJTkVfTUFTSwkJKDB4M2YgPDwgMjQpCiAjZGVmaW5lIEhETUkwX0dDICAgICAgICAgICAgICAgICAgICAgMHg3NDI4CiAjICAgICAgIGRlZmluZSBIRE1JMF9HQ19BVk1VVEUgICAgICAgKDEgPDwgMCkKICNkZWZpbmUgSERNSTBfQVZJX0lORk8wICAgICAgICAgICAgICAweDc0NTQKQEAgLTExMTksMTYgKzExMjYsMjIgQEAKICNkZWZpbmUgSERNSTBfR0VORVJJQzFfNiAgICAgICAgICAgICAweDc0YTgKICNkZWZpbmUgSERNSTBfQUNSXzMyXzAgICAgICAgICAgICAgICAweDc0YWMKICMgICAgICAgZGVmaW5lIEhETUkwX0FDUl9DVFNfMzIoeCkgICAoKCh4KSAmIDB4ZmZmZmYpIDw8IDEyKQorIyAgICAgICBkZWZpbmUgSERNSTBfQUNSX0NUU18zMl9NQVNLCQkoMHhmZmZmZiA8PCAxMikKICNkZWZpbmUgSERNSTBfQUNSXzMyXzEgICAgICAgICAgICAgICAweDc0YjAKICMgICAgICAgZGVmaW5lIEhETUkwX0FDUl9OXzMyKHgpICAgKCgoeCkgJiAweGZmZmZmKSA8PCAwKQorIyAgICAgICBkZWZpbmUgSERNSTBfQUNSX05fMzJfTUFTSwkJKDB4ZmZmZmYgPDwgMCkKICNkZWZpbmUgSERNSTBfQUNSXzQ0XzAgICAgICAgICAgICAgICAweDc0YjQKICMgICAgICAgZGVmaW5lIEhETUkwX0FDUl9DVFNfNDQoeCkgICAoKCh4KSAmIDB4ZmZmZmYpIDw8IDEyKQorIyAgICAgICBkZWZpbmUgSERNSTBfQUNSX0NUU180NF9NQVNLCQkoMHhmZmZmZiA8PCAxMikKICNkZWZpbmUgSERNSTBfQUNSXzQ0XzEgICAgICAgICAgICAgICAweDc0YjgKICMgIC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bWFwcGluZworICogJmJ1c193aWR0aDogbWVtb3J5IGJ1cy13aWR0aCAoZWc6IHgxNiAyIEJ5dGVzLCB4MzIgNCBCeXRlcykKKyAqLworc3RydWN0IHBjbV9pbnRfZGF0YSB7CisJdm9pZCBfX2lvbWVtICpjdGxfcmVnczsKKwlpbnQgYnVzX3dpZHRoOworfTsKKworc3RhdGljIERFRklORV9NVVRFWChscGRkMl9udm1fbXV0ZXgpOworCisvKgorICogQnVpbGQgYSBtYXBfd29yZCBzdGFydGluZyBmcm9tIGFuIHVfbG9uZworICovCitzdGF0aWMgaW5saW5lIG1hcF93b3JkIGJ1aWxkX21hcF93b3JkKHVfbG9uZyBteXdvcmQpCit7CisJbWFwX3dvcmQgdmFsID0geyB7MH0gfTsKKwl2YWwueFswXSA9IG15d29yZDsKKwlyZXR1cm4gdmFsOworfQorCisvKgorICogQnVpbGQgTW9kZSBSZWdpc3RlciBDb25maWd1cmF0aW9uIERhdGFNYXNrIGJhc2VkIG9uIGRldmljZSBidXMtd2lkdGgKKyAqLworc3RhdGljIGlubGluZSB1X2ludCBidWlsZF9tcl9jZmdtYXNrKHVfaW50IGJ1c193aWR0aCkKK3sKKwl1X2ludCB2YWwgPSBNUl9DRkdNQVNLOworCisJaWYgKGJ1c193aWR0aCA9PSAweDAwMDQpCQkvKiB4MzIgZGV2aWNlICovCisJCXZhbCA9IHZhbCA8PCAxNjsKKworCXJldHVybiB2YWw7Cit9CisKKy8qCisgKiBCdWlsZCBTdGF0dXMgUmVnaXN0ZXIgT0sgRGF0YU1hc2sgYmFzZWQgb24gZGV2aWNlIGJ1cy13aWR0aAorICovCitzdGF0aWMgaW5saW5lIHVfaW50IGJ1aWxkX3NyX29rX2RhdGFtYXNrKHVfaW50IGJ1c193aWR0aCkKK3sKKwl1X2ludCB2YWwgPSBTUl9PS19EQVRBTUFTSzsKKworCWlmIChidXNfd2lkdGggPT0gMHgwMDA0KQkJLyogeDMyIGRldmljZSAqLworCQl2YWwgPSAodmFsIDw8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NlX2NoaXAoc3RydWN0IHNwaV9ub3IgKm5vcikKK3sKKwlpbnQgcmV0OworCisJZGV2X2RiZyhub3ItPmRldiwgIiAlbGxkS2lCXG4iLCAobG9uZyBsb25nKShub3ItPm10ZC0+c2l6ZSA+PiAxMCkpOworCisJLyogV2FpdCB1bnRpbCBmaW5pc2hlZCBwcmV2aW91cyB3cml0ZSBjb21tYW5kLiAqLworCXJldCA9IHdhaXRfdGlsbF9yZWFkeShub3IpOworCWlmIChyZXQpCisJCXJldHVybiByZXQ7CisKKwkvKiBTZW5kIHdyaXRlIGVuYWJsZSwgdGhlbiBlcmFzZSBjb21tYW5kcy4gKi8KKwl3cml0ZV9lbmFibGUobm9yKTsKKworCXJldHVybiBub3ItPndyaXRlX3JlZyhub3IsIFNQSU5PUl9PUF9DSElQX0VSQVNFLCBOVUxMLCAwLCAwKTsKK30KKworc3RhdGljIGludCBzcGlfbm9yX2xvY2tfYW5kX3ByZXAoc3RydWN0IHNwaV9ub3IgKm5vciwgZW51bSBzcGlfbm9yX29wcyBvcHMpCit7CisJaW50IHJldCA9IDA7CisKKwltdXRleF9sb2NrKCZub3ItPmxvY2spOworCisJaWYgKG5vci0+cHJlcGFyZSkgeworCQlyZXQgPSBub3ItPnByZXBhcmUobm9yLCBvcHMpOworCQlpZiAocmV0KSB7CisJCQlkZXZfZXJyKG5vci0+ZGV2LCAiZmFpbGVkIGluIHRoZSBwcmVwYXJhdGlvbi5cbiIpOworCQkJbXV0ZXhfdW5sb2NrKCZub3ItPmxvY2spOworCQkJcmV0dXJuIHJldDsKKwkJfQorCX0KKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgdm9pZCBzcGlfbm9yX3VubG9ja19hbmRfdW5wcmVwKHN0cnVjdCBzcGlfbm9yICpub3IsIGVudW0gc3BpX25vcl9vcHMgb3BzKQoreworCWlmIChub3ItPnVucHJlcGFyZSkKKwkJbm9yLT51bnByZXBhcmUobm9yLCBvcHMpOworCW11dGV4X3VubG9jaygmbm9yL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lZCBpbnQgcV9maWZvX3NpemUgPSAwOworCWVudW0geGdiZV9tdGxfZmlmb19zaXplIHBfZmlmbyA9IFhHTUFDX01UTF9GSUZPX1NJWkVfMjU2OworCisJLyogQ2FsY3VsYXRlIFR4L1J4IGZpZm8gc2hhcmUgcGVyIHF1ZXVlICovCisJc3dpdGNoIChmaWZvX3NpemUpIHsKKwljYXNlIDA6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0IoMTI4KTsKKwkJYnJlYWs7CisJY2FzZSAxOgorCQlxX2ZpZm9fc2l6ZSA9IEZJRk9fU0laRV9CKDI1Nik7CisJCWJyZWFrOworCWNhc2UgMjoKKwkJcV9maWZvX3NpemUgPSBGSUZPX1NJWkVfQig1MTIpOworCQlicmVhazsKKwljYXNlIDM6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0tCKDEpOworCQlicmVhazsKKwljYXNlIDQ6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0tCKDIpOworCQlicmVhazsKKwljYXNlIDU6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0tCKDQpOworCQlicmVhazsKKwljYXNlIDY6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0tCKDgpOworCQlicmVhazsKKwljYXNlIDc6CisJCXFfZmlmb19zaXplID0gRklGT19TSVpFX0tCKDE2KTsKKwkJYnJlYWs7CisJY2FzZSA4OgorCQlxX2ZpZm9fc2l6ZSA9IEZJRk9fU0laRV9LQigzMik7CisJCWJyZWFrOworCWNhc2UgOToKKwkJcV9maWZvX3NpemUgPSBGSUZPX1NJWkVfS0IoNjQpOworCQlicmVhazsKKwljYXNlIDEwOgorCQlxX2ZpZm9fc2l6ZSA9IEZJRk9fU0laRV9LQigxMjgpOworCQlicmVhazsKKwljYXNlIDExOgorCQlxX2ZpZm9fc2l6ZSA9IEZJRk9fU0laRV9LQigyNTYpOworCQlicmVhazsKKwl9CisJcV9maWZvX3NpemUgPSBxX2ZpZm9fc2l6ZSAvIHF1Z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i8KKwlzdHJ1Y3QgbXV0ZXggeHBjc19tdXRleDsKKworCWludCBpcnFfbnVtYmVyOworCisJc3RydWN0IHhnYmVfaHdfaWYgaHdfaWY7CisJc3RydWN0IHhnYmVfZGVzY19pZiBkZXNjX2lmOworCisJLyogUmluZ3MgZm9yIFR4L1J4IG9uIGEgRE1BIGNoYW5uZWwgKi8KKwlzdHJ1Y3QgeGdiZV9jaGFubmVsICpjaGFubmVsOworCXVuc2lnbmVkIGludCBjaGFubmVsX2NvdW50OworCXVuc2lnbmVkIGludCB0eF9yaW5nX2NvdW50OworCXVuc2lnbmVkIGludCB0eF9kZXNjX2NvdW50OworCXVuc2lnbmVkIGludCByeF9yaW5nX2NvdW50OworCXVuc2lnbmVkIGludCByeF9kZXNjX2NvdW50OworCisJLyogVHgvUnggY29tbW9uIHNldHRpbmdzICovCisJdW5zaWduZWQgaW50IHBibHg4OworCisJLyogVHggc2V0dGluZ3MgKi8KKwl1bnNpZ25lZCBpbnQgdHhfc2ZfbW9kZTsKKwl1bnNpZ25lZCBpbnQgdHhfdGhyZXNob2xkOworCXVuc2lnbmVkIGludCB0eF9wYmw7CisJdW5zaWduZWQgaW50IHR4X29zcF9tb2RlOworCisJLyogUnggc2V0dGluZ3MgKi8KKwl1bnNpZ25lZCBpbnQgcnhfc2ZfbW9kZTsKKwl1bnNpZ25lZCBpbnQgcnhfdGhyZXNob2xkOworCXVuc2lnbmVkIGludCByeF9wYmw7CisKKwkvKiBUeCBjb2FsZXNjaW5nIHNldHRpbmdzICovCisJdW5zaWduZWQgaW50IHR4X3VzZWNzOworCXVuc2lnbmVkIGludCB0eF9mcmFtZXM7CisKKwkvKiBSeCBjb2FsZXNjaW5nIHNldHRpbmdzICovCisJdW5zaWduZWQgaW50IHJ4X3Jpd3Q7CisJdW5zaWduZWQgaW50IHJ4X2ZyYW1lczsKKworCS8qIEN1cnJlbnQgTVRVICovCisJdW5zaWduZWQgaW50IHJ4X2J1Zl9zaXplOworCisJLyogRmxvdyBj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zYyArIGk7CisJCWFkZHIgPSBsZTMyX3RvX2NwdShkZXNjLT5idWZmX2FkZHIpOworCQlkbWFfdW5tYXBfc2luZ2xlKHByaXYtPmRldiwgYWRkciwgc2tiLT5sZW4sIERNQV9UT19ERVZJQ0UpOworCQlkZXZfa2ZyZWVfc2tiX2FueShza2IpOworCQlwcml2LT50eF9za2JbaV0gPSBOVUxMOworCX0KK30KKworc3RhdGljIGludCBoaXg1aGQyX25ldF9vcGVuKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCit7CisJc3RydWN0IGhpeDVoZDJfcHJpdiAqcHJpdiA9IG5ldGRldl9wcml2KGRldik7CisJaW50IHJldDsKKworCXJldCA9IGNsa19wcmVwYXJlX2VuYWJsZShwcml2LT5jbGspOworCWlmIChyZXQgPCAwKSB7CisJCW5ldGRldl9lcnIoZGV2LCAiZmFpbGVkIHRvIGVuYWJsZSBjbGsgJWRcbiIsIHJldCk7CisJCXJldHVybiByZXQ7CisJfQorCisJcHJpdi0+cGh5ID0gb2ZfcGh5X2Nvbm5lY3QoZGV2LCBwcml2LT5waHlfbm9kZSwKKwkJCQkgICAmaGl4NWhkMl9hZGp1c3RfbGluaywgMCwgcHJpdi0+cGh5X21vZGUpOworCWlmICghcHJpdi0+cGh5KQorCQlyZXR1cm4gLUVOT0RFVjsKKworCXBoeV9zdGFydChwcml2LT5waHkpOworCWhpeDVoZDJfaHdfaW5pdChwcml2KTsKKwloaXg1aGQyX3J4X3JlZmlsbChwcml2KTsKKworCW5ldGRldl9yZXNldF9xdWV1ZShkZXYpOworCW5ldGlmX3N0YXJ0X3F1ZXVlKGRldik7CisJbmFwaV9lbmFibGUoJnByaXYtPm5hcGkpOworCisJaGl4NWhkMl9wb3J0X2VuYWJsZShwcml2KTsKKwloaXg1aGQyX2lycV9lbmFibGUocHJpdik7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBoaXg1aGQyX25ldF9jbG9zZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV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h3ICpodywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgKnNwZWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCAqYXV0b25lZykKKwkJCQkJICAgICBpeGdiZV9saW5rX3NwZWVkICpzcGVlZCwKKwkJCQkJICAgICBib29sICphdXRvbmVnKQogewogCXMzMiBzdGF0dXMgPSAwOwogCXUzMiBhdXRvYyA9IDA7CkBAIC0zMzcsMTkgKzMzNywyNSBAQAogCWludCBpOwogCWJvb2wgbGlua191cDsKIAotCS8qCi0JICogVmFsaWRhdGUgdGhlIHdhdGVyIG1hcmsgY29uZmlndXJhdGlvbiBmb3IgcGFja2V0IGJ1ZmZlciAwLiAgWmVybwotCSAqIHdhdGVyIG1hcmtzIGluZGljYXRlIHRoYXQgdGhlIHBhY2tldCBidWZmZXIgd2FzIG5vdCBjb25maWd1cmVkCi0JICogYW5kIHRoZSB3YXRlcm1hcmtzIGZvciBwYWNrZXQgYnVmZmVyIDAgc2hvdWxkIGFsd2F5cyBiZSBjb25maWd1cmVkLgotCSAqLwotCWlmICghaHctPmZjLmxvd193YXRlciB8fAotCSAgICAhaHctPmZjLmhpZ2hfd2F0ZXJbMF0gfHwKLQkgICAgIWh3LT5mYy5wYXVzZV90aW1lKSB7Ci0JCWh3X2RiZyhodywgIkludmFsaWQgd2F0ZXIgbWFyayBjb25maWd1cmF0aW9uXG4iKTsKKwkvKiBWYWxpZGF0ZSB0aGUgd2F0ZXIgbWFyayBjb25maWd1cmF0aW9uICovCisJaWYgKCFody0+ZmMucGF1c2VfdGltZSkgewogCQlyZXRfdmFsID0gSVhHQkVfRVJSX0lOVkFMSURfTElOS19TRVRUSU5HUzsKIAkJZ290byBvdXQ7CiAJfQogCisJLyogTG93IHdhdGVyIG1hcmsgb2YgemVybyBjYXVzZXMgWE9GRiBmbG9vZHMgKi8KKwlmb3IgKGkgPSA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bGlua191cF93YWl0X3RvX2NvbXBsZXRlKQorCQkJCSAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgKnNwZWVkLCBib29sICpsaW5rX3VwLAorCQkJCSAgICAgIGJvb2wgbGlua191cF93YWl0X3RvX2NvbXBsZXRlKQogewogCXUzMiBsaW5rc19yZWc7CiAJdTMyIGk7CkBAIC01NjcsNyArNTcyLDcgQEAKIAkJaHctPnBoeS5vcHMucmVhZF9yZWcoaHcsIDB4Qzc5RiwgTURJT19NTURfUE1BUE1ELCAmbGlua19yZWcpOwogCQlody0+cGh5Lm9wcy5yZWFkX3JlZyhodywgMHhDNzlGLCBNRElPX01NRF9QTUFQTUQsICZsaW5rX3JlZyk7CiAJCWh3LT5waHkub3BzLnJlYWRfcmVnKGh3LCAweEMwMEMsIE1ESU9fTU1EX1BNQVBNRCwKLQkJICAgICAgICAgICAgICAgICAgICAgJmFkYXB0X2NvbXBfcmVnKTsKKwkJCQkgICAgICZhZGFwdF9jb21wX3JlZyk7CiAJCWlmIChsaW5rX3VwX3dhaXRfdG9fY29tcGxldGUpIHsKIAkJCWZvciAoaSA9IDA7IGkgPCBJWEdCRV9MSU5LX1VQX1RJTUU7IGkrKykgewogCQkJCWlmICgobGlua19yZWcgJiAxKSAmJgpAQCAtNTc5LDExICs1ODQsMTEgQEAKIAkJCQl9CiAJCQkJbXNsZWVwKDEwMCk7CiAJCQkJaHctPnBoeS5vcHMucmVhZF9yZWcoaHcsIDB4Qzc5RiwKLQkJCQkgICAgICAgICAgICAgICAgICAgICBNRElPX01NRF9QTUFQTUQsCi0JCQkJICAgICAgICAgICAgICAgICAgICAgJmxpbmtfcmVnKTsKKwkJCQkJCSAgICAgTURJT19NTURfUE1BUE1ELAorCQkJCQkJICAgICAmbGlua19yZWcpOwogCQkJCWh3LT5waHkub3BzLnJlYWRfcmVnKGh3LCAweEMwMEMsCi0JCQkJICAgICAgICAgICAgICAgICAgICAgTURJT19NTURfUE1BUE1ELAotCQkJCSAgICAgICAgICA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X2FuYWxvZ19yZWc4KGh3LCBJWEdCRV9BVExBU19QRE5fMTBHLAotCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhbmFsb2dfdmFsKTsKKwkJCQkJICAgICAmYW5hbG9nX3ZhbCk7CiAJCWFuYWxvZ192YWwgJj0gfklYR0JFX0FUTEFTX1BETl9UWF8xMEdfUUxfQUxMOwogCQlody0+bWFjLm9wcy53cml0ZV9hbmFsb2dfcmVnOChodywgSVhHQkVfQVRMQVNfUEROXzEwRywKLQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5hbG9nX3ZhbCk7CisJCQkJCSAgICAgIGFuYWxvZ192YWwpOwogCiAJCWh3LT5tYWMub3BzLnJlYWRfYW5hbG9nX3JlZzgoaHcsIElYR0JFX0FUTEFTX1BETl8xRywKLQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYW5hbG9nX3ZhbCk7CisJCQkJCSAgICAgJmFuYWxvZ192YWwpOwogCQlhbmFsb2dfdmFsICY9IH5JWEdCRV9BVExBU19QRE5fVFhfMUdfUUxfQUxMOwogCQlody0+bWFjLm9wcy53cml0ZV9hbmFsb2dfcmVnOChodywgSVhHQkVfQVRMQVNfUEROXzFHLAotCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmFsb2dfdmFsKTsKKwkJCQkJICAgICAgYW5hbG9nX3ZhbCk7CiAKIAkJaHctPm1hYy5vcHMucmVhZF9hbmFsb2dfcmVnOChodywgSVhHQkVfQVRMQVNfUEROX0FOLAotCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhbmFsb2dfdmFsKTsKKwkJCQkJICAgICAmYW5hbG9nX3ZhbCk7CiAJCWFuYWxvZ192YWwgJj0gfklYR0JFX0FUTEFTX1BETl9UWF9BTl9RTF9BTEw7CiAJCWh3LT5tYWMub3BzLndyaXRlX2FuYWxvZ19yZWc4KGh3LCBJWEdCRV9BVExBU19QRE5fQU4sCi0JCSAgICAgICAgICAgICAgICAgICAgICA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ua184MjU5OShzdHJ1Y3QgaXhnYmVfaHcgKmh3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgc3BlZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhdXRvbmVnX3dhaXRfdG9fY29tcGxldGUpOworCQkJICAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgc3BlZWQsCisJCQkgICAgICAgYm9vbCBhdXRvbmVnX3dhaXRfdG9fY29tcGxldGUpOwogc3RhdGljIHMzMiBpeGdiZV9zZXR1cF9jb3BwZXJfbGlua184MjU5OShzdHJ1Y3QgaXhnYmVfaHcgKmh3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeGdiZV9saW5rX3NwZWVkIHNwZWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGF1dG9uZWdfd2FpdF90b19jb21wbGV0ZSk7CisJCQkJCSBpeGdiZV9saW5rX3NwZWVkIHNwZWVkLAorCQkJCQkgYm9vbCBhdXRvbmVnX3dhaXRfdG9fY29tcGxldGUpOwogc3RhdGljIHMzMiBpeGdiZV92ZXJpZnlfZndfdmVyc2lvbl84MjU5OShzdHJ1Y3QgaXhnYmVfaHcgKmh3KTsKIHN0YXRpYyBzMzIgaXhnYmVfcmVhZF9pMmNfYnl0ZV84MjU5OShzdHJ1Y3QgaXhnYmVfaHcgKmh3LCB1OCBieXRlX29mZnNldCwKIAkJCQkgICAgIHU4IGRldl9hZGRyLCB1OCAqZGF0YSk7CkBAIC05Niw5ICs5Niw5IEBACiAJaWYgKChtYWMtPm9wcy5nZXRfbWVkaWFfdHlwZShodykgPT0gaXhnYmVfbWVkaWFfdHlwZV9maWJlcikgJiYKIAkgICAgIWl4Z2JlX21uZ19lbmFibGVkKGh3KSkgewogCQltYWMtPm9wcy5kaXNhYmxlX3R4X2xhc2VyID0KLQkJICAgICAgICAgICAgICAgICAgICAgICAm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cgKmh3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYXV0b25lZ193YWl0X3RvX2NvbXBsZXRlKQorCQkJICAgICAgIGJvb2wgYXV0b25lZ193YWl0X3RvX2NvbXBsZXRlKQogewogCXUzMiBhdXRvY19yZWc7CiAJdTMyIGxpbmtzX3JlZzsKQEAgLTY3Miw4ICs2NzIsOCBAQAogICogIFNldCB0aGUgbGluayBzcGVlZCBpbiB0aGUgQVVUT0MgcmVnaXN0ZXIgYW5kIHJlc3RhcnRzIGxpbmsuCiAgKiovCiBzdGF0aWMgczMyIGl4Z2JlX3NldHVwX21hY19saW5rX211bHRpc3BlZWRfZmliZXIoc3RydWN0IGl4Z2JlX2h3ICpodywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgc3BlZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGF1dG9uZWdfd2FpdF90b19jb21wbGV0ZSkKKwkJCQkJICBpeGdiZV9saW5rX3NwZWVkIHNwZWVkLAorCQkJCQkgIGJvb2wgYXV0b25lZ193YWl0X3RvX2NvbXBsZXRlKQogewogCXMzMiBzdGF0dXMgPSAwOwogCWl4Z2JlX2xpbmtfc3BlZWQgbGlua19zcGVlZCA9IElYR0JFX0xJTktfU1BFRURfVU5LTk9XTjsKQEAgLTgyMCw4ICs4MjAsOCBAQAogCSAqLwogCWlmIChzcGVlZGNudCA+IDEpCiAJCXN0YXR1cyA9IGl4Z2JlX3NldHVwX21hY19saW5rX211bHRpc3BlZWRfZmliZXIoaHcsCi0JCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGVzdF9saW5rX3NwZWVkLAotCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9uZWdfd2FpdF90b19jb21wbGV0ZSk7CisJCQkJCQkJICAgICAgI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8KKwkJCQkJICAgICogMSBXU1AgLSBXZWlnaHRlZCBTdHJpY3QgUHJpb3JpdHkKKwkJCQkJICAgICovCiAjZGVmaW5lIElYR0JFX1JUVERDU19WTVBBQyAgICAgIDB4MDAwMDAwMDIgLyogMCBSb3VuZCBSb2JpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAxIFdSUiAtIFdlaWdodGVkIFJvdW5kIFJvYmluCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCQkJCSAgICAqIDEgV1JSIC0gV2VpZ2h0ZWQgUm91bmQgUm9iaW4KKwkJCQkJICAgICovCiAjZGVmaW5lIElYR0JFX1JUVERDU19URFJNICAgICAgIDB4MDAwMDAwMTAgLyogVHJhbnNtaXQgUmVjeWNsZSBNb2RlICovCiAjZGVmaW5lIElYR0JFX1JUVERDU19BUkJESVMgICAgIDB4MDAwMDAwNDAgLyogRENCIGFyYml0ZXIgZGlzYWJsZSAqLwogI2RlZmluZSBJWEdCRV9SVFREQ1NfQkRQTSAgICAgICAweDAwNDAwMDAwIC8qIEJ5cGFzcyBEYXRhIFBpcGUgLSBtdXN0IGNsZWFyISAqLwogI2RlZmluZSBJWEdCRV9SVFREQ1NfQlBCRlNNICAgICAweDAwODAwMDAwIC8qIEJ5cGFzcyBQQiBGcmVlIFNwYWNlIC0gbXVzdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBjbGVhciEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCQkJCSAgICAgKiBjbGVhciEKKwkJCQkJICAgICAqLwogI2RlZmluZSBJWEdCRV9SVFREQ1NfU1BFRURfQ0hHICAweDgwMDAwMDAwIC8qIExpbmsgc3BlZWQgY2hhbmdlICovCiAKIC8qIFJlY2VpdmUgVVAyVEMgbWFwcGluZyAqLwpAQCAtNTYsMTEgKzU2LDExIEBACiAjZGVmaW5lIElYR0JFX1JUUlBUNENfTFNQICAgICAgIDB4ODAwMDAwMDAgLyogTFNQIGVuYWJsZSBiaXQgKi8KIAogI2RlZmluZSBJWEdCRV9SRFJYQ1RMX01QQkVOICAgICAweDAwMDAwMDEwIC8qIERNQSBjb25maWcgZm9yIG11bHRpcGxlIHBhY2tldAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJ1ZmZlcnMgZW5hYmxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCQkJCSAgICAqIGJ1ZmZlcnMgZW5hYmxlCisJCQkJCSAgICAqLwogI2RlZmluZSBJWEdCRV9SRFJYQ1RMX01DRU4gICAgICAweDAwMDAwMDQwIC8qIERNQSBjb25maWcgZm9yIG11bHRpcGxlIGNvcmVzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogKFJTUykgZW5hYmxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCQkJCSAgICAqIChSU1MpIGVuYWJsZQorCQkJCQkgICAgKi8KIAogLyogUlRSUENTIEJpdCBNYXNrcyAqLwogI2RlZmluZSBJWEdCRV9SVFJQQ1NfUlJNICAgICAgICAweDAwMDAwMDAyIC8qIFJlY2VpdmUgUmVjeWNsZSBNb2RlIGVuYWJsZSAqLwpAQCAtODEsOCArODEsOCBAQAogCiAvKiBSVFRQQ1MgQml0IE1hc2tzICovCiAjZGVmaW5lIElYR0JFX1JUVFBDU19UUFBBQyAgICAgIDB4MDAwMDAwMjAgLyogMCBSb3VuZCBSb2JpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAxIFNQIC0gU3RyaWN0IFByaW9yaXR5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJCQkJCSAgICAqIDEgU1AgLSBTdHJpY3QgUHJpb3JpdHk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RfcGdfdGNfY2ZnX3R4KHN0cnVjdCBuZXRfZGV2aWNlICpuZXRkZXYsIGludCB0YywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnByaW8sIHU4ICpid2dfaWQsIHU4ICpid19wY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICp1cF9tYXApCisJCQkJCSB1OCAqcHJpbywgdTggKmJ3Z19pZCwgdTggKmJ3X3BjdCwKKwkJCQkJIHU4ICp1cF9tYXApCiB7CiAJc3RydWN0IGl4Z2JlX2FkYXB0ZXIgKmFkYXB0ZXIgPSBuZXRkZXZfcHJpdihuZXRkZXYpOwogCkBAIC0yNTYsNyArMjU2LDcgQEAKIH0KIAogc3RhdGljIHZvaWQgaXhnYmVfZGNibmxfZ2V0X3BnX2J3Z19jZmdfdHgoc3RydWN0IG5ldF9kZXZpY2UgKm5ldGRldiwgaW50IGJ3Z19pZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpid19wY3QpCisJCQkJCSAgdTggKmJ3X3BjdCkKIHsKIAlzdHJ1Y3QgaXhnYmVfYWRhcHRlciAqYWRhcHRlciA9IG5ldGRldl9wcml2KG5ldGRldik7CiAKQEAgLTI2NCw4ICsyNjQsOCBAQAogfQogCiBzdGF0aWMgdm9pZCBpeGdiZV9kY2JubF9nZXRfcGdfdGNfY2ZnX3J4KHN0cnVjdCBuZXRfZGV2aWNlICpuZXRkZXYsIGludCB0YywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKnByaW8sIHU4ICpid2dfaWQsIHU4ICpid19wY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICp1cF9tYXApCisJCQkJCSB1OCAqcHJpbywgdTggKmJ3Z19pZCwgdTggKmJ3X3BjdCwKKwkJCQkJIHU4ICp1cF9tYXApCiB7CiAJc3RydWN0IGl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8KIHMzMiBpeGdiZV93cml0ZV9waHlfcmVnX2dlbmVyaWMoc3RydWN0IGl4Z2JlX2h3ICpodywgdTMyIHJlZ19hZGRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MzIgZGV2aWNlX3R5cGUsIHUxNiBwaHlfZGF0YSkKKwkJCQl1MzIgZGV2aWNlX3R5cGUsIHUxNiBwaHlfZGF0YSkKIHsKIAlzMzIgc3RhdHVzOwogCXUxNiBnc3NyOwpAQCAtNTQ4LDggKzU0OCw4IEBACiAgKiAgQHNwZWVkOiBuZXcgbGluayBzcGVlZAogICoqLwogczMyIGl4Z2JlX3NldHVwX3BoeV9saW5rX3NwZWVkX2dlbmVyaWMoc3RydWN0IGl4Z2JlX2h3ICpodywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4Z2JlX2xpbmtfc3BlZWQgc3BlZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGF1dG9uZWdfd2FpdF90b19jb21wbGV0ZSkKKwkJCQkgICAgICAgaXhnYmVfbGlua19zcGVlZCBzcGVlZCwKKwkJCQkgICAgICAgYm9vbCBhdXRvbmVnX3dhaXRfdG9fY29tcGxldGUpCiB7CiAKIAkvKgpAQCAtNTgyLDggKzU4Miw4IEBACiAgKiBEZXRlcm1pbmVzIHRoZSBsaW5rIGNhcGFiaWxpdGllcyBieSByZWFkaW5nIHRoZSBBVVRPQyByZWdpc3Rlci4KICAqLwogczMyIGl4Z2JlX2dldF9jb3BwZXJfbGlua19jYXBhYmlsaXRpZXNfZ2VuZXJpYyhzdHJ1Y3QgaXhnYmVfaHcgKmh3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeGdiZV9saW5rX3NwZWVkICpzcGVlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCAqYXV0b25lZykKKwkJCQkJICAgICAgIGl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DApCiAJCQkJCWh3LT5waHkuc2ZwX3R5cGUgPQpAQCAtMTA4NywxNSArMTA4NywxNSBAQAogCQkJCWdvdG8gZXJyX3JlYWRfaTJjX2VlcHJvbTsKIAogCQkJc3RhdHVzID0gaHctPnBoeS5vcHMucmVhZF9pMmNfZWVwcm9tKGh3LAotCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYR0JFX1NGRl9WRU5ET1JfT1VJX0JZVEUxLAotCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvdWlfYnl0ZXNbMV0pOworCQkJCQkJICAgIElYR0JFX1NGRl9WRU5ET1JfT1VJX0JZVEUxLAorCQkJCQkJICAgICZvdWlfYnl0ZXNbMV0pOwogCiAJCQlpZiAoc3RhdHVzICE9IDApCiAJCQkJZ290byBlcnJfcmVhZF9pMmNfZWVwcm9tOwogCiAJCQlzdGF0dXMgPSBody0+cGh5Lm9wcy5yZWFkX2kyY19lZXByb20oaHcsCi0JCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfU0ZGX1ZFTkRPUl9PVUlfQllURTIsCi0JCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm91aV9ieXRlc1syXSk7CisJCQkJCQkgICAgSVhHQkVfU0ZGX1ZFTkRPUl9PVUlfQllURTIsCisJCQkJCQkgICAgJm91aV9ieXRlc1syXSk7CiAKIAkJCWlmIChzdGF0dXMgIT0gMCkKIAkJCQlnb3RvIGVycl9yZWFkX2kyY19lZXByb207CkBAIC0xNDAzLDggKzE0MDMsOCBAQAogICogIHNvIGl0IHJldHVybnMgdGhlIG9mZnNldHMgdG8gdGhlIHBoeSBpbml0IHNlcXVlbmNlIGJsb2NrLgogICoqLwogczMyIGl4Z2JlX2dldF9zZnBfaW5pdF9zZXF1ZW5jZV9vZmZzZXRzKHN0cnVjdCBpeGdiZV9odyAqaHcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTE2ICpsaXN0X29mZnNldCwKLS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wMDA4MDAwCiAjZGVmaW5lIElYR0JFX0VJVFJfQ05UX1dESVMgICAgIDB4ODAwMDAwMDAKQEAgLTIxMyw3ICsyMTMsNyBAQAogICogNjQtMTI3OiAweDBEMDE0ICsgKG4tNjQpKjB4NDAKICAqLwogI2RlZmluZSBJWEdCRV9TUlJDVEwoX2kpICgoKF9pKSA8PSAxNSkgPyAoMHgwMjEwMCArICgoX2kpICogNCkpIDogXAotICAgICAgICAgICAgICAgICAgICAgICAgICAoKChfaSkgPCA2NCkgPyAoMHgwMTAxNCArICgoX2kpICogMHg0MCkpIDogXAorCQkJICAoKChfaSkgPCA2NCkgPyAoMHgwMTAxNCArICgoX2kpICogMHg0MCkpIDogXAogCQkJICAoMHgwRDAxNCArICgoKF9pKSAtIDY0KSAqIDB4NDApKSkpCiAvKgogICogUnggRENBIENvbnRyb2wgUmVnaXN0ZXI6CkBAIC0yMjIsMTEgKzIyMiwxMSBAQAogICogNjQtMTI3OiAweDBEMDBDICsgKG4tNjQpKjB4NDAKICAqLwogI2RlZmluZSBJWEdCRV9EQ0FfUlhDVFJMKF9pKSAgICAoKChfaSkgPD0gMTUpID8gKDB4MDIyMDAgKyAoKF9pKSAqIDQpKSA6IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKF9pKSA8IDY0KSA/ICgweDAxMDBDICsgKChfaSkgKiAweDQwKSkgOiBcCisJCQkJICgoKF9pKSA8IDY0KSA/ICgweDAxMDBDICsgKChfaSkgKiAweDQwKSkgOiBcCiAJCQkJICgweDBEMDBDICsgKCgoX2kpIC0gNjQpICogMHg0MCkpKSkKICNkZWZpbmUgSVhHQkVfUkRSWENUTCAgICAgICAgICAgMHgwMkYwMAogI2RlZmluZSBJWEdCRV9SWFBCU0laRShfaSkgICAgICAoMHgwM0MwMCArICgoX2kpICogNCkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA4IG9mIHRoZXNlIDB4MDNDMDAgLSAweDAzQzFDICovCisJCQkJCSAgICAgLyogOCBvZiB0aGVzZSAweDAzQzAwIC0gMHgwM0MxQyAqLwogI2RlZmluZSBJWEdCRV9SWENUUkwgICAgMHgwMzAwMAogI2RlZmluZSBJWEdCRV9EUk9QRU4gICAgMHgwM0QwNAogI2RlZmluZSBJWEdCRV9SWFBCU0laRV9TSElGVCAxMApAQCAtMjM5LDE0ICsyMzksMTQgQEAKIC8qIE11bHRpY2FzdCBUYWJsZSBBcnJheSAtIDEyOCBlbnRyaWVzICovCiAjZGVmaW5lIElYR0JFX01UQShfaSkgICAoMHgwNTIwMCArICgoX2kpICogNCkpCiAjZGVmaW5lIElYR0JFX1JBTChfaSkgICAoKChfaSkgPD0gMTUpID8gKDB4MDU0MDAgKyAoKF9pKSAqIDgpKSA6IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwQTIwMCArICgoX2kpICogOCkpKQorCQkJICgweDBBMjAwICsgKChfaSkgKiA4KSkpCiAjZGVmaW5lIElYR0JFX1JBSChfaSkgICAoKChfaSkgPD0gMTUpID8gKDB4MDU0MDQgKyAoKF9pKSAqIDgpKSA6IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwQTIwNCArICgoX2kpICogOCkpKQorCQkJICgweDBBMjA0ICsgKChfaSkgKiA4KSkpCiAjZGVmaW5lIElYR0JFX01QU0FSX0xPKF9pKSAoMHgwQTYwMCArICgoX2kpICogOCkpCiAjZGVmaW5lIElYR0JFX01QU0FSX0hJKF9pKSAoMHgwQTYwNCArICgoX2kpICogOCkpCiAvKiBQYWNrZXQgc3BsaXQgcmVjZWl2ZSB0eXBlICovCiAjZGVmaW5lIElYR0JFX1BTUlRZUEUoX2kpICAgICgoKF9pKSA8PSAxNSkgPyAoMHgwNTQ4MCArICgoX2kpICogNCkpIDogXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MEVBMDAgKyAoKF9pKSAqIDQpKSkKKwkJCSAgICAgICgweDBFQTAwICsgKChfaSkgKi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4IFRpbWUgU3luYyBDb250cm9sIHJlZ2lzdGVyIC0gUlcgKi8KQEAgLTEzOTYsMTAgKzEzOTYsMTAgQEAKICNkZWZpbmUgSVhHQkVfRUlNQ19PVEhFUiAgICAgICAgSVhHQkVfRUlDUl9PVEhFUiAgICAgLyogSU5UIENhdXNlIEFjdGl2ZSAqLwogCiAjZGVmaW5lIElYR0JFX0VJTVNfRU5BQkxFX01BU0sgKCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYR0JFX0VJTVNfUlRYX1FVRVVFICAgICAgIHwgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWEdCRV9FSU1TX0xTQyAgICAgICAgICAgICB8IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfRUlNU19UQ1BfVElNRVIgICAgICAgfCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYR0JFX0VJTVNfT1RIRVIpCisJCQkJSVhHQkVfRUlNU19SVFhfUVVFVUUgICAgICAgfCBcCisJCQkJSVhHQkVfRUlNU19MU0MgICAgICAgICAgICAgfCBcCisJCQkJSVhHQkVfRUlNU19UQ1BfVElNRVIgICAgICAgfCBcCisJCQkJSVhHQkVfRUlNU19PVEhFUikKIAogLyogSW1tZWRpYXRlIEludGVycnVwdCBSeCAoQS5LLkEuIExvdyBMYXRlbmN5IEludGVycnVwdCkgKi8KICNkZWZpbmUgSVhHQkVfSU1JUl9QT1JUX0lNX0VOICAgICAweDAwMDEwMDAwICAvKiBUQ1AgcG9ydCBlbmFibGUgKi8KQEAgLTIxNjEsMTggKzIxNjEsMTggQEAKIAogLyogTWFza3MgdG8gZGV0ZXJtaW5lIGlmIHBhY2tldHMgc2hvdWxkIGJlIGRyb3BwZWQgZHVlIHRvIGZyYW1lIGVycm9ycyAqLwogI2RlZmluZSBJWEdCRV9SWERfRVJSX0ZSQU1FX0VSUl9NQVNLICggXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWEdCRV9SWERfRVJSX0NFIHwgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWEdCRV9SWERfRVJSX0xFIHwgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWEdCRV9SWERfRVJSX1BFIHwgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWEdCRV9SWERfRVJSX09TRSB8IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfUlhEX0VSUl9VU0UpCisJCQkJICAgICAgSVhHQkVfUlhEX0VSUl9DRSB8IFwKKwkJCQkgICAgICBJWEdCRV9SWERfRVJSX0xFIHwgXAorCQkJCSAgICAgIElYR0JFX1JYRF9FUlJfUEUgfCBcCisJCQkJICAgICAgSVhHQkVfUlhEX0VSUl9PU0UgfCBcCisJCQkJICAgICAgSVhHQkVfUlhEX0VSUl9VU0UpCiAKICNkZWZpbmUgSVhHQkVfUlhEQURWX0VSUl9GUkFNRV9FUlJfTUFTSyAoIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfUlhEQURWX0VSUl9DRSB8IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfUlhEQURWX0VSUl9MRSB8IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfUlhEQURWX0VSUl9QRSB8IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhHQkVfUlhEQURWX0VSUl9PU0UgfCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYR0JFX1JYREFEVl9FUlJfVVNFKQorCQkJCSAgICAgIElYR0JFX1JYREFEVl9FUlJfQ0UgfCBcCisJCQkJICAgICAgSVhHQkVfUlhEQURWX0VSUl9MRSB8IFwKKwkJCQkgICAgICBJWEdCRV9SWERBRFZf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Qgb24gZGVsYXllZCByZWZzCisJICovCisJdHJhbnMtPnN5bmMgPSB0cnVlOworCXJldCA9IGJ0cmZzX3J1bl9kZWxheWVkX3JlZnModHJhbnMsIGFzeW5jLT5yb290LCBhc3luYy0+Y291bnQpOworCWlmIChyZXQpCisJCWFzeW5jLT5lcnJvciA9IHJldDsKKworCXJldCA9IGJ0cmZzX2VuZF90cmFuc2FjdGlvbih0cmFucywgYXN5bmMtPnJvb3QpOworCWlmIChyZXQgJiYgIWFzeW5jLT5lcnJvcikKKwkJYXN5bmMtPmVycm9yID0gcmV0OworZG9uZToKKwlpZiAoYXN5bmMtPnN5bmMpCisJCWNvbXBsZXRlKCZhc3luYy0+d2FpdCk7CisJZWxzZQorCQlrZnJlZShhc3luYyk7Cit9CisKK2ludCBidHJmc19hc3luY19ydW5fZGVsYXllZF9yZWZzKHN0cnVjdCBidHJmc19yb290ICpyb290LAorCQkJCSB1bnNpZ25lZCBsb25nIGNvdW50LCBpbnQgd2FpdCkKK3sKKwlzdHJ1Y3QgYXN5bmNfZGVsYXllZF9yZWZzICphc3luYzsKKwlpbnQgcmV0OworCisJYXN5bmMgPSBrbWFsbG9jKHNpemVvZigqYXN5bmMpLCBHRlBfTk9GUyk7CisJaWYgKCFhc3luYykKKwkJcmV0dXJuIC1FTk9NRU07CisKKwlhc3luYy0+cm9vdCA9IHJvb3QtPmZzX2luZm8tPnRyZWVfcm9vdDsKKwlhc3luYy0+Y291bnQgPSBjb3VudDsKKwlhc3luYy0+ZXJyb3IgPSAwOworCWlmICh3YWl0KQorCQlhc3luYy0+c3luYyA9IDE7CisJZWxzZQorCQlhc3luYy0+c3luYyA9IDA7CisJaW5pdF9jb21wbGV0aW9uKCZhc3luYy0+d2FpdCk7CisKKwlidHJmc19pbml0X3dvcmsoJmFzeW5jLT53b3JrLCBkZWxheWVkX3JlZl9hc3luY19zdGFydCwKKwkJCU5VTEwsIE5VTEwpOworCisJYnRyZnNfcXVldWVfd29yayhyb290LT5mc19pbmZvL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kJXAogCWlmICghKGNvbmQpKQkJCQkJCQlcCkBAIC03NzYsMzUgKzkyMCw0OCBAQAogICogRGlzayBEYXRhIFN0cnVjdHVyZXMKICAqLwogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNVUEVSIEJMT0NLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1VQRVIgQkxPQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogU3RydWN0dXJlIG9mIHN1cGVyIGJsb2NrIG9uIGRpc2ssIGEgdmVyc2lvbiBvZiB3aGljaCBpbiBSQU0gaXMgb2Z0ZW4gYWNjZXNzZWQgYXMgUkVJU0VSRlNfU0IocyktPnNfcnMKLSAqIHRoZSB2ZXJzaW9uIGluIFJBTSBpcyBwYXJ0IG9mIGEgbGFyZ2VyIHN0cnVjdHVyZSBjb250YWluaW5nIGZpZWxkcyBuZXZlciB3cml0dGVuIHRvIGRpc2suCisgKiBTdHJ1Y3R1cmUgb2Ygc3VwZXIgYmxvY2sgb24gZGlzaywgYSB2ZXJzaW9uIG9mIHdoaWNoIGluIFJBTSBpcyBvZnRlbgorICogYWNjZXNzZWQgYXMgUkVJU0VSRlNfU0IocyktPnNfcnMuIFRoZSB2ZXJzaW9uIGluIFJBTSBpcyBwYXJ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CiAjZGVmaW5lIFRZUEVfU1RBVF9EQVRBIDAKICNkZWZpbmUgVFlQRV9JTkRJUkVDVCAxCiAjZGVmaW5lIFRZUEVfRElSRUNUIDIKICNkZWZpbmUgVFlQRV9ESVJFTlRSWSAzCiAjZGVmaW5lIFRZUEVfTUFYVFlQRSAzCi0jZGVmaW5lIFRZUEVfQU5ZIDE1CQkvLyBGSVhNRTogY29tbWVudCBpcyByZXF1aXJlZAorI2RlZmluZSBUWVBFX0FOWSAxNQkJLyogRklYTUU6IGNvbW1lbnQgaXMgcmVxdWlyZWQgKi8KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICBLRVkgJiBJVEVNIEhFQUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgICAgICAgIEtFWSAmIElURU0gSEVBRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotLy8KLS8vIGRpcmVjdG9yaWVzIHVzZSB0aGlzIGtleSBhcyB3ZWxsIGFzIG9sZCBmaWxlcwotLy8KKy8qICogZGlyZWN0b3JpZXMgdXNlIHRoaXMga2V5IGFzIHdlbGwgYXMgb2xkIGZpbGVzICovCiBzdHJ1Y3Qgb2Zmc2V0X3YxIHsKIAlfX2xlMzIga19vZmZzZXQ7CiAJX19sZTMyIGtfdW5pcXVlbmVzczsKQEAgLTEwODQ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fTEVWRUwgMAogCiAjZGVmaW5lIERJU0tfTEVBRl9OT0RFX0xFVkVMICAxCS8qIExlYWYgbm9kZSBsZXZlbC4gKi8KIAotLyogR2l2ZW4gdGhlIGJ1ZmZlciBoZWFkIG9mIGEgZm9ybWF0dGVkIG5vZGUsIHJlc29sdmUgdG8gdGhlIGJsb2NrIGhlYWQgb2YgdGhhdCBub2RlLiAqLworLyoKKyAqIEdpdmVuIHRoZSBidWZmZXIgaGVhZCBvZiBhIGZvcm1hdHRlZCBub2RlLCByZXNvbHZlIHRvIHRoZQorICogYmxvY2sgaGVhZCBvZiB0aGF0IG5vZGUuCisgKi8KICNkZWZpbmUgQl9CTEtfSEVBRChiaCkJCQkoKHN0cnVjdCBibG9ja19oZWFkICopKChiaCktPmJfZGF0YSkpCiAvKiBOdW1iZXIgb2YgaXRlbXMgdGhhdCBhcmUgaW4gYnVmZmVyLiAqLwogI2RlZmluZSBCX05SX0lURU1TKGJoKQkJCShibGtoX25yX2l0ZW0oQl9CTEtfSEVBRChiaCkpKQpAQCAtMTQ3MSwxNCArMTY5MywxNCBAQAogI2RlZmluZSBCX0lTX0tFWVNfTEVWRUwoYmgpICAgICAgKEJfTEVWRUwoYmgpID4gRElTS19MRUFGX05PREVfTEVWRUwgXAogCQkJCQkgICAgJiYgQl9MRVZFTChiaCkgPD0gTUFYX0hFSUdIVCkKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFUIERBVEEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg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ICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIAotICAgUGljdHVyZSByZXByZXNlbnRzIHRoZSBzdHJ1Y3R1cmUgb2YgZGlyZWN0b3J5IGl0ZW1zCi0gICBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSAgIHwgIEFycmF5IG9mICAgICB8ICAgfCAgICAgfCAgICAgICAgfCAgICAgICB8ICAgfAotICAgfCBkaXJlY3RvcnkgICAgIHxOLTF8IE4tMiB8IC4uLi4gICB8ICAgMXN0IHwwdGh8Ci0gICB8IGVudHJ5IGhlYWRlcnMgfCAgIHwgICAgIHwgICAgICAgIHwgICAgICAgfCAgIHwKLSAgIHxfX19fX19fX19fX19fX198X19ffF9fX19ffF9fX19fX19ffF9fX19fX198X19ffAotICAgICAgICAgICAgICAgICAgICA8LS0tLSAgIGRpcmVjdG9yeSBlbnRyaWVzICAgICAgICAgLS0tLS0tPgotCi0gRmlyc3QgZGlyZWN0b3J5IGl0ZW0gaGFzIGtfb2Zmc2V0IGNvbXBvbmVudCAxLiBXZSBzdG9yZSAiLiIgYW5kICIuLiIKLSBpbiBvbmUgaXRlbSwgYWx3YXlzLCB3ZSBuZXZlciBzcGxpdCAiLiIgYW5kICIuLiIgaW50byBkaWZmZXJpbmcKLSBpdGVtcy4gIFRoaXMgbWFrZXMsIGFtb25nIG90aGVyIHRoaW5ncywgdGhlIGNvZGUgZm9yIHJlbW92aW5nCi0gZGlyZWN0b3JpZXMgc2ltcGxlci4gKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICAgIERJUkVDVE9SWSBTVFJVQ1RVUkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKgorICogUGljdHVyZSByZXByZXNlbnRzIHRoZSBzdHJ1Y3R1cmUgb2YgZGlyZWN0b3J5IGl0ZW1zCisgKiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KKyAqIHwgIEFycmF5IG9mICAgICB8ICAgfCAgICAgfCAgICAgICAgfCAgICAgICB8ICAgfAorICogfCBkaXJlY3RvcnkgICAgIHxOLTF8IE4tMiB8IC4uLi4gICB8ICAgMXN0IHwwdGh8CisgKiB8IGVudHJ5IGhlYWRlcnMgfCAgIHwgICAgIHwgICAgICAgIHwgICAgICAgfCAgIHwKKyAqIHxfX19fX19fX19fX19fX198X19ffF9fX19ffF9fX19fX19ffF9fX19fX198X19ffAorICogICAgICAgICAgICAgICAgICA8LS0tLSAgIGRpcmVjdG9yeSBlbnRyaWVzICAgICAgICAgLS0tLS0tPgorICoKKyAqIEZpcnN0IGRpcmVjdG9yeSBpdGVtIGhhcyBrX29mZnNldCBjb21wb25lbnQgMS4gV2Ugc3RvcmUgIi4iIGFuZCAiLi4iCisgKiBpbiBvbmUgaXRlbSwgYWx3YXlzLCB3ZSBuZXZlciBzcGxpdCAiLiIgYW5kICIuLiIgaW50byBkaWZmZXJpbmcKKyAqIGl0ZW1zLiAgVGhpcyBtYWtlcywgYW1vbmcgb3RoZXIgdGhpbmdzLCB0aGUgY29kZSBmb3IgcmVtb3ZpbmcKKyAqIGRpcmVjdG9yaWVzIHNpbXBsZXIuCisgKi8KICNkZWZpbmUgU0RfT0ZGU0VUICAwCiAjZGVmaW5lIFNEX1VOSVFVRU5FU1MgMAogI2RlZmluZSBET1RfT0ZGU0VUIDEKICNkZWZpbmUgRE9UX0RPVF9PRkZTRVQgMgogI2RlZmluZSBESVJFTlRSWV9VTklRVUVORVNTIDUwMAogCi0vKiAqLwogI2RlZm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fX19fX19ffF9fX19fX19fX19fX19fX19fX198X19fX19fX19fX198CiAgKi8KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgIERJU0sgQ0hJTEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzayBjaGlsZCBwb2ludGVyOiBUaGUgcG9pbnRlciBmcm9tIGFuIGludGVybmFsIG5vZGUgb2YgdGhlIHRyZWUKLSAgIHRvIGEgbm9kZSB0aGF0IGlzIG9uIGRpc2suICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgICAgICBESVNLIENISUxEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoKKyAqIERpc2sgY2hpbGQgcG9pbnRlcjoKKyAqIFRoZSBwb2ludGVyIGZyb20gYW4gaW50ZXJuYWwgbm9kZSBvZiB0aGUgdHJlZSB0byBhIG5vZGUgdGhhdCBpcyBvbiBkaXNrLgorICovCiBzdHJ1Y3QgZGlza19jaGlsZCB7CiAJX19sZTMyIGRjX2Jsb2NrX251bWJlcjsJLyogRGlzayBjaGlsZCdzIGJsb2NrIG51bWJlci4gKi8KIAlfX2xlMTYgZGNfc2l6ZTsJCS8qIERpc2sgY2hpbGQncyB1c2VkIHNwYWNlLiAgICovCkBAIC0xODQxLDQ3ICsyMDU4LDY2IEBACiAjZGVmaW5lIE1BWF9OUl9LRVkoYmgpICggKE1BWF9DSElMRF9TSVpFKGJoKS1EQ19TSVpFKS8oS0VZX1NJWkUrRENfU0laRSkgKQogI2RlZmluZSBNSU5fTlJfS0VZKGJoKSAgICAoTUFYX05SX0tFWShiaCkvMikKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgIFBBVEggU1RSVUNUVVJFUyBBTkQgREVGSU5FUyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgICAgICAgUEFUSCBTVFJVQ1RVUkVTIEFORCBERUZJTkVTICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotLyogU2VhcmNoX2J5X2tleSBmaWxscyB1cCB0aGUgcGF0aCBmcm9tIHRoZSByb290IHRvIHRoZSBsZWFmIGFzIGl0IGRlc2NlbmRzIHRoZSB0cmVlIGxvb2tpbmcgZm9yIHRoZQotICAga2V5LiAgSXQgdXNlcyByZWlzZXJmc19icmVhZCB0byB0cnkgdG8gZmluZCBidWZmZXJzIGluIHRoZSBjYWNoZSBnaXZlbiB0aGVpciBibG9jayBudW1iZXIuICBJZiBpdAotICAgZG9lcyBub3QgZmluZCB0aGVtIGluIHRoZSBjYWNoZSBpdCByZWFkcyB0aGVtIGZyb20gZGlzay4gIEZvciBlYWNoIG5vZGUgc2VhcmNoX2J5X2tleSBmaW5kcyB1c2luZwotICAgcmVpc2VyZnNfYnJlYWQgaXQgdGhlb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1RfQlVGRkVSKHBhdGgpLCBQQVRIX0xBU1RfUE9TSVRJT04ocGF0aCkpOworfQorCiAjZGVmaW5lIGdldF9sYXN0X2JoKHBhdGgpIFBBVEhfUExBU1RfQlVGRkVSKHBhdGgpCi0jZGVmaW5lIGdldF9paChwYXRoKSBQQVRIX1BJVEVNX0hFQUQocGF0aCkKICNkZWZpbmUgZ2V0X2l0ZW1fcG9zKHBhdGgpIFBBVEhfTEFTVF9QT1NJVElPTihwYXRoKQotI2RlZmluZSBnZXRfaXRlbShwYXRoKSAoKHZvaWQgKilCX05fUElURU0oUEFUSF9QTEFTVF9CVUZGRVIocGF0aCksIFBBVEhfTEFTVF9QT1NJVElPTiAocGF0aCkpKQogI2RlZmluZSBpdGVtX21vdmVkKGloLHBhdGgpIGNvbXBfaXRlbXMoaWgsIHBhdGgpCiAjZGVmaW5lIHBhdGhfY2hhbmdlZChpaCxwYXRoKSBjb21wX2l0ZW1zIChpaCwgcGF0aCkKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICBNSVNDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogYXJyYXkgb2YgdGhlIGVudHJ5IGhlYWRlcnMgKi8KKyAvKiBnZXQgaXRlbSBib2R5ICovCisjZGVmaW5lIEJfSV9ERUgoYmgsIGloKSAoKHN0cnVjdCByZWlzZXJmc19kZV9oZWFkICopKGloX2l0ZW1fYm9keShiaCwgaWgpKSkKKworLyoKKyAqIGxlbmd0aCBvZiB0aGUgZGlyZWN0b3J5IGVudHJ5IGluIGRpcmVjdG9yeSBpdGVtLiBUaGlzIGRlZmluZQorICogY2FsY3VsYXRlcyBsZW5ndGggb2YgaS10aCBkaXJlY3RvcnkgZW50cnkgdXNpbmcgZGlyZWN0b3J5IGVudHJ5CisgKiBsb2NhdGlvbnMgZnJvbSBkaXIgZW50cnkgaGVhZC4gV2hlbiBpdCBjYWxjdWxhdGVzIGxlbmd0aCBvZiAwLXRoCisgKiBkaXJlY3RvcnkgZW50cnksIGl0IHVzZXMgbGVuZ3RoIG9mIHdob2xlIGl0ZW0gaW4gcGxhY2Ugb2YgZW50cnkKKyAqIGxvY2F0aW9uIG9mIHRoZSBub24tZXhpc3RlbnQgZm9sbG93aW5nIGVudHJ5IGluIHRoZSBjYWxjdWxhdGlvbi4KKyAqIFNlZSBwaWN0dXJlIGFib3ZlLgorICovCitzdGF0aWMgaW5saW5lIGludCBlbnRyeV9sZW5ndGgoY29uc3Qgc3RydWN0IGJ1ZmZlcl9oZWFkICpiaCwKKwkJCSAgICAgICBjb25zdCBzdHJ1Y3QgaXRlbV9oZWFkICppaCwgaW50IHBvc19pbl9pdGVtKQoreworCXN0cnVjdCByZWlzZXJmc19kZV9oZWFkICpkZWg7CisKKwlkZWggPSBCX0lfREVIKGJoLCBpaCkgKyBwb3NfaW5faXRlbTsKKwlpZiAocG9zX2luX2l0ZW0pCisJCXJldHVybiBkZWhfbG9jYXRpb24oZGVoIC0gMSkgLSBkZWhfbG9jYXRpb24oZGVoKTsKKworCXJldHVybiBpaF9pdGVtX2xlbihpaCkgLSBkZWhfbG9jYXRpb24oZGVoKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgICAgICAgICAgIE1JU0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyogU2l6ZSBvZiBwb2ludGVyIHRvIHRoZ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B1c2VyIG1lbW9yeSBtb2RlICAgICAgICAgICAgKi8KKy8qCisgKiBUaGUgZm9sbG93aW5nIGRlZmluZXMgYXJlIHVzZWQgaW4gcmVpc2VyZnNfaW5zZXJ0X2l0ZW0KKyAqIGFuZCByZWlzZXJmc19hcHBlbmRfaXRlbQorICovCisjZGVmaW5lIFJFSVNFUkZTX0tFUk5FTF9NRU0JCTAJLyoga2VybmVsIG1lbW9yeSBtb2RlICovCisjZGVmaW5lIFJFSVNFUkZTX1VTRVJfTUVNCQkxCS8qIHVzZXIgbWVtb3J5IG1vZGUgKi8KIAogI2RlZmluZSBmc19nZW5lcmF0aW9uKHMpIChSRUlTRVJGU19TQihzKS0+c19nZW5lcmF0aW9uX2NvdW50ZXIpCiAjZGVmaW5lIGdldF9nZW5lcmF0aW9uKHMpIGF0b21pY19yZWFkICgmZnNfZ2VuZXJhdGlvbihzKSkKQEAgLTE5ODEsNDYgKzIzMDMsNjUgQEAKIAlfX2ZzX2NoYW5nZWQoZ2VuLCBzKTsJCVwKIH0pCiAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgIEZJWEFURSBOT0RFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgRklYQVRFIE5PREVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgICAgICAgICAgICAgIFRSRUUgQkFMQU5DRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0vKiBUaGlzIHRlbXBvcmFyeSBzdHJ1Y3R1cmUgaXMgdXNlZCBpbiB0cmVlIGJhbGFuY2UgYWxnb3JpdGhtcywgYW5kCi0gICBjb25zdHJ1Y3RlZCBhcyB3ZSBnbyB0byB0aGUgZXh0ZW50IHRoYXQgaXRzIHZhcmlvdXMgcGFydHMgYXJlCi0gICBuZWVkZWQuICBJdCBjb250YWlucyBhcnJheXMgb2Ygbm9kZXMgdGhhdCBjYW4gcG90ZW50aWFsbHkgYmUKLSAgIGludm9sdmVkIGluIHRoZSBiYWxhbmNpbmcgb2Ygbm9kZSBTLCBhbmQgcGFyYW1ldGVycyB0aGF0IGRlZmluZSBob3cKLSAgIGVhY2ggb2YgdGhlIG5vZGVzIG11c3QgYmUgYmFsYW5jZWQuICBOb3RlIHRoYXQgaW4gdGhlc2UgYWxnb3JpdGhtcwotICAgZm9yIGJhbGFuY2luZyB0aGUgd29yc3QgY2FzZSBpcyB0byBuZWVkIHRvIGJhbGFuY2UgdGhlIGN1cnJlbnQgbm9kZQotICAgUyBhbmQgdGhlIGxlZnQgYW5kIHJpZ2h0IG5laWdoYm9ycyBhbmQgYWxsIG9mIHRoZWlyIHBhcmVudHMgcGx1cwotICAgY3JlYXRlIGEgbmV3IG5vZGUuICBXZSBpbXBsZW1lbnQgUzEgYmFsYW5jaW5nIGZvciB0aGUgbGVhZiBub2RlcwotICAgYW5kIFMwIGJhbGFuY2luZyBmb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iovCi0vKiAgICAgICAgICAgICAgICAgICAgRlVOQ1RJT04gREVDTEFSQVRJT05TICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICAgICBGVU5DVElPTiBERUNMQVJBVElPTlMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNkZWZpbmUgZ2V0X2pvdXJuYWxfZGVzY19tYWdpYyhiaCkgKGJoLT5iX2RhdGEgKyBiaC0+Yl9zaXplIC0gMTIpCiAKQEAgLTIyNzMsNyArMjcwMSwxMCBAQAogLyogZmlyc3QgYmxvY2sgd3JpdHRlbiBpbiBhIGNvbW1pdC4gICovCiBzdHJ1Y3QgcmVpc2VyZnNfam91cm5hbF9kZXNjIHsKIAlfX2xlMzIgal90cmFuc19pZDsJLyogaWQgb2YgY29tbWl0ICovCi0JX19sZTMyIGpfbGVuOwkJLyogbGVuZ3RoIG9mIGNvbW1pdC4gbGVuICsxIGlzIHRoZSBjb21taXQgYmxvY2sgKi8KKworCS8qIGxlbmd0aCBvZiBjb21taXQuIGxlbiArMSBpcyB0aGUgY29tbWl0IGJsb2NrICovCisJX19sZTMyIGpfbGVuOworCiAJX19sZTMyIGpfbW91bnRfaWQ7CS8qIG1vdW50IGlkIG9mIHRoaXMgdHJhbnMgKi8KIAlfX2xlMzIgal9yZWFsYmxvY2tbMV07CS8qIHJlYWwgbG9jYXRpb25zIGZvciBlYWNoIGJsb2NrICovCiB9OwpAQCAtMjMwMCwyMiArMjczMSwzNSBAQAog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pbnQgaXNfdHJlZV9ub2RlKHN0cnVjdCBidWZmZXJfaGVhZCAqYmgsIGludCBsZXZlbCkKIHsKIAlpZiAoQl9MRVZFTChiaCkgIT0gbGV2ZWwpIHsKQEAgLTU0Niw3ICs1NDUsOCBAQAogCWZvciAoaiA9IDA7IGogPCBpOyBqKyspIHsKIAkJLyoKIAkJICogbm90ZSwgdGhpcyBuZWVkcyBhdHRlbnRpb24gaWYgd2UgYXJlIGdldHRpbmcgcmlkIG9mIHRoZSBCS0wKLQkJICogeW91IGhhdmUgdG8gbWFrZSBzdXJlIHRoZSBwcmVwYXJlZCBiaXQgaXNuJ3Qgc2V0IG9uIHRoaXMgYnVmZmVyCisJCSAqIHlvdSBoYXZlIHRvIG1ha2Ugc3VyZSB0aGUgcHJlcGFyZWQgYml0IGlzbid0IHNldCBvbiB0aGlzCisJCSAqIGJ1ZmZlcgogCQkgKi8KIAkJaWYgKCFidWZmZXJfdXB0b2RhdGUoYmhbal0pKSB7CiAJCQlpZiAoZGVwdGggPT0gLTEpCkBAIC01NTgsMzkgKzU1OCwzNCBAQAogCXJldHVybiBkZXB0aDsKIH0KIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBBbGdvcml0aG0gICBTZWFyY2hCeUtleSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIGxvb2sgZm9yIGl0ZW0gaW4gdGhlIERpc2sgUytUcmVlIGJ5IGl0cyBrZXkgICAgICAgICAgICAgICAgKgotICogSW5wdXQ6ICBzYiAgIC0gIHN1cGVyIGJsb2NrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgIGtleSAgLSBwb2ludGVyIHRvIHRoZSBrZXkgdG8gc2VhcmNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIE91dH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ldHVybiB4ZnNfYXR0cl9yZW1vdmVfaW50KGRwLCAmeG5hbWUsIGZsYWdzKTsKKwl4ZnNfaXVubG9jayhkcCwgWEZTX0lMT0NLX0VYQ0wpOworCXJldHVybiBlcnJvcjsKIH0KIAotCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICogRXh0ZXJuYWwgcm91dGluZXMgd2hlbiBhdHRyaWJ1dGUgbGlzdCBpcyBpbnNpZGUgdGhlIGlub2RlCiAgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCkBAIC05NTgsNyArODYzLDcgQEAKIH0KIAogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIEV4dGVybmFsIHJvdXRpbmVzIHdoZW4gYXR0cmlidXRlIGxpc3Qgc2l6ZSA+IFhGU19MQlNJWkUobXApLgorICogRXh0ZXJuYWwgcm91dGluZXMgd2hlbiBhdHRyaWJ1dGUgbGlzdCBzaXplID4gZ2VvLT5ibGtzaXplCiAgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qCkBAIC05OTEsOCArODk2LDYgQEAKIAlzdGF0ZSA9IHhmc19kYV9zdGF0ZV9hbGxvYygpOwogCXN0YXRlLT5hcmdzID0gYXJnczsKIAlzdGF0ZS0+bXAgPSBtcDsKLQlzdGF0ZS0+YmxvY2tzaXplID0gc3RhdGUtPm1wLT5tX3NiLnNiX2Jsb2Nrc2l6ZTsKLQlzdGF0ZS0+bm9kZV9lbnRzID0gc3RhdGUtPm1wLT5tX2F0dHJfbm9kZV9lbnRzOwogCiAJLyoKIAkgKiBTZWFyY2ggdG8gc2VlIGlmIG5hbWUgYWx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Pm9wcyA9ICZyYXdzb2NrX29wczsKIAogCXNrID0gc2tfYWxsb2MobmV0LCBQRl9ORkMsIEdGUF9BVE9NSUMsIG5mY19wcm90by0+cHJvdG8pOwogCWlmICghc2spCkBAIC0zMTMsMTMgKzM1Nyw1MyBAQAogCXNrLT5za19wcm90b2NvbCA9IG5mY19wcm90by0+aWQ7CiAJc2stPnNrX2Rlc3RydWN0ID0gcmF3c29ja19kZXN0cnVjdDsKIAlzb2NrLT5zdGF0ZSA9IFNTX1VOQ09OTkVDVEVEOwotCi0JSU5JVF9XT1JLKCZuZmNfcmF3c29jayhzayktPnR4X3dvcmssIHJhd3NvY2tfdHhfd29yayk7Ci0JbmZjX3Jhd3NvY2soc2spLT50eF93b3JrX3NjaGVkdWxlZCA9IGZhbHNlOworCWlmIChzb2NrLT50eXBlID09IFNPQ0tfUkFXKQorCQluZmNfc29ja19saW5rKCZyYXdfc2tfbGlzdCwgc2spOworCWVsc2UgeworCQlJTklUX1dPUksoJm5mY19yYXdzb2NrKHNrKS0+dHhfd29yaywgcmF3c29ja190eF93b3JrKTsKKwkJbmZjX3Jhd3NvY2soc2spLT50eF93b3JrX3NjaGVkdWxlZCA9IGZhbHNlOworCX0KIAogCXJldHVybiAwOwogfQogCit2b2lkIG5mY19zZW5kX3RvX3Jhd19zb2NrKHN0cnVjdCBuZmNfZGV2ICpkZXYsIHN0cnVjdCBza19idWZmICpza2IsCisJCQkgIHU4IHBheWxvYWRfdHlwZSwgdTggZGlyZWN0aW9uKQoreworCXN0cnVjdCBza19idWZmICpza2JfY29weSA9IE5VTEwsICpuc2tiOworCXN0cnVjdCBzb2NrICpzazsKKwl1OCAqZGF0YTsKKworCXJlYWRfbG9jaygmcmF3X3NrX2xpc3QubG9jayk7CisKKwlza19mb3JfZWFjaChzaywgJnJhd19za19saXN0LmhlYWQpIHsKKwkJaWYgKCFza2JfY29weSkgeworCQkJc2tiX2NvcHkgPSBfX3Bza2JfY29weV9mY2xvbmUoc2tiLCBORkNfUk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KwlyZXBseSA9IG92c19mbG93X2NtZF9hbGxvY19pbmZvKGFjdHMsIGluZm8sIGZhbHNlKTsKKwlpZiAoSVNfRVJSKHJlcGx5KSkgeworCQllcnJvciA9IFBUUl9FUlIocmVwbHkpOworCQlnb3RvIGVycl9rZnJlZV9hY3RzOworCX0KKworCW92c19sb2NrKCk7CisJZHAgPSBnZXRfZHAoc29ja19uZXQoc2tiLT5zayksIG92c19oZWFkZXItPmRwX2lmaW5kZXgpOworCWlmICh1bmxpa2VseSghZHApKSB7CisJCWVycm9yID0gLUVOT0RFVjsKKwkJZ290byBlcnJfdW5sb2NrX292czsKKwl9CisJLyogQ2hlY2sgaWYgdGhpcyBpcyBhIGR1cGxpY2F0ZSBmbG93ICovCisJZmxvdyA9IG92c19mbG93X3RibF9sb29rdXAoJmRwLT50YWJsZSwgJm5ld19mbG93LT51bm1hc2tlZF9rZXkpOworCWlmIChsaWtlbHkoIWZsb3cpKSB7CisJCXJjdV9hc3NpZ25fcG9pbnRlcihuZXdfZmxvdy0+c2ZfYWN0cywgYWN0cyk7CisKKwkJLyogUHV0IGZsb3cgaW4gYnVja2V0LiAqLworCQllcnJvciA9IG92c19mbG93X3RibF9pbnNlcnQoJmRwLT50YWJsZSwgbmV3X2Zsb3csICZtYXNrKTsKKwkJaWYgKHVubGlrZWx5KGVycm9yKSkgeworCQkJYWN0cyA9IE5VTEw7CisJCQlnb3RvIGVycl91bmxvY2tfb3ZzOworCQl9CisKKwkJaWYgKHVubGlrZWx5KHJlcGx5KSkgeworCQkJZXJyb3IgPSBvdnNfZmxvd19jbWRfZmlsbF9pbmZvKG5ld19mbG93LAorCQkJCQkJICAgICAgIG92c19oZWFkZXItPmRwX2lmaW5kZXgsCisJCQkJCQkgICAgICAgcmVwbHksIGluZm8tPnNuZF9wb3J0aWQsCisJCQkJCQkgICAgICAgaW5mby0+c25kX3NlcSwgMCwKKwkJCQkJCSAgICAgICBPVlNfRkxPV19DTURfTkVXKTsKKwkJCUJVR19PTihlc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PT0gID09PT09PT09PT09PT09CisJICogICAyMC4wMCUgICAgIHBlcmYgIHBlcmYgICAgICAgICAgIFsuXSBtYWluCisJICogICAxMC4wMCUgICAgIGJhc2ggIFtrZXJuZWxdICAgICAgIFtrXSBwYWdlX2ZhdWx0CisJICogICAxMC4wMCUgICAgIGJhc2ggIGJhc2ggICAgICAgICAgIFsuXSBtYWluCisJICogICAxMC4wMCUgICAgIGJhc2ggIGJhc2ggICAgICAgICAgIFsuXSB4bWFsbG9jCisJICogICAxMC4wMCUgICAgIHBlcmYgIFtrZXJuZWxdICAgICAgIFtrXSBwYWdlX2ZhdWx0CisJICogICAxMC4wMCUgICAgIHBlcmYgIFtrZXJuZWxdICAgICAgIFtrXSBzY2hlZHVsZQorCSAqICAgMTAuMDAlICAgICBwZXJmICBsaWJjICAgICAgICAgICBbLl0gZnJlZQorCSAqICAgMTAuMDAlICAgICBwZXJmICBsaWJjICAgICAgICAgICBbLl0gbWFsbG9jCisJICogICAxMC4wMCUgICAgIHBlcmYgIHBlcmYgICAgICAgICAgIFsuXSBjbWRfcmVjb3JkCisJICovCisJc3RydWN0IHJlc3VsdCBleHBlY3RlZFtdID0geworCQl7IDAsIDIwMDAsICJwZXJmIiwgInBlcmYiLCAgICAgIm1haW4iIH0sCisJCXsgMCwgMTAwMCwgImJhc2giLCAiW2tlcm5lbF0iLCAicGFnZV9mYXVsdCIgfSwKKwkJeyAwLCAxMDAwLCAiYmFzaCIsICJiYXNoIiwgICAgICJtYWluIiB9LAorCQl7IDAsIDEwMDAsICJiYXNoIiwgImJhc2giLCAgICAgInhtYWxsb2MiIH0sCisJCXsgMCwgMTAwMCwgInBlcmYiLCAiW2tlcm5lbF0iLCAicGFnZV9mYXVsdCIgfSwKKwkJeyAwLCAxMDAwLCAicGVyZiIsICJba2VybmVsXSIsICJzY2hlZHVsZSIgfSwKKwkJeyAwLCAxMDAwLCAicGVyZiIsICJsaWJjIiwgICAgICJmcmVlIiB9LAorCQl7IDAsIDEwMDAsICJwZXJmIiwgImxpYmMiLCAgICAgIm1hbGxvYyIgfSwKKwkJeyAwLCAxMDAwLCAicGVyZiIsICJwZXJmIiwgICAgICJjbWRfcmVjb3JkIiB9LAorCX07CisKKwlzeW1ib2xfY29uZi51c2VfY2FsbGNoYWluID0gZmFsc2U7CisJc3ltYm9sX2NvbmYuY3VtdWxhdGVfY2FsbGNoYWluID0gZmFsc2U7CisKKwlzZXR1cF9zb3J0aW5nKCk7CisJY2FsbGNoYWluX3JlZ2lzdGVyX3BhcmFtKCZjYWxsY2hhaW5fcGFyYW0pOworCisJZXJyID0gYWRkX2hpc3RfZW50cmllcyhoaXN0cywgbWFjaGluZSk7CisJaWYgKGVyciA8IDApCisJCWdvdG8gb3V0OworCisJZXJyID0gZG9fdGVzdChoaXN0cywgZXhwZWN0ZWQsIEFSUkFZX1NJWkUoZXhwZWN0ZWQpLCBOVUxMLCAwKTsKKworb3V0OgorCWRlbF9oaXN0X2VudHJpZXMoaGlzdHMpOworCXJlc2V0X291dHB1dF9maWVsZCgpOworCXJldHVybiBlcnI7Cit9CisKKy8qIGNhbGxjYWluICsgTk8gY2hpbGRyZW4gKi8KK3N0YXRpYyBpbnQgdGVzdDIoc3RydWN0IHBlcmZfZXZzZWwgKmV2c2VsLCBzdHJ1Y3QgbWFjaGluZSAqbWFjaGluZSkKK3sKKwlpbnQgZXJyOworCXN0cnVjdCBoaXN0cyAqaGlzdHMgPSAmZXZzZWwtPmhpc3RzOworCS8qCisJICogZXhwZWN0ZWQgb3V0cHV0OgorCSAqCisJICogT3ZlcmhlYWQgIENvbW1hbmQgIFNoYXJlZCBPYmplY3QgICAgICAgICAgU3ltYm9sCisJICogPT09PT09PT0gID09PT09PT0gID09PT09PT09PT09PT0gID09PT09PT09PT09PT09CisJICogICAyMC4wMCUgICAgIHBlcmYgIHBlcmYgICAgICAgICAgIFsuXSBtYWluCisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIG1haW4KKwkgKgorCSAqICAgMTAuMDAlICAgICBiYXNoICBba2VybmVsXSAgICAgICBba10gcGFnZV9mYXVsdAorCSAqICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgIC0tLSBwYWdlX2ZhdWx0CisJICogICAgICAgICAgICAgICAgICBtYWxsb2MKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqICAgMTAuMDAlICAgICBiYXNoICBiYXNoICAgICAgICAgICBbLl0gbWFpbgorCSAqICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgIC0tLSBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAgYmFzaCAgYmFzaCAgICAgICAgICAgWy5dIHhtYWxsb2MKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0geG1hbGxvYworCSAqICAgICAgICAgICAgICAgICAgbWFsbG9jCisJICogICAgICAgICAgICAgICAgICB4bWFsbG9jICAgICA8LS0tIE5PVEU6IHRoZXJlJ3MgYSBjeWNsZQorCSAqICAgICAgICAgICAgICAgICAgbWFsbG9jCisJICogICAgICAgICAgICAgICAgICB4bWFsbG9jCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAgcGVyZiAgW2tlcm5lbF0gICAgICAgW2tdIHBhZ2VfZmF1bHQKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gcGFnZV9mYXVsdAorCSAqICAgICAgICAgICAgICAgICAgc3lzX3BlcmZfZXZlbnRfb3BlbgorCSAqICAgICAgICAgICAgICAgICAgcnVuX2NvbW1hbmQKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqICAgMTAuMDAlICAgICBwZXJmICBba2VybmVsXSAgICAgICBba10gc2NoZWR1bGUKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gc2NoZWR1bGUKKwkgKiAgICAgICAgICAgICAgICAgIHJ1bl9jb21tYW5kCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAgcGVyZiAgbGliYyAgICAgICAgICAgWy5dIGZyZWUKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gZnJlZQorCSAqICAgICAgICAgICAgICAgICAgY21kX3JlY29yZAorCSAqICAgICAgICAgICAgICAgICAgcnVuX2NvbW1hbmQKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqICAgMTAuMDAlICAgICBwZXJmICBsaWJjICAgICAgICAgICBbLl0gbWFsbG9jCisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIG1hbGxvYworCSAqICAgICAgICAgICAgICAgICAgY21kX3JlY29yZAorCSAqICAgICAgICAgICAgICAgICAgcnVuX2NvbW1hbmQKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqICAgMTAuMDAlICAgICBwZXJmICBwZXJmICAgICAgICAgICBbLl0gY21kX3JlY29yZAorCSAqICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgIC0tLSBjbWRfcmVjb3JkCisJICogICAgICAgICAgICAgICAgICBydW5fY29tbWFuZAorCSAqICAgICAgICAgICAgICAgICAgbWFpbgorCSAqCisJICovCisJc3RydWN0IHJlc3VsdCBleHBlY3RlZFtdID0geworCQl7IDAsIDIwMDAsICJwZXJmIiwgInBlcmYiLCAgICAgIm1haW4iIH0sCisJCXsgMCwgMTAwMCwgImJhc2giLCAiW2tlcm5lbF0iLCAicGFnZV9mYXVsdCIgfSwKKwkJeyAwLCAxMDAwLCAiYmFzaCIsICJiYXNoIiwgICAgICJtYWluIiB9LAorCQl7IDAsIDEwMDAsICJiYXNoIiwgImJhc2giLCAgICAgInhtYWxsb2MiIH0sCisJCXsgMCwgMTAwMCwgInBlcmYiLCAiW2tlcm5lbF0iLCAicGFnZV9mYXVsdCIgfSwKKwkJeyAwLCAxMDAwLCAicGVyZiIsICJba2VybmVsXSIs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6CisJZGVsX2hpc3RfZW50cmllcyhoaXN0cyk7CisJcmVzZXRfb3V0cHV0X2ZpZWxkKCk7CisJcmV0dXJuIGVycjsKK30KKworLyogTk8gY2FsbGNoYWluICsgY2hpbGRyZW4gKi8KK3N0YXRpYyBpbnQgdGVzdDMoc3RydWN0IHBlcmZfZXZzZWwgKmV2c2VsLCBzdHJ1Y3QgbWFjaGluZSAqbWFjaGluZSkKK3sKKwlpbnQgZXJyOworCXN0cnVjdCBoaXN0cyAqaGlzdHMgPSAmZXZzZWwtPmhpc3RzOworCS8qCisJICogZXhwZWN0ZWQgb3V0cHV0OgorCSAqCisJICogQ2hpbGRyZW4gICAgICBTZWxmICBDb21tYW5kICBTaGFyZWQgT2JqZWN0ICAgICAgICAgICAgICAgICAgIFN5bWJvbAorCSAqID09PT09PT09ICA9PT09PT09PSAgPT09PT09PSAgPT09PT09PT09PT09PSAgPT09PT09PT09PT09PT09PT09PT09PT0KKwkgKiAgIDcwLjAwJSAgICAyMC4wMCUgICAgIHBlcmYgIHBlcmYgICAgICAgICAgIFsuXSBtYWluCisJICogICA1MC4wMCUgICAgIDAuMDAlICAgICBwZXJmICBwZXJmICAgICAgICAgICBbLl0gcnVuX2NvbW1hbmQKKwkgKiAgIDMwLjAwJSAgICAxMC4wMCUgICAgIGJhc2ggIGJhc2ggICAgICAgICAgIFsuXSBtYWluCisJICogICAzMC4wMCUgICAgMTAuMDAlICAgICBwZXJmICBwZXJmICAgICAgICAgICBbLl0gY21kX3JlY29yZAorCSAqICAgMjAuMDAlICAgICAwLjAwJSAgICAgYmFzaCAgbGliYyAgICAgICAgICAgWy5dIG1hbGxvYworCSAqICAgMTAuMDAlICAgIDEwLjAwJSAgICAgYmFzaCAgW2tlcm5lbF0gICAgICAgW2tdIHBhZ2VfZmF1bHQKKwkgKiAgIDEwLjAwJSAgICAxMC4wMCUgICAgIHBlcmYgIFtrZXJuZWxdICAgICAgIFtrXSBzY2hlZHVsZQorCSAqICAgMTAuMDAlICAgICA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AgcGVyZiAgcGVyZiAgICAgICAgICAgWy5dIG1haW4KKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gbWFpbgorCSAqCisJICogICA1MC4wMCUgICAgIDAuMDAlICAgICBwZXJmICBwZXJmICAgICAgICAgICBbLl0gcnVuX2NvbW1hbmQKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gcnVuX2NvbW1hbmQKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqICAgMzAuMDAlICAgIDEwLjAwJSAgICAgYmFzaCAgYmFzaCAgICAgICAgICAgWy5dIG1haW4KKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gbWFpbgorCSAqCisJICogICAzMC4wMCUgICAgMTAuMDAlICAgICBwZXJmICBwZXJmICAgICAgICAgICBbLl0gY21kX3JlY29yZAorCSAqICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgIC0tLSBjbWRfcmVjb3JkCisJICogICAgICAgICAgICAgICAgICBydW5fY29tbWFuZAorCSAqICAgICAgICAgICAgICAgICAgbWFpbgorCSAqCisJICogICAyMC4wMCUgICAgIDAuMDAlICAgICBiYXNoICBsaWJjICAgICAgICAgICBbLl0gbWFsbG9jCisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIG1hbGxvYworCSAqICAgICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgICAgIHwtLTUwLjAwJS0tIHhtYWxsb2MKKwkgKiAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgbWFpbgorCSAqICAgICAgICAgICAgICAgICAgLS01MC4wMCUtLSBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAxMC4wMCUgICAgIGJhc2ggIFtrZXJuZWxdICAgICAgIFtrXSBwYWdlX2ZhdWx0CisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIHBhZ2VfZmF1bHQKKwkgKiAgICAgICAgICAgICAgICAgIG1hbGxvYworCSAqICAgICAgICAgICAgICAgICAgbWFpbgorCSAqCisJICogICAxMC4wMCUgICAgMTAuMDAlICAgICBwZXJmICBba2VybmVsXSAgICAgICBba10gc2NoZWR1bGUKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gc2NoZWR1bGUKKwkgKiAgICAgICAgICAgICAgICAgIHJ1bl9jb21tYW5kCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAgMC4wMCUgICAgIHBlcmYgIFtrZXJuZWxdICAgICAgIFtrXSBzeXNfcGVyZl9ldmVudF9vcGVuCisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIHN5c19wZXJmX2V2ZW50X29wZW4KKwkgKiAgICAgICAgICAgICAgICAgIHJ1bl9jb21tYW5kCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAxMC4wMCUgICAgIHBlcmYgIFtrZXJuZWxdICAgICAgIFtrXSBwYWdlX2ZhdWx0CisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIHBhZ2VfZmF1bHQKKwkgKiAgICAgICAgICAgICAgICAgIHN5c19wZXJmX2V2ZW50X29wZW4KKwkgKiAgICAgICAgICAgICAgICAgIHJ1bl9jb21tYW5kCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAxMC4wMCUgICAgIHBlcmYgIGxpYmMgICAgICAgICAgIFsuXSBmcmVlCisJICogICAgICAgICAgICAgIHwKKwkgKiAgICAgICAgICAgICAgLS0tIGZyZWUKKwkgKiAgICAgICAgICAgICAgICAgIGNtZF9yZWNvcmQKKwkgKiAgICAgICAgICAgICAgICAgIHJ1bl9jb21tYW5kCisJICogICAgICAgICAgICAgICAgICBtYWluCisJICoKKwkgKiAgIDEwLjAwJSAgICAxMC4wMCUgICAgIHBlcmYgIGxpYmMgICAgICAgICAgIFsuXSBtYWxsb2MKKwkgKiAgICAgICAgICAgICAgfAorCSAqICAgICAgICAgICAgICAtLS0gbWFsbG9jCisJICogICAgICAgICAgICAgICAgICBjbWRfcmVjb3JkCisJICogICAgICAgICAgICAgICAgICBydW5fY29tbWFuZAorCSAqICAgICAgICAgICAgICAgICAgbWFpbgorCSAqCisJICogICAxMC4wMCUgICAgMTAuMDAlICAgICBiYXNoICBiYXNoICAgICAgICAgICBbLl0geG1hbGxvYworCSAqICAgICAgICAgICAgICB8CisJICogICAgICAgICAgICAgIC0tLSB4bWFsbG9jCisJICogICAgICAgICAgICAgICAgICBtYWxsb2MKKwkgKiAgICAgICAgICAgICAgICAgIHhtYWxsb2MgICAgIDwtLS0gTk9URTogdGhlcmUncyBhIGN5Y2xlCisJICogICAgICAgICAgICAgICAgICBtYWxsb2MKKwkgKiAgICAgICAgICAgICAgICAgIHhtYWxsb2MKKwkgKiAgICAgICAgICAgICAgICAgIG1haW4KKwkgKgorCSAqLworCXN0cnVjdCByZXN1bHQgZXhwZWN0ZWRbXSA9IHsKKwkJeyA3MDAwLCAyMDAwLCAicGVyZiIsICJwZXJmIiwgICAgICJtYWluIiB9LAorCQl7IDUwMDAsICAgIDAsICJwZXJmIiwgInBlcmYiLCAgICAgInJ1bl9jb21tYW5kIiB9LAorCQl7IDMwMDAsIDEwMDAsICJiYXNoIiwgImJhc2giLCAgICAgIm1haW4iIH0sCisJCXsgMzAwMCwgMTAwMCwgInBlcmYiLCAicGVyZiIsICAgICAiY21kX3JlY29yZCIgfSwKKwkJeyAyMDAwLCAgICAwLCAiYmFzaCIsICJsaWJjIiwgICAgICJtYWxsb2MiIH0sCisJCXsgMTAwMCwgMTAwMCwgImJhc2giLCAiW2tlcm5lbF0iLCAicGFnZV9mYXVsdCIgfSwKKwkJeyAxMDAwLCAxMDAwLCAicGVyZiIsICJba2VybmVsXSIsICJzY2hlZHVsZSIgfSwKKwkJeyAxMDAwLCAgIC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SwgfSwKKwkJfSwKKwkJeworCQkJMywgewl7ICJba2VybmVsXSIsICJzY2hlZHVsZSIgfSwKKwkJCQl7ICJwZXJmIiwgICAgICJydW5fY29tbWFuZCIgfSwKKwkJCQl7ICJwZXJmIiwgICAgICJtYWluIiB9LCB9LAorCQl9LAorCQl7CisJCQkzLCB7CXsgIltrZXJuZWxdIiwgInN5c19wZXJmX2V2ZW50X29wZW4iIH0sCisJCQkJeyAicGVyZiIsICAgICAicnVuX2NvbW1hbmQiIH0sCisJCQkJeyAicGVyZiIsICAgICAibWFpbiIgfSwgfSwKKwkJfSwKKwkJeworCQkJNCwgewl7ICJba2VybmVsXSIsICJwYWdlX2ZhdWx0IiB9LAorCQkJCXsgIltrZXJuZWxdIiwgInN5c19wZXJmX2V2ZW50X29wZW4iIH0sCisJCQkJeyAicGVyZiIsICAgICAicnVuX2NvbW1hbmQiIH0sCisJCQkJeyAicGVyZiIsICAgICAibWFpbiIgfSwgfSwKKwkJfSwKKwkJeworCQkJNCwgewl7ICJsaWJjIiwgICAgICJmcmVlIiB9LAorCQkJCXsgInBlcmYiLCAgICAgImNtZF9yZWNvcmQiIH0sCisJCQkJeyAicGVyZiIsICAgICAicnVuX2NvbW1hbmQiIH0sCisJCQkJeyAicGVyZiIsICAgICAibWFpbiIgfSwgfSwKKwkJfSwKKwkJeworCQkJNCwgewl7ICJsaWJjIiwgICAgICJtYWxsb2MiIH0sCisJCQkJeyAicGVyZiIsICAgICAiY21kX3JlY29yZCIgfSwKKwkJCQl7ICJwZXJmIiwgICAgICJydW5fY29tbWFuZCIgfSwKKwkJCQl7ICJwZXJmIiwgICAgICJtYWluIiB9LCB9LAorCQl9LAorCQl7CisJCQk2LCB7CXsgImJhc2giLCAgICAgInhtYWxsb2MiIH0sCisJCQkJeyAibGliYyIsICAgICAibWFsbG9jIiB9LAorCQkJCXsgImJhc2giLCAgICAgInhtYWxsb2MiIH0sCisJCQkJeyAibGliYyIsICAgICAibWFsbG9jIiB9LAorCQkJCX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