From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from inx.pm.waw.pl ([195.116.170.130]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PUoPd-0005Y7-No for barebox@lists.infradead.org; Mon, 20 Dec 2010 22:41:12 +0000 From: Krzysztof Halasa References: Date: Mon, 20 Dec 2010 23:40:44 +0100 In-Reply-To: (Krzysztof Halasa's message of "Mon, 20 Dec 2010 23:30:03 +0100") Message-ID: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1] Delete unused file common/dlmalloc.src. To: barebox@lists.infradead.org RGVsZXRlIHVudXNlZCBmaWxlIGNvbW1vbi9kbG1hbGxvYy5zcmMuCk9yIGlzIHRoZXJlIGFueSBy ZWFzb24gdG8gaGF2ZSBpdCBoZXJlPwoKU2lnbmVkLW9mZi1ieTogS3J6eXN6dG9mIEhhxYJhc2Eg PGtoY0BwbS53YXcucGw+CgpkaWZmIC0tZ2l0IGEvY29tbW9uL2RsbWFsbG9jLnNyYyBiL2NvbW1v bi9kbG1hbGxvYy5zcmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDMyYTM4YmMuLjAw MDAwMDAKLS0tIGEvY29tbW9uL2RsbWFsbG9jLnNyYworKysgL2Rldi9udWxsCkBAIC0xLDMyNjUg KzAsMCBAQAotLyogLS0tLS0tLS0tLSBUbyBtYWtlIGEgbWFsbG9jLmgsIHN0YXJ0IGN1dHRpbmcg aGVyZSAtLS0tLS0tLS0tLS0gKi8KLQotLyoKLSAgQSB2ZXJzaW9uIG9mIG1hbGxvYy9mcmVlL3Jl YWxsb2Mgd3JpdHRlbiBieSBEb3VnIExlYSBhbmQgcmVsZWFzZWQgdG8gdGhlCi0gIHB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9NRU1DUFkKLQotLyogVGhlIGZvbGxvd2luZyBtYWNyb3MgYXJl IG9ubHkgaW52b2tlZCB3aXRoICgybisxKS1tdWx0aXBsZXMgb2YKLSAgIElOVEVSTkFMX1NJWkVf VCB1bml0cywgd2l0aCBhIHBvc2l0aXZlIGludGVnZXIgbi4gVGhpcyBpcyBleHBsb2l0ZWQKLSAg IGZvciBmYXN0IGlubGluZSBleGVjdXRpb24gd2hlbiBuIGlzIHNtYWxsLiAqLwotCi0jZGVmaW5l IE1BTExPQ19aRVJPKGNoYXJwLCBuYnl0ZXMpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBcCi1kbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIElOVEVSTkFMX1NJWkVf VCBtenN6ID0gKG5ieXRlcyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCi0gIGlmKG16c3ogPD0gOSpzaXplb2YobXpzeikpIHsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgSU5URVJOQUxfU0laRV9UKiBteiA9 IChJTlRFUk5BTF9TSVpFX1QqKSAoY2hhcnApOyAgICAgICAgICAgICAgICAgICAgICAgICBcCi0g ICAgaWYobXpzeiA+PSA1KnNpemVvZihtenN6KSkgeyAgICAgKm16KysgPSAwOyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCi0JCQkJICAgICAqbXorKyA9IDA7ICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFwKLSAgICAgIGlmKG16c3ogPj0gNypzaXplb2YobXpzeikpIHsgICAq bXorKyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCQkgICAgICpteisr ID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCWlmKG16c3ogPj0gOSpzaXpl b2YobXpzeikpIHsgKm16KysgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0J CQkJICAgICAqbXorKyA9IDA7IH19fSAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQkJCQkg ICAgICpteisrID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSAgICAg Km16KysgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkJICAgICAqbXog ICA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgfSBlbHNlIG1lbXNldCgo Y2hhcnApLCAwLCBtenN6KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFwKLX0gd2hpbGUoMCkKLQotI2RlZmluZSBNQUxMT0NfQ09QWShkZXN0LHNyYyxuYnl0ZXMp ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotZG8geyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAotICBJTlRFUk5BTF9TSVpFX1QgbWNzeiA9IChuYnl0ZXMpOyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICBpZihtY3N6IDw9IDkqc2l6ZW9m KG1jc3opKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XAotICAgIElOVEVSTkFMX1NJWkVfVCogbWNzcmMgPSAoSU5URVJOQUxfU0laRV9UKikgKHNyYyk7 ICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIElOVEVSTkFMX1NJWkVfVCogbWNkc3QgPSAo SU5URVJOQUxfU0laRV9UKikgKGRlc3QpOyAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGlm KG1jc3ogPj0gNSpzaXplb2YobWNzeikpIHsgICAgICptY2RzdCsrID0gKm1jc3JjKys7ICAgICAg ICAgICAgICAgICAgICAgXAotCQkJCSAgICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgICAgICAgICAg ICAgICAgICAgICBcCi0gICAgICBpZihtY3N6ID49IDcqc2l6ZW9mKG1jc3opKSB7ICAgKm1jZHN0 KysgPSAqbWNzcmMrKzsgICAgICAgICAgICAgICAgICAgICBcCi0JCQkJICAgICAqbWNkc3QrKyA9 ICptY3NyYysrOyAgICAgICAgICAgICAgICAgICAgIFwKLQlpZihtY3N6ID49IDkqc2l6ZW9mKG1j c3opKSB7ICptY2RzdCsrID0gKm1jc3JjKys7ICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSAg ICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgfX19ICAgICAgICAgICAgICAgICBcCi0JCQkJICAgICAq bWNkc3QrKyA9ICptY3NyYysrOyAgICAgICAgICAgICAgICAgICAgIFwKLQkJCQkgICAgICptY2Rz dCsrID0gKm1jc3JjKys7ICAgICAgICAgICAgICAgICAgICAgXAotCQkJCSAgICAgKm1jZHN0ICAg PSAqbWNzcmMgIDsgICAgICAgICAgICAgICAgICAgICBcCi0gIH0gZWxzZSBtZW1jcHkoZGVzdCwg c3JjLCBtY3N6KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc Ci19IHdoaWxlKDApCi0KLSNlbHNlIC8qICFVU0VfTUVNQ1BZICovCi0KLS8qIFVzZSBEdWZmJ3Mg ZGV2aWNlIGZvciBnb29kIHplcm9pbmcvY29weWluZyBwZXJmb3JtYW5jZS4gKi8KLQotI2RlZmlu ZSBNQUxMT0NfWkVSTyhjaGFycCwgbmJ5dGVzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgXAotZG8geyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICBJTlRFUk5BTF9TSVpF X1QqIG16cCA9IChJTlRFUk5BTF9TSVpFX1QqKShjaGFycCk7ICAgICAgICAgICAgICAgICAgICAg ICAgICAgXAotICBsb25nIG1jdG1wID0gKG5ieXRlcykvc2l6ZW9mKElOVEVSTkFMX1NJWkVfVCks IG1jbjsgICAgICAgICAgICAgICAgICAgICAgICAgXAotICBpZiAobWN0bXAgPCA4KSBtY24gPSAw OyBlbHNlIHsgbWNuID0gKG1jdG1wLTEpLzg7IG1jdG1wICU9IDg7IH0gICAgICAgICAgICAgXAot ICBzd2l0Y2ggKG1jdG1wKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgXAotICAgIGNhc2UgMDogZm9yKDs7KSB7ICptenArKyA9IDA7 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGNhc2Ug NzogICAgICAgICAgICptenArKyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgXAotICAgIGNhc2UgNjogICAgICAgICAgICptenArKyA9IDA7ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGNhc2UgNTogICAgICAg ICAgICptenArKyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAotICAgIGNhc2UgNDogICAgICAgICAgICptenArKyA9IDA7ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGNhc2UgMzogICAgICAgICAgICptenAr KyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAg IGNhc2UgMjogICAgICAgICAgICptenArKyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAotICAgIGNhc2UgMTogICAgICAgICAgICptenArKyA9IDA7IGlm KG1jbiA8PSAwKSBicmVhazsgbWNuLS07IH0gICAgICAgICAgICAgICAgXAotICB9ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAotfSB3aGlsZSgwKQotCi0jZGVmaW5lIE1BTExPQ19DT1BZKGRlc3Qsc3JjLG5i eXRlcykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi1kbyB7ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBcCi0gIElOVEVSTkFMX1NJWkVfVCogbWNzcmMgPSAoSU5URVJOQUxfU0la RV9UKikgc3JjOyAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIElOVEVSTkFMX1NJWkVf VCogbWNkc3QgPSAoSU5URVJOQUxfU0laRV9UKikgZGVzdDsgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCi0gIGxvbmcgbWN0bXAgPSAobmJ5dGVzKS9zaXplb2YoSU5URVJOQUxfU0laRV9UKSwg bWNuOyAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIGlmIChtY3RtcCA8IDgpIG1jbiA9IDA7 IGVsc2UgeyBtY24gPSAobWN0bXAtMSkvODsgbWN0bXAgJT0gODsgfSAgICAgICAgICAgICBcCi0g IHN3aXRjaCAobWN0bXApIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCi0gICAgY2FzZSAwOiBmb3IoOzspIHsgKm1jZHN0KysgPSAq bWNzcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgY2FzZSA3 OiAgICAgICAgICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCi0gICAgY2FzZSA2OiAgICAgICAgICAgKm1jZHN0KysgPSAqbWNzcmMrKzsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgY2FzZSA1OiAgICAgICAg ICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCi0gICAgY2FzZSA0OiAgICAgICAgICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgY2FzZSAzOiAgICAgICAgICAgKm1jZHN0 KysgPSAqbWNzcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAg Y2FzZSAyOiAgICAgICAgICAgKm1jZHN0KysgPSAqbWNzcmMrKzsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcCi0gICAgY2FzZSAxOiAgICAgICAgICAgKm1jZHN0KysgPSAqbWNz cmMrKzsgaWYobWNuIDw9IDApIGJyZWFrOyBtY24tLTsgfSAgICAgICBcCi0gIH0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCi19IHdoaWxlKDApCi0KLSNlbmRpZgotCi0KLS8qCi0gIERlZmluZSBIQVZFX01N QVAgdG8gb3B0aW9uYWxseSBtYWtlIG1hbGxvYygpIHVzZSBtbWFwKCkgdG8KLSAgYWxsb2NhdGUg dmVyeSBsYXJnZSBibG9ja3MuICBUaGVzZSB3aWxsIGJlIHJldHVybmVkIHRvIHRoZQotICBvcGVy YXRpbmcgc3lzdGVtIGltbWVkaWF0ZWx5IGFmdGVyIGEgZnJlZSgpLgotKi8KLQotI2lmbmRlZiBI QVZFX01NQVAKLSNkZWZpbmUgSEFWRV9NTUFQIDEKLSNlbmRpZgotCi0vKgotICBEZWZpbmUgSEFW RV9NUkVNQVAgdG8gbWFrZSByZWFsbG9jKCkgdXNlIG1yZW1hcCgpIHRvIHJlLWFsbG9jYXRlCi0g IGxhcmdlIGJsb2Nrcy4gIFRoaXMgaXMgY3VycmV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UGF1bAotICAgIFdpbHNv biBmdHA6Ly9mdHAuY3MudXRleGFzLmVkdS9wdWIvZ2FyYmFnZS9hbGxvY3Nydi5wcyBmb3IgYQot ICAgIHN1cnZleSBvZiBzdWNoIHRlY2huaXF1ZXMuKSAgU2l6ZXMgb2YgZnJlZSBjaHVua3MgYXJl IHN0b3JlZCBib3RoCi0gICAgaW4gdGhlIGZyb250IG9mIGVhY2ggY2h1bmsgYW5kIGF0IHRoZSBl bmQuICBUaGlzIG1ha2VzCi0gICAgY29uc29saWRhdGluZyBmcmFnbWVudGVkIGNodW5rcyBpbnRv IGJpZ2dlciBjaHVua3MgdmVyeSBmYXN0LiAgVGhlCi0gICAgc2l6ZSBmaWVsZHMgYWxzbyBob2xk IGJpdHMgcmVwcmVzZW50aW5nIHdoZXRoZXIgY2h1bmtzIGFyZSBmcmVlIG9yCi0gICAgaW4gdXNl LgotCi0gICAgQW4gYWxsb2NhdGVkIGNodW5rIGxvb2tzIGxpa2UgdGhpczoKLQotCi0gICAgY2h1 bmstPiArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKwotCSAgICB8ICAgICAgICAgICAgIFNpemUgb2YgcHJldmlvdXMgY2h1bmss IGlmIGFsbG9jYXRlZCAgICAgICAgICAgIHwgfAotCSAgICArLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKwotCSAgICB8ICAgICAg ICAgICAgIFNpemUgb2YgY2h1bmssIGluIGJ5dGVzICAgICAgICAgICAgICAgICAgICAgICAgIHxQ fAotICAgICAgbWVtLT4gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSsKLQkgICAgfCAgICAgICAgICAgICBVc2VyIGRhdGEgc3Rh cnRzIGhlcmUuLi4gICAgICAgICAgICAgICAgICAgICAgICAgIC4KLQkgICAgLiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4KLQkg ICAgLiAgICAgICAgICAgICAobWFsbG9jX3VzYWJsZV9zcGFjZSgpIGJ5dGVzKSAgICAgICAgICAg ICAgICAgICAgIC4KLQkgICAgLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHwKLW5leHRjaHVuay0+ICstKy0rLSstKy0rLSstKy0r LSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCi0JICAgIHwg ICAgICAgICAgICAgU2l6ZSBvZiBjaHVuayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB8Ci0JICAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rCi0KLQotICAgIFdoZXJlICJjaHVuayIgaXMgdGhlIGZyb250 IG9mIHRoZSBjaHVuayBmb3IgdGhlIHB1cnBvc2Ugb2YgbW9zdCBvZgotICAgIHRoZSBtYWxsb2Mg Y29kZSwgYnV0ICJtZW0iIGlzIHRoZSBwb2ludGVyIHRoYXQgaXMgcmV0dXJuZWQgdG8gdGhlCi0g ICAgdXNlci4gICJOZXh0Y2h1bmsiIGlzIHRoZSBiZWdpbm5pbmcgb2YgdGhlIG5leHQgY29udGln dW91cyBjaHVuay4KLQotICAgIENodW5rcyBhbHdheXMgYmVnaW4gb24gZXZlbiB3b3JkIGJvdW5k cmllcywgc28gdGhlIG1lbSBwb3J0aW9uCi0gICAgKHdoaWNoIGlzIHJldHVybmVkIHRvIHRoZSB1 c2VyKSBpcyBhbHNvIG9uIGFuIGV2ZW4gd29yZCBib3VuZGFyeSwgYW5kCi0gICAgdGh1cyBkb3Vi bGUtd29yZCBhbGlnbmVkLgotCi0gICAgRnJlZSBjaHVua3MgYXJlIHN0b3JlZCBpbiBjaXJjdWxh ciBkb3VibHktbGlua2VkIGxpc3RzLCBhbmQgbG9vayBsaWtlIHRoaXM6Ci0KLSAgICBjaHVuay0+ ICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rCi0JICAgIHwgICAgICAgICAgICAgU2l6ZSBvZiBwcmV2aW91cyBjaHVuayAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8Ci0JICAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCi0gICAgYGhlYWQ6JyB8ICAg ICAgICAgICAgIFNpemUgb2YgY2h1bmssIGluIGJ5dGVzICAgICAgICAgICAgICAgICAgICAgICAg IHxQfAotICAgICAgbWVtLT4gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0r LSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKLQkgICAgfCAgICAgICAgICAgICBGb3J3YXJkIHBv aW50ZXIgdG8gbmV4dCBjaHVuayBpbiBsaXN0ICAgICAgICAgICAgIHwKLQkgICAgKy0rLSstKy0r LSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsK LQkgICAgfCAgICAgICAgICAgICBCYWNrIHBvaW50ZXIgdG8gcHJldmlvdXMgY2h1bmsgaW4gbGlz dCAgICAgICAgICAgIHwKLQkgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKLQkgICAgfCAgICAgICAgICAgICBVbnVzZWQg c3BhY2UgKG1heSBiZSAwIGJ5dGVzIGxvbmcpICAgICAgICAgICAgICAgIC4KLQkgICAgLiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC4KLQkgICAgLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHwKLW5leHRjaHVuay0+ICstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCi0gICAgYGZvb3Q6JyB8ICAg ICAgICAgICAgIFNpemUgb2YgY2h1bmssIGluIGJ5dGVzICAgICAgICAgICAgICAgICAgICAgICAg ICAgfAotCSAgICArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKwotCi0gICAgVGhlIFAgKFBSRVZfSU5VU0UpIGJpdCwgc3RvcmVk IGluIHRoZSB1bnVzZWQgbG93LW9yZGVyIGJpdCBvZiB0aGUKLSAgICBjaHVuayBzaXplICh3aGlj aCBpcyBhbHdheXMgYSBtdWx0aXBsZSBvZiB0d28gd29yZHMpLCBpcyBhbiBpbi11c2UKLSAgICBi aXQgZm9yIHRoZSAqcHJldmlvdXMqIGNodW5rLiAgSWYgdGhhdCBiaXQgaXMgKmNsZWFyKiwgdGhl biB0aGUKLSAgICB3b3JkIGJlZm9yZSB0aGUgY3VycmVudCBjaHVuayBzaXplIGNvbnRhaW5zIHRo ZSBwcmV2aW91cyBjaHVuawotICAgIHNpemUsIGFuZCBjYW4gYmUgdXNlZCB0byBmaW5kIHRoZSBm cm9udCBvZiB0aGUgcHJldmlvdXMgY2h1bmsuCi0gICAgKFRoZSB2ZXJ5IGZpcnN0IGNodW5rIGFs bG9jYXRlZCBhbHdheXMgaGFzIHRoaXMgYml0IHNldCwKLSAgICBwcmV2ZW50aW5nIGFjY2VzcyB0 byBub24tZXhpc3RlbnQgKG9yIG5vbi1vd25lZCkgbWVtb3J5LikKLQotICAgIE5vdGUgdGhhdCB0 aGUgYGZvb3QnIG9mIHRoZSBjdXJyZW50IGNodW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QotCi0vKiBQdHIg dG8gbmV4dCBwaHlzaWNhbCBtYWxsb2NfY2h1bmsuICovCi0KLSNkZWZpbmUgbmV4dF9jaHVuayhw KSAoKG1jaHVua3B0cikoICgoY2hhciopKHApKSArICgocCktPnNpemUgJiB+UFJFVl9JTlVTRSkg KSkKLQotLyogUHRyIHRvIHByZXZpb3VzIHBoeXNpY2FsIG1hbGxvY19jaHVuayAqLwotCi0jZGVm aW5lIHByZXZfY2h1bmsocClcCi0gICAoKG1jaHVua3B0cikoICgoY2hhciopKHApKSAtICgocCkt PnByZXZfc2l6ZSkgKSkKLQotCi0vKiBUcmVhdCBzcGFjZSBhdCBwdHIgKyBvZmZzZXQgYXMgYSBj aHVuayAqLwotCi0jZGVmaW5lIGNodW5rX2F0X29mZnNldChwLCBzKSAgKChtY2h1bmtwdHIpKCgo Y2hhciopKHApKSArIChzKSkpCi0KLQotDAotCi0vKgotICBEZWFsaW5nIHdpdGggdXNlIGJpdHMK LSovCi0KLS8qIGV4dHJhY3QgcCdzIGludXNlIGJpdCAqLwotCi0jZGVmaW5lIGludXNlKHApXAot KCgoKG1jaHVua3B0cikoKChjaGFyKikocCkpKygocCktPnNpemUgJiB+UFJFVl9JTlVTRSkpKS0+ c2l6ZSkgJiBQUkVWX0lOVVNFKQotCi0vKiBleHRyYWN0IGludXNlIGJpdCBvZiBwcmV2aW91cyBj aHVuayAqLwotCi0jZGVmaW5lIHByZXZfaW51c2UocCkgICgocCktPnNpemUgJiBQUkVWX0lOVVNF KQotCi0vKiBjaGVjayBmb3IgbW1hcCgpJ2VkIGNodW5rICovCi0KLSNkZWZpbmUgY2h1bmtfaXNf bW1hcHBlZChwKSAoKHApLT5zaXplICYgSVNfTU1BUFBFRCkKLQotLyogc2V0L2NsZWFyIGNodW5r IGFzIGluIHVzZSB3aXRob3V0IG90aGVyd2lzZSBkaXN0dXJiaW5nICovCi0KLSNkZWZpbmUgc2V0 X2ludXNlKHApXAotKChtY2h1bmtwdHIpKCgoY2hhciopKHApKSArICgocCktPnNpemUgJiB+UFJF Vl9JTlVTRSkpKS0+c2l6ZSB8PSBQUkVWX0lOVVNFCi0KLSNkZWZpbmUgY2xlYXJfaW51c2UocClc Ci0oKG1jaHVua3B0cikoKChjaGFyKikocCkpICsgKChwKS0+c2l6ZSAmIH5QUkVWX0lOVVNFKSkp LT5zaXplICY9IH4oUFJFVl9JTlVTRSkKLQotLyogY2hlY2svc2V0L2NsZWFyIGludXNlIGJpdHMg aW4ga25vd24gcGxhY2VzICovCi0KLSNkZWZpbmUgaW51c2VfYml0X2F0X29mZnNldChwLCBzKVwK LSAoKChtY2h1bmtwdHIpKCgoY2hhciopKHApKSArIChzKSkpLT5zaXplICYgUFJFVl9JTlVTRSkK LQotI2RlZmluZSBzZXRfaW51c2VfYml0X2F0X29mZnNldChwLCBzKVwKLSAoKChtY2h1bmtwdHIp KCgoY2hhciopKHApKSArIChzKSkpLT5zaXplIHw9IFBSRVZfSU5VU0UpCi0KLSNkZWZpbmUgY2xl YXJfaW51c2VfYml0X2F0X29mZnNldChwLCBzKVwKLSAoKChtY2h1bmtwdHIpKCgoY2hhciopKHAp KSArIChzKSkpLT5zaXplICY9IH4oUFJFVl9JTlVTRSkpCi0KLQotDAotCi0vKgotICBEZWFsaW5n IHdpdGggc2l6ZSBmaWVsZHMKLSovCi0KLS8qIEdldCBzaXplLCBpZ25vcmluZyB1c2UgYml0cyAq LwotCi0jZGVmaW5lIGNodW5rc2l6ZShwKSAgICAgICAgICAoKHApLT5zaXplICYgfihTSVpFX0JJ VFMpKQotCi0vKiBTZXQgc2l6ZSBhdCBoZWFkLCB3aXRob3V0IGRpc3R1cmJpbmcgaXRzIHVzZSBi aXQgKi8KLQotI2RlZmluZSBzZXRfaGVhZF9zaXplKHAsIHMpICAgKChwKS0+c2l6ZSA9ICgoKHAp LT5zaXplICYgUFJFVl9JTlVTRSkgfCAocykpKQotCi0vKiBTZXQgc2l6ZS91c2UgaWdub3Jpbmcg cHJldmlvdXMgYml0cyBp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aHVu a3B0cikoYmluX2F0KDApKSkKLQotLyogSGVscGVyIG1hY3JvIHRvIGluaXRpYWxpemUgYmlucyAq LwotCi0jZGVmaW5lIElBVihpKSAgYmluX2F0KGkpLCBiaW5fYXQoaSkKLQotc3RhdGljIG1iaW5w dHIgYXZfW05BViAqIDIgKyAyXSA9IHsKLSAwLCAwLAotIElBVigwKSwgICBJQVYoMSksICAgSUFW KDIpLCAgIElBVigzKSwgICBJQVYoNCksICAgSUFWKDUpLCAgIElBVig2KSwgICBJQVYoNyksCi0g SUFWKDgpLCAgIElBVig5KSwgICBJQVYoMTApLCAgSUFWKDExKSwgIElBVigxMiksICBJQVYoMTMp LCAgSUFWKDE0KSwgIElBVigxNSksCi0gSUFWKDE2KSwgIElBVigxNyksICBJQVYoMTgpLCAgSUFW KDE5KSwgIElBVigyMCksICBJQVYoMjEpLCAgSUFWKDIyKSwgIElBVigyMyksCi0gSUFWKDI0KSwg IElBVigyNSksICBJQVYoMjYpLCAgSUFWKDI3KSwgIElBVigyOCksICBJQVYoMjkpLCAgSUFWKDMw KSwgIElBVigzMSksCi0gSUFWKDMyKSwgIElBVigzMyksICBJQVYoMzQpLCAgSUFWKDM1KSwgIElB VigzNiksICBJQVYoMzcpLCAgSUFWKDM4KSwgIElBVigzOSksCi0gSUFWKDQwKSwgIElBVig0MSks ICBJQVYoNDIpLCAgSUFWKDQzKSwgIElBVig0NCksICBJQVYoNDUpLCAgSUFWKDQ2KSwgIElBVig0 NyksCi0gSUFWKDQ4KSwgIElBVig0OSksICBJQVYoNTApLCAgSUFWKDUxKSwgIElBVig1MiksICBJ QVYoNTMpLCAgSUFWKDU0KSwgIElBVig1NSksCi0gSUFWKDU2KSwgIElBVig1NyksICBJQVYoNTgp LCAgSUFWKDU5KSwgIElBVig2MCksICBJQVYoNjEpLCAgSUFWKDYyKSwgIElBVig2MyksCi0gSUFW KDY0KSwgIElBVig2NSksICBJQVYoNjYpLCAgSUFWKDY3KSwgIElBVig2OCksICBJQVYoNjkpLCAg SUFWKDcwKSwgIElBVig3MSksCi0gSUFWKDcyKSwgIElBVig3MyksICBJQVYoNzQpLCAgSUFWKDc1 KSwgIElBVig3NiksICBJQVYoNzcpLCAgSUFWKDc4KSwgIElBVig3OSksCi0gSUFWKDgwKSwgIElB Vig4MSksICBJQVYoODIpLCAgSUFWKDgzKSwgIElBVig4NCksICBJQVYoODUpLCAgSUFWKDg2KSwg IElBVig4NyksCi0gSUFWKDg4KSwgIElBVig4OSksICBJQVYoOTApLCAgSUFWKDkxKSwgIElBVig5 MiksICBJQVYoOTMpLCAgSUFWKDk0KSwgIElBVig5NSksCi0gSUFWKDk2KSwgIElBVig5NyksICBJ QVYoOTgpLCAgSUFWKDk5KSwgIElBVigxMDApLCBJQVYoMTAxKSwgSUFWKDEwMiksIElBVigxMDMp LAotIElBVigxMDQpLCBJQVYoMTA1KSwgSUFWKDEwNiksIElBVigxMDcpLCBJQVYoMTA4KSwgSUFW KDEwOSksIElBVigxMTApLCBJQVYoMTExKSwKLSBJQVYoMTEyKSwgSUFWKDExMyksIElBVigxMTQp LCBJQVYoMTE1KSwgSUFWKDExNiksIElBVigxMTcpLCBJQVYoMTE4KSwgSUFWKDExOSksCi0gSUFW KDEyMCksIElBVigxMjEpLCBJQVYoMTIyKSwgSUFWKDEyMyksIElBVigxMjQpLCBJQVYoMTI1KSwg SUFWKDEyNiksIElBVigxMjcpCi19OwotCi0MCi0KLS8qIGZpZWxkLWV4dHJhY3Rpb24gbWFjcm9z ICovCi0KLSNkZWZpbmUgZmlyc3QoYikgKChiKS0+ZmQpCi0jZGVmaW5lIGxhc3QoYikgICgoYikt PmJrKQotCi0vKgotICBJbmRleGluZyBpbnRvIGJpbnMKLSovCi0KLSNkZWZpbmUgYmluX2luZGV4 KHN6KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCi0oKCgoKHVuc2lnbmVkIGxvbmcpKHN6KSkgPj4gOSkgPT0gICAgMC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gICAg ICAgICAgICAgICAgICAgICAgICBcCi17ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIGlmIChTIDwg TUFYX1NNQUxMQklOX1NJWkUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCi0gIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgSURYID0gc21hbGxiaW5f aW5kZXgoUyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCi0gICAgbWFya19iaW5ibG9jayhJRFgpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgQksgPSBiaW5fYXQoSURYKTsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAg RkQgPSBCSy0+ZmQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcCi0gICAgUC0+YmsgPSBCSzsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgUC0+ZmQgPSBG RDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCi0gICAgRkQtPmJrID0gQkstPmZkID0gUDsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIH0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc Ci0gIGVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBcCi0gIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgSURY ID0gYmluX2luZGV4KFMpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBcCi0gICAgQksgPSBiaW5fYXQoSURYKTsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgRkQgPSBCSy0+ZmQ7 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCi0gICAgaWYgKEZEID09IEJLKSBtYXJrX2JpbmJsb2NrKElEWCk7ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgZWxzZSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0g ICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCi0gICAgICB3aGlsZSAoRkQgIT0gQksgJiYgUyA8IGNodW5r c2l6ZShGRCkpIEZEID0gRkQtPmZkOyAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICBCSyA9 IEZELT5iazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCi0gICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgUC0+YmsgPSBCSzsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCi0gICAgUC0+ZmQgPSBGRDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgRkQtPmJrID0gQkstPmZkID0gUDsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIH0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcCi19Ci0KLQotLyogdGFrZSBhIGNodW5rIG9mZiBhIGxpc3QgKi8K LQotI2RlZmluZSB1bmxpbmsoUCwgQkssIEZEKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgXAoteyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICBCSyA9 IFAtPmJrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgXAotICBGRCA9IFAtPmZkOyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICBGRC0+YmsgPSBCSzsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgXAotICBCSy0+ZmQgPSBGRDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotfSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAot Ci0vKiBQbGFjZSBwIGFzIHRoZSBsYXN0IHJlbWFpbmRlciAqLwotCi0jZGVmaW5lIGxpbmtfbGFz dF9yZW1haW5kZXIoUCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCi17ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gIGxhc3RfcmVtYWluZGVyLT5mZCA9IGxh c3RfcmVtYWluZGVyLT5iayA9ICBQOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0g IFAtPmZkID0gUC0+YmsgPSBsYXN0X3JlbWFpbmRlcjsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCi19Ci0KLS8qIENsZWFyIHRoZSBsYXN0X3JlbWFpbmRlciBi aW4gKi8KLQotI2RlZmluZSBjbGVhcl9sYXN0X3JlbWFpbmRlciBcCi0gIChsYXN0X3JlbWFpbmRl ci0+ZmQgPSBsYXN0X3JlbWFpbmRlci0+YmsgPSBsYXN0X3JlbWFpbmRlcikKLQotCi0MCi0KLQot LyogUm91dGluZXMgZGVhbGluZyB3aXRoIG1tYXAoKS4gKi8KLQotI2lmIEhBVkVfTU1BUAotCi0j aWYgX19TVERfQwotc3RhdGljIG1jaHVua3B0ciBtbWFwX2NodW5rKHNpemVfdCBzaXplKQotI2Vs c2UKLXN0YXRpYyBtY2h1bmtwdHIgbW1hcF9jaHVuayhzaXplKSBzaXplX3Qgc2l6ZTsKLSNlbmRp ZgotewotICBzaXplX3QgcGFnZV9tYXNrID0gbWFsbG9jX2dldHBhZ2VzaXplIC0gMTsKLSAgbWNo dW5rcHRyIHA7Ci0KLSNpZm5kZWYgTUFQX0FOT05ZTU9VUwotICBzdGF0aWMgaW50IGZkID0gLTE7 Ci0jZW5kaWYKLQotICBpZihuX21tYXBzID49IG5fbW1hcHNfbWF4KSByZXR1cm4gMDsgLyogdG9v IG1hbnkgcmVnaW9ucyAqLwotCi0gIC8qIEZvciBtbWFwcGVkIGNodW5rcywgdGhlIG92ZXJoZWFk IGlzIG9uZSBTSVpFX1NaIHVuaXQgbGFyZ2VyLCBiZWNhd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uYS4pCi0KLSovCi0KLSNpZiBfX1NURF9DCi1Wb2lkX3QqIG1BTExPYyhzaXplX3QgYnl0 ZXMpCi0jZWxzZQotVm9pZF90KiBtQUxMT2MoYnl0ZXMpIHNpemVfdCBieXRlczsKLSNlbmRpZgot ewotICBtY2h1bmtwdHIgdmljdGltOyAgICAgICAgICAgICAgICAgIC8qIGluc3BlY3RlZC9zZWxl Y3RlZCBjaHVuayAqLwotICBJTlRFUk5BTF9TSVpFX1QgdmljdGltX3NpemU7ICAgICAgIC8qIGl0 cyBzaXplICovCi0gIGludCAgICAgICBpZHg7ICAgICAgICAgICAgICAgICAgICAgLyogaW5kZXgg Zm9yIGJpbiB0cmF2ZXJzYWwgKi8KLSAgbWJpbnB0ciAgIGJpbjsgICAgICAgICAgICAgICAgICAg ICAvKiBhc3NvY2lhdGVkIGJpbiAqLwotICBtY2h1bmtwdHIgcmVtYWluZGVyOyAgICAgICAgICAg ICAgIC8qIHJlbWFpbmRlciBmcm9tIGEgc3BsaXQgKi8KLSAgbG9uZyAgICAgIHJlbWFpbmRlcl9z aXplOyAgICAgICAgICAvKiBpdHMgc2l6ZSAqLwotICBpbnQgICAgICAgcmVtYWluZGVyX2luZGV4 OyAgICAgICAgIC8qIGl0cyBiaW4gaW5kZXggKi8KLSAgdW5zaWduZWQgbG9uZyBibG9jazsgICAg ICAgICAgICAgICAvKiBibG9jayB0cmF2ZXJzZXIgYml0ICovCi0gIGludCAgICAgICBzdGFydGlk eDsgICAgICAgICAgICAgICAgLyogZmlyc3QgYmluIG9mIGEgdHJhdmVyc2VkIGJsb2NrICovCi0g IG1jaHVua3B0ciBmd2Q7ICAgICAgICAgICAgICAgICAgICAgLyogbWlzYyB0ZW1wIGZvciBsaW5r aW5nICovCi0gIG1jaHVua3B0ciBiY2s7ICAgICAgICAgICAgICAgICAgICAgLyogbWlzYyB0ZW1w IGZvciBsaW5raW5nICovCi0gIG1iaW5wdHIgcTsgICAgICAgICAgICAgICAgICAgICAgICAgLyog bW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W4gYmVsb3cuIFdlJ3ZlIGFscmVhZHkg c2Nhbm5lZCAyIGJpbnMuICovCi0KLSAgfQotICBlbHNlCi0gIHsKLSAgICBpZHggPSBiaW5faW5k ZXgobmIpOwotICAgIGJpbiA9IGJpbl9hdChpZHgpOwotCi0gICAgZm9yICh2aWN0aW0gPSBsYXN0 KGJpbik7IHZpY3RpbSAhPSBiaW47IHZpY3RpbSA9IHZpY3RpbS0+YmspCi0gICAgewotICAgICAg dmljdGltX3NpemUgPSBjaHVua3NpemUodmljdGltKTsKLSAgICAgIHJlbWFpbmRlcl9zaXplID0g dmljdGltX3NpemUgLSBuYjsKLQotICAgICAgaWYgKHJlbWFpbmRlcl9zaXplID49IChsb25nKU1J TlNJWkUpIC8qIHRvbyBiaWcgKi8KLSAgICAgIHsKLQktLWlkeDsgLyogYWRqdXN0IHRvIHJlc2Nh biBiZWxvdyBhZnRlciBjaGVja2luZyBsYXN0IHJlbWFpbmRlciAqLwotCWJyZWFrOwotICAgICAg fQotCi0gICAgICBlbHNlIGlmIChyZW1haW5kZXJfc2l6ZSA+PSAwKSAvKiBleGFjdCBmaXQgKi8K LSAgICAgIHsKLQl1bmxpbmsodmljdGltLCBiY2ssIGZ3ZCk7Ci0Jc2V0X2ludXNlX2JpdF9hdF9v ZmZzZXQodmljdGltLCB2aWN0aW1fc2l6ZSk7Ci0JY2hlY2tfbWFsbG9jZWRfY2h1bmsodmljdGlt LCBuYik7Ci0JcmV0dXJuIGNodW5rMm1lbSh2aWN0aW0pOwotICAgICAgfQotICAgIH0KLQotICAg ICsraWR4OwotCi0gIH0KLQotICAvKiBUcnkgdG8gdXNlIHRoZSBsYXN0IHNwbGl0LW9mZiByZW1h aW5kZXIgKi8KLQotICBpZiAoICh2aWN0aW0gPSBsYXN0X3JlbWFpbmRlci0+ZmQpICE9IGxhc3Rf cmVtYWluZGVyKQotICB7Ci0gICAgdmljdGltX3NpemUgPSBjaHVua3NpemUodmljdGltKTsKLSAg ICByZW1haW5kZXJfc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ZW0yY2h1bmsobWVtKTsKLSAgaGQgPSBwLT5zaXplOwotCi0jaWYgSEFWRV9NTUFQ Ci0gIGlmIChoZCAmIElTX01NQVBQRUQpICAgICAgICAgICAgICAgICAgICAgICAvKiByZWxlYXNl IG1tYXBwZWQgbWVtb3J5LiAqLwotICB7Ci0gICAgbXVubWFwX2NodW5rKHApOwotICAgIHJldHVy bjsKLSAgfQotI2VuZGlmCi0KLSAgY2hlY2tfaW51c2VfY2h1bmsocCk7Ci0KLSAgc3ogPSBoZCAm IH5QUkVWX0lOVVNFOwotICBuZXh0ID0gY2h1bmtfYXRfb2Zmc2V0KHAsIHN6KTsKLSAgbmV4dHN6 ID0gY2h1bmtzaXplKG5leHQpOwotCi0gIGlmIChuZXh0ID09IHRvcCkgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLyogbWVyZ2Ugd2l0aCB0b3AgKi8KLSAgewotICAgIHN6ICs9IG5leHRzejsK LQotICAgIGlmICghKGhkICYgUFJFVl9JTlVTRSkpICAgICAgICAgICAgICAgICAgICAvKiBjb25z b2xpZGF0ZSBiYWNrd2FyZCAqLwotICAgIHsKLSAgICAgIHByZXZzeiA9IHAtPnByZXZfc2l6ZTsK LSAgICAgIHAgPSBjaHVua19hdF9vZmZzZXQocCwgLSgobG9uZykgcHJldnN6KSk7Ci0gICAgICBz eiArPSBwcmV2c3o7Ci0gICAgICB1bmxpbmsocCwgYmNrLCBmd2QpOwotICAgIH0KLQotICAgIHNl dF9oZWFkKHAsIHN6IHwgUFJFVl9JTlVTRSk7Ci0gICAgdG9wID0gcDsKLSAgICBpZiAoKHVuc2ln bmVkIGxvbmcpKHN6KSA+PSAodW5zaWduZWQgbG9uZyl0cmltX3RocmVzaG9sZCkKLSAgICAgIG1h bGxvY190cmltKHRvcF9wYWQpOwotICAgIHJldHVybjsKLSAgfQotCi0gIHNldF9oZWFkKG5leHQs IG5leHRzeik7ICAgICAgICAgICAgICAgICAgICAvKiBjbGVhciBpbnVzZSBiaXQgKi8KLQotICBp c2xyID0gMDsKLQotICBpZiAoIShoZCAmIFBSRVZfSU5VU0UpKSAgICAgICAgICAgICAgICAgICAg LyogY29uc29saWRhdGUgYmFja3dhcmQgKi8KLSAgewotICAgIHByZXZzeiA9IHAtPnByZXZfc2l6 ZTsKLSAgICBwID0gY2h1bmtfYXRfb2Zmc2V0KHAsIC0oKGxvbmcpIHByZXZzeikpOwotICAgIHN6 ICs9IHByZXZzejsKLQotICAgIGlmIChwLT5mZCA9PSBsYXN0X3JlbWFpbmRlcikgICAgICAgICAg ICAgLyoga2VlcCBhcyBsYXN0X3JlbWFpbmRlciAqLwotICAgICAgaXNsciA9IDE7Ci0gICAgZWxz ZQotICAgICAgdW5saW5rKHAsIGJjaywgZndkKTsKLSAgfQotCi0gIGlmICghKGludXNlX2JpdF9h dF9vZmZzZXQobmV4dCwgbmV4dHN6KSkpICAgLyogY29uc29saWRhdGUgZm9yd2FyZCAqLwotICB7 Ci0gICAgc3ogKz0gbmV4dHN6OwotCi0gICAgaWYgKCFpc2xyICYmIG5leHQtPmZkID09IGxhc3Rf cmVtYWluZGVyKSAgLyogcmUtaW5zZXJ0IGxhc3RfcmVtYWluZGVyICovCi0gICAgewotICAgICAg aXNsciA9IDE7Ci0gICAgICBsaW5rX2xhc3RfcmVtYWluZGVyKHApOwotICAgIH0KLSAgICBlbHNl Ci0gICAgICB1bmxpbmsobmV4dCwgYmNrLCBmd2QpOwotICB9Ci0KLQotICBzZXRfaGVhZChwLCBz eiB8IFBSRVZfSU5VU0UpOwotICBzZXRfZm9vdChwLCBzeik7Ci0gIGlmICghaXNscikKLSAgICBm cm9udGxpbmsocCwgc3osIGlkeCwgYmNrLCBmd2QpOwotfQotCi0KLQwKLQotCi0vKgotCi0gIFJl YWxsb2MgYWxnb3JpdGhtOgotCi0gICAgQ2h1bmtzIHRoYXQgd2VyZSBvYnRhaW5lZCB2aWEgbW1h cCBjYW5ub3QgYmUgZXh0ZW5kZWQgb3Igc2hydW5rCi0gICAgdW5sZ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