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orCWxkcglyMiwgW3IxXQorCWNtcAlyMiwgcjAJCUAgbm8gZGF0YSwgbm8gcHJvYmxlbQorCWJlcQkyZgorCXRzdAlyMiwgIzMJCUAgdW5hbGlnbmVkIHNpemUKKwlibmUJMmYKKwlsZHIJcjMsIFxzaXplCisJY21wCXIyLCByMwkJQCBib2d1cyBzaXplCisJYmhpCTJmCisJYWRkCXIxLCByMSwgIzQKKwlkb19jcmMzMgorCWxkcglyMSwgW3IxXQorMjoKKwljbXAJcjAsIHIxCisJLmVuZG0KKworCS5tYWNybyB3YWl0LCByZWcKKwltb3YJXHJlZywgIzB4MTAwMAorMzoKKwlzdWJzCVxyZWcsIFxyZWcsICMweDEKKwlibmUgCTNiCisKKwkuZW5kbQorLnRleHQKKy5nbG9ibCBjcmNlaworY3JjZWs6CisJYgljcmMyX2JhZAorCW1vdglyNiwgIzAKKwljcmN1aglfTE9BREVSMV9PRkZTRVQsIF9MT0FERVJfU0laRQorCWJuZQljcmMxX2JhZAorCW9ycglyNiwgcjYsICMxCitjcmMxX2JhZDoKKwljcmN1aglfTE9BREVSMl9PRkZTRVQsIF9MT0FERVJfU0laRQorCWJuZQljcmMyX2JhZAorCW9ycglyNiwgcjYsICMyCitjcmMyX2JhZDoKKwlsZHIJcjMsIF9MT0FERVIxX09GRlNFVAorCWxkcglyNCwgX0xPQURFUjJfT0ZGU0VUCisJYglib290XzJuZAorCXRzdAlyNiwgIzMKKwliZXEJb25lX2lzX2JhZAlAIG9uZSBvZiB0aGVtIChvciBib3RoKSBoYXMgYmFkIGNyYworCWxkcglyMSwgW3IzLCAjNF0KKwlsZHIJcjIsIFtyNCwgIzRdCisJY21wCXIxLCByMgkJQCBib290IDJuZCBsb2FkZXIgaWYgdmVyc2lvbnMgZGlmZmVyCisJYmVxCWJvb3RfMXN0CisJYglib290XzJuZAorb25lX2lzX2JhZDoKKwl0c3QJcjYsICMxCisJYm5lCWJvb3RfMXN0CisJdHN0CXI2LCAjMgorCWJuZQlib290XzJuZAorQ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FuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQljbnRyIC09IDE2OworCQl9CisKKwkJd2hpbGUgKGNudHIgPiAwKSB7CisJCQkqZGF0YV9idWYrKyA9IFJFQURfTkFORCAobmFuZHB0cik7CisJCQljbnRyLS07CisJCX0KKwl9Cit9CisKKy8qCisgKiBOQU5EIHJlYWQgd2l0aCBFQ0MKKyAqLworc3RhdGljIGludCBuYW5kX3JlYWRfZWNjKHN0cnVjdCBuYW5kX2NoaXAgKm5hbmQsIHNpemVfdCBzdGFydCwgc2l6ZV90IGxlbiwKKwkJIHNpemVfdCAqIHJldGxlbiwgdV9jaGFyICpidWYsIHVfY2hhciAqZWNjX2NvZGUpCit7CisJaW50IGNvbCwgcGFnZTsKKwlpbnQgZWNjX3N0YXR1cyA9IDA7CisjaWZkZWYgQ09ORklHX01URF9OQU5EX0VDQworCWludCBqOworCWludCBlY2NfZmFpbGVkID0gMDsKKwl1X2NoYXIgKmRhdGFfcG9pOworCXVfY2hhciBlY2NfY2FsY1s2XTsKKyNlbmRpZgorCisJLyogRG8gbm90IGFsbG93IHJlYWRzIHBhc3QgZW5kIG9mIGRldmljZSAqLworCWlmICgoc3RhcnQgKyBsZW4pID4gbmFuZ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