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kZWZpbmUgWkNDX0FQUF9BVF9DT01NX0RFViAgICAgIi9kZXYvYXJtcHNfcnBtc2djaDE0Ig0KKyNkZWZpbmUgWkNDX0FQUF9BVF9DT01NX0lORCAgICAgICAgICIvZGV2L2FybXBzX3JwbXNnY2gxNSINCisNCisNCitzdGF0aWMgaW50ICBnX3pDY0FwcF9Db21GZFs0XSA9IHswfTsgICANCisNCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqICCyqMzYwsrXqruv16q7u7qvyv0NCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorc3RhdGljIGludCBjb252YmF1ZCh1bnNpZ25lZCBsb25nIGludCBiYXVkcmF0ZSkNCit7DQorICAgICAgICAgc3dpdGNoIChiYXVkcmF0ZSkNCisgICAgICAgICB7DQorICAgICAgICAgICAgY2FzZSAyNDAwOg0KKyAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCMjQwMDsNCisgICAgICAgICAgICBjYXNlIDQ4MDA6DQorICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEI0ODAwOw0KKyAgICAgICAgICAgIGNhc2UgOTYwMDoNCisgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjk2MDA7DQorICAgICAgICAgICAgY2FzZSAxOTIwMDoNCisgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjE5MjAwOw0KKyAgICAgICAgICAgIGNhc2UgMzg0MDA6DQorICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEIzODQwMDsNCisgICAgICAgICAgICBjYXNlIDU3NjAwOg0KKyAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCNTc2MDA7DQorICAgICAgICAgICAgY2FzZSAxMTUyMDA6DQorICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEIxMTUyMDA7DQorICAgICAgICAgICAgZGVmYXVsdDoNCisgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQjk2MDA7DQorICAgICAgICAgfQ0KK30NCisNCisjaWZuZGVmIFRFU1RfQ0NBUFANCitpbnQgekNjX0NsZWFuQ0NNU0coKQ0KK3sNCisgICAgICAgICBpbnQgcmV0ID0gLTE7DQorICAgICAgICAgLy9nZXQgQ0MgZmQNCisgICAgICAgICBpbnQgZmQgPSB6Q2NBcHBfR2V0QXRDQ0ZkKCk7DQorICAgICAgICAgZmRfc2V0IHJlYWRmZEZvckNDOw0KKyAgICAgICAgIA0KKyAgICAgICAgc3RydWN0IHRpbWV2YWwgdHY9ezB9OyAgIA0KKw0KKyAgICAgICAgIHdoaWxlKDEpDQorICAgICAgICAgew0KKyAgICAgICAgICAgIC8vMHMgdGltZW91dA0KKyAgICAgICAgICAgIHR2LnR2X3NlYyA9IDA7DQorICAgICAgICAgICAgRkRfWkVSTygmcmVhZGZkRm9yQ0MpOw0KKyAgICAgICAgICAgIEZEX1NFVChmZCwgJnJlYWRmZEZvckNDKTsgICAgICAgICAgICANCisgICAgICAgICAgICByZXQgPSBzZWxlY3QoZmQgKyAxLCAmcmVhZGZkRm9yQ0MsIE5VTEwsIE5VTEwsICZ0dik7DQorICAgICAgICAgICAgaWYocmV0PDApDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICAvLyJTZWxlY3QgdGltZW91dCINCisgICAgICAgICAgICBpZihyZXQgPT0gMCkgICAgICAgICAgDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICANCisgICAgICAgICAgICBpZihGRF9JU1NFVChmZCwgJnJlYWRmZEZvckNDKSkgICAgICAgICANCisgICAgICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICAgY2hhciBBdEJ1ZltaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOXSA9IHswfTsNCisgICAgICAgICAgICAgICAgICAgICBpbnQgcmVhZGxlbiA9IDA7DQorICAgICAgICAgICAgICAgICAgICAgcmVhZGxlbiA9IHJlYWQoZmQsIEF0QnVmLCBaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgZWxzZQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgfQ0KKyAgICAgICAgIA0KKyAgICAgICAgIHJldHVybiAwOw0KK30NCisNCitpbnQgekNjQXBwX0dldEF0Q21kRmQodm9pZCkNCit7DQorICAgIGludCBmZCA9IDA7DQorICAgIEVfQ0NfQVBQX0F0UmVxQ21kSWQgIEF0Q2hubENtZElkID0gZ19DY19DYWxsRGV0YWlsLmN1ckF0Q21kSWQ7DQorDQorICAgIHN3aXRjaCAoQXRDaG5sQ21kSWQpDQorICAgIHsNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfQToNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfRDoNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfQ0hVUDoNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfU0VUX0NITEQ6DQorICAgICAgICBjYXNlIENDX0FQUF9BVF9DTURfUkVRX1ZUUzogICANCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfSU1TUExVUzoNCisgICAgICAgIGZkID0gZ196Q2NBcHBfQ29tRmRbMV07DQorICAgICAgICBicmVhazsNCisNCisNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfR0VUX0NMQ0M6ICAgICAgICANCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfQ01VVDoNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfQ0xWTDoNCisgICAgICAgIGZkID0gZ196Q2NBcHBfQ29tRmRbM107DQorICAgICAgICBicmVhazsNCisNCisNCisNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfU0VUX0NDRkM6DQorICAgICAgICBjYXNlIENDX0FQUF9BVF9DTURfUkVRX1NFVF9DQ1dBOg0KKyAgICAgICAgY2FzZSBDQ19BUFBfQVRfQ01EX1JFUV9TRVRfQ0xDSzoNCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfR0VUX0NDRkM6DQorICAgICAgICBjYXNlIENDX0FQUF9BVF9DTURfUkVRX0dFVF9DQ1dBOiAgICANCisgICAgICAgIGNhc2UgQ0NfQVBQX0FUX0NNRF9SRVFfU0VUX0NQV0Q6DQorICAgICAgICBmZCA9IGdfekNjQXBwX0NvbUZkWzJdOw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgDQorICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgYnJlYWs7DQorICAgIH0NCisgICAgDQorICAgIHJldHVybiBmZDsNCit9DQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogIHNlbmQgZGF0YQ0KKyAqICBmZGNvbTogtK6/2sPoyva3+ywgZGF0YTogtP23osvNyv2+3SwgZGF0YWxlbjogyv2+3bOktsgNCisgKiAgt7W72Mq1vMq3osvNs6S2yA0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IHpDY0FwcF9Qb3J0U2VuZChpbnQgZmRjb20sIENIQVIgKmRhdGEsIGludCBkYXRhbGVuKQ0KK3sNCisgICAgaW50IGxlbiA9IDA7DQorICAgIHp0ZV9sb2dfYXBwZW5kKF9fRklMRV9fLCBfX0xJTkVfXywgInp0ZV9jY2FwcC5sb2ciLCIlcyAgekNjQXBwX1BvcnRTZW5kOkF0Y21kTXNnID0gJXNcbiIsX19GVU5DVElPTl9fLGRhdGEpOw0KKyAgICBsZW4gPSB3cml0ZShmZGNvbSwgZGF0YSwgZGF0YWxlbik7ICAvL8q1vMrQtMjrtcSzpLbIDQorICAgIGlmIChsZW4gPT0gZGF0YWxlbikNCisgICAgew0KKyAgICAgICAgenRlX2xvZ19hcHBlbmQoX19GSUxFX18sIF9fTElORV9fLCAienRlX2NjYXBwLmxvZyIsIiVzIHpDY0FwcF9Qb3J0U2VuZCBzdWNjIGZkY29tPSVkLGRhdGE9JXMsbGVuPSVkXG4gIDwtLS1cbiIsX19GVU5DVElPTl9fLGZkY29tLGRhdGEsZGF0YWxlbik7DQorICAgICAgICByZXR1cm4gbGVuOw0KKyAgICB9DQorICAgIGVsc2UNCisgICAgew0KKyAgICAgICAgenRlX2xvZ19hcHBlbmQoX19GSUxFX18sIF9fTElORV9fLCAienRlX2NjYXBwLmxvZyIsIiVzIHpDY0FwcF9Qb3J0U2VuZCBmYWlsIGZkY29tPSVkLGRhdGE9JXMsbGVuPSVkXG4gIDwtLS1cbiIsX19GVU5DVElPTl9fLGZkY29tLGRhdGEsZGF0YWxlbik7DQorICAgICAgICB0Y2ZsdXNoKGZkY29tLCBUQ09GTFVTSCk7DQorICAgICAgICByZXR1cm4gLTE7DQorICAgIH0NCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAgcmVjZWl2ZSBkYXRhDQorICogILe1u9jKtbzKtsHI67XE19a92sr9DQorICoNCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQoraW50IHpDY0FwcF9Qb3J0UmVjdihpbnQgZmRjb20sIENIQVIgKmRhdGEsIGludCBkYXRhbGVuKQ0KK3sNCisgICAgDQorICAgIGNoYXIgQXRCdWZbWkNDX0FQUF9BVF9CVUZfTUFYX0xFTl0gPSB7MH07DQorICAgIGludCByZWFkbGVuID0gMDsNCisgICAgcmVhZGxlbiA9IHJlYWQoZmRjb20sIEF0QnVmLCBaQ0NfQVBQX0FUX0JVRl9NQVhfTEVOKTsNCisJaWYgKHJlYWRsZW4gPj0gMCkgeyAvL2NvdiBtDQorCQlzdHJuY3B5KGRhdGEsQXRCdWYscmVhZGxlbik7DQorCX0NCisJICAgIA0KKyAgICByZXR1cm4gcmVhZGxlbjsNCit9DQorDQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiAgU2V0dXAgY29tbSBhdHRyDQorICogIGZkY29tOiC0rr/azsS8/sPoyva3+ywgcHBvcnRpbmZvOiC0/cno1sO1xLbLv9rQxc+icw0KKyAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KK2ludCB6Q2NBcHBfUG9ydFNldChpbnQgZmRjb20sIFRfQ0NfQVBQX1BvcnRpbmZvICpwUG9ydGluZm8pDQorew0KKyAgICBzdHJ1Y3QgdGVybWlvcyAgdGVybWlvc19vbGQsIHRlcm1pb3NfbmV3Ow0KKyAgICBpbnQgICAgICAgICAgICAgYmF1ZHJhdGUsIHRtcDsNCisgICAgY2hhciAgICAgICAgICAgIGRhdGFiaXQsIHN0b3BiaXQsIHBhcml0eSwgZmN0bDsNCisgICAgYnplcm8oJnRlcm1pb3Nfb2xkLCBzaXplb2YodGVybWlvc19vbGQpKTsNCisgICAgYnplcm8oJnRlcm1pb3NfbmV3LCBzaXplb2YodGVybWlvc19uZXcpKTsNCisgICAgY2ZtYWtlcmF3KCZ0ZXJtaW9zX25ldyk7DQorICAgIHRjZ2V0YXR0cihmZGNvbSwgJnRlcm1pb3Nfb2xkKTsgICAgICAgICAvL2dldCB0aGUgc2VyaWFsIHBvcnQgYXR0cmlidXRpb25zDQorDQorICAgIC8qLS0tLS0tLS0tLS0tyejWw7bLv9rK9NDULS0tLS0tLS0tLS0tLS0tLSovDQorICAgIC8vYmF1ZHJhdGVzDQorICAgIGJhdWRyYXRlID0gY29udmJhdWQocFBvcnRpbmZvLT5iYXVkcmF0ZSk7DQorICAgIGNmc2V0aXNwZWVkKCZ0ZXJtaW9zX25ldywgYmF1ZHJhdGUpOyAgICAgICAgLy/M7sjrtK6/2srkyOu2y7KozNjCyg0KKyAgICBjZnNldG9zcGVlZCgmdGVybWlvc19uZXcsIGJhdWRyYXRlKTsgICAgICAgIC8vzO7I67Suv9rK5LP2tsuyqMzYwsoNCisgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDTE9DQUw7ICAgICAgICAgIC8vv9jWxsSjyr0sILGj1qSzzNDysru74bPJzqq2y7/atcTVvNPQ1d8NCisgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDUkVBRDsgICAgICAgICAgIC8vv9jWxsSjyr0sIMq5xNy2y7/atsHIocrkyOu1xMr9vt0NCisNCisgICAgLy8gv9jWxsSjyr0sIGZsb3cgY29udHJvbA0KKyAgICBmY3RsID0gcFBvcnRpbmZvLT5mY3RsOw0KKyAgICBzd2l0Y2ggKGZjdGwpDQorICAgIHsNCisgICAgICAgIGNhc2UgJzAnOg0KKyAgICAgICAgew0KKyAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgJj0gfkNSVFNDVFM7ICAgICAgICAvL25vIGZsb3cgY29udHJvbA0KKyAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgfQ0KKyAgICAgICAgY2FzZSAnMSc6DQorICAgICAgICB7DQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDUlRTQ1RTOyAgICAgICAgIC8vaGFyZHdhcmUgZmxvdyBjb250cm9sDQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorICAgICAgICBjYXNlICcyJzoNCisgICAgICAgIHsNCisgICAgICAgICAgICB0ZXJtaW9zX25ldy5jX2lmbGFnIHw9IElYT04gfCBJWE9GRiB8IElYQU5ZOyAgICAvL3NvZnR3YXJlIGZsb3cgY29udHJvbA0KKyAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZGVmYXVsdDoNCisgICAgICAgIHsNCisgICAgICAgICAgICAvL1pURV9MT0coTE9HX0VSUiwgIlVua25vd24gZmN0bCAlY1xuIiwgZmN0bCk7DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorICAgIH0NCisgICAgDQorICAgIC8vv9jWxsSjyr0sIGRhdGEgYml0cw0KKyAgICB0ZXJtaW9zX25ldy5jX2NmbGFnICY9IH5DU0laRTsgICAgICAvL7/Y1sbEo8q9LCDGwbHO19a3+7Tz0KHOuw0KKyAgICBkYXRhYml0ID0gcFBvcnRpbmZvLT5kYXRhYml0Ow0KKyAgICBzd2l0Y2ggKGRhdGFiaXQpDQorICAgIHsNCisgICAgICAgIGNhc2UgJzUnOg0KKyAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M1Ow0KKyAgICAgICAgICAgIC8vbGludCAtZmFsbHRocm91Z2gNCisgICAgICAgIGNhc2UgJzYnOg0KKyAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M2Ow0KKyAgICAgICAgICAgIC8vbGludCAtZmFsbHRocm91Z2gNCisgICAgICAgIGNhc2UgJzcnOg0KKyAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gQ1M3Ow0KKyAgICAgICAgICAgIC8vbGludCAtZmFsbHRocm91Z2gNCisgICAgICAgIGRlZmF1bHQ6DQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBDUzg7DQorICAgIH0NCisgICAgDQorICAgIC8vv9jWxsSjyr0gcGFyaXR5IGNoZWNrDQorICAgIHBhcml0eSA9IHBQb3J0aW5mby0+cGFyaXR5Ow0KKyAgICBzd2l0Y2ggKHBhcml0eSkNCisgICAgew0KKyAgICAgICAgY2FzZSAnMCc6DQorICAgICAgICB7DQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyAmPSB+UEFSRU5COyAgICAgLy9ubyBwYXJpdHkgY2hlY2sNCisgICAgICAgICAgICBicmVhazsNCisgICAgICAgIH0NCisgICAgICAgIGNhc2UgJzEnOg0KKyAgICAgICAgew0KKyAgICAgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgfD0gUEFSRU5COyAgICAgIC8vb2RkIGNoZWNrDQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyAmPSB+UEFST0REOw0KKyAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgfQ0KKyAgICAgICAgY2FzZSAnMic6DQorICAgICAgICB7DQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBQQVJFTkI7ICAgICAgLy9ldmVuIGNoZWNrDQorICAgICAgICAgICAgdGVybWlvc19uZXcuY19jZmxhZyB8PSBQQVJPREQ7DQorICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICB9DQorICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgew0KKyAgICAgICAgICAgLy9aVEVfTE9HKExPR19FUlIsICJVbmtub3duIHBhcml0eSAlY1xuIiwgcGFyaXR5KTsNCisgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgfQ0KKyAgICB9DQorICAgIA0KKyAgICAvL7/Y1sbEo8q9LCBzdG9wIGJpdHMNCisgICAgc3RvcGJpdCA9IHBQb3J0aW5mby0+c3RvcGJpdDsNCisgICAgaWYgKHN0b3BiaXQgPT0gJzInKQ0KKyAgICB7DQorICAgICAgICB0ZXJtaW9zX25ldy5jX2NmbGFnIHw9IENTVE9QQjsgIC8vMiBzdG9wIGJpdHMNCisgICAgfQ0KKyAgICBlbHNlDQorICAgIHsNCisgICAgICAgIHRlcm1pb3NfbmV3LmNfY2ZsYWcgJj0gfkNTVE9QQjsgLy8xIHN0b3AgYml0cw0KKyAgICB9DQorICAgIC8vb3RoZXIgYXR0cmlidXRpb25zIGRlZmF1bHQNCisgICAgdGVybWlvc19uZXcuY19vZmxhZyAmPSB+T1BPU1Q7ICAgICAgICAgIC8vyuSz9sSjyr0sINStyrzK/b7dyuSz9g0KKyAgICB0ZXJtaW9zX25ldy5jX2NjW1ZNSU5dID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