From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9497 invoked by alias); 5 May 2014 17:17:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 9486 invoked by uid 89); 5 May 2014 17:17:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: mail-ob0-f175.google.com Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 05 May 2014 17:17:44 +0000 Received: by mail-ob0-f175.google.com with SMTP id wp4so8818712obc.34 for ; Mon, 05 May 2014 10:17:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/0BOJPHFWYp8RhuUlcz6FwGTJSyPlufnAEjGnBMTRZ0=; b=kiA8wfWDENNaU3ab6sZxwuQhkxXJThjtZQPoUDehKws25pSq2gNdGQx0IjPM6x/sxT 3ZZVkDQsCCc6nduYT47cnjnZb3ZeRwCtg9Wu/2vypfabegpnXDwFs+gohq/mdMUC04wa 2Qj0ZtlzYxdiXsZ2TkBG3rLS8RgcXbu5Cf2ou4xWvXPZADXkhnle1ihRgFixR0P1SMjH GIZJX1w6xGUoWd/Y0hB+GKTSQFTBuxi+UnOIKRM9dtreHhLOg8Y6xX18aH4VgGqVjjhB Yp7oEQuF9b1d79OGz6tQXQfwKTzebufVjQCD7g5rCRUT9Evacngd9hADizM+cFiqpi9t pxEw== X-Gm-Message-State: ALoCoQna+gxf7o45AXhduomDJnqGArASHBB7tiQR3RdJbNkDJLpKuGaOcZp7461CQriwzoXc/Ncf MIME-Version: 1.0 X-Received: by 10.182.205.135 with SMTP id lg7mr33638815obc.32.1399310262496; Mon, 05 May 2014 10:17:42 -0700 (PDT) Received: by 10.182.176.98 with HTTP; Mon, 5 May 2014 10:17:42 -0700 (PDT) In-Reply-To: References: <20140415213850.GA23141@atrey.karlin.mff.cuni.cz> <20140417033448.GC3157@kam.mff.cuni.cz> Date: Mon, 05 May 2014 17:17:00 -0000 Message-ID: Subject: Re: [PATCH] offline gcda profile processing tool From: Rong Xu To: Jan Hubicka Cc: GCC Patches , Xinliang David Li , Teresa Johnson , Dehao Chen Content-Type: multipart/mixed; boundary=001a11c256e620b27304f8aa4f24 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00227.txt.bz2 --001a11c256e620b27304f8aa4f24 Content-Type: text/plain; charset=UTF-8 Content-length: 4526 Here is the updated patch. The difference with patch set 3 is (1) use the gcov-counter.def for scaling operation. (2) fix wrong scaling function for time-profiler. passed with bootstrap, profiledboostrap and SPEC2006. Thanks, -Rong On Thu, May 1, 2014 at 3:37 PM, Rong Xu wrote: > Hi, Honza, > > Please find the new patch in the attachment. This patch integrated > your earlier suggestions. The noticeable changes are: > (1) build specialized object for libgcov-driver.c and libgcov-merge.c > and link into gcov-tool, rather including the source file. > (2) split some gcov counter definition code to gcov-counter.def to > avoid code duplication. > (3) use a macro for gcov_read_counter(), so gcov-tool can use existing > code in libgcov-merge.c with minimal change. > > This patch does not address the suggestion of creating a new directory > for libgcov. I agree with you that's a much better > and cleaner structure we should go for. We can do that in follow-up patches. > > I tested this patch with boostrap and profiledbootstrap. Other tests > are on-going. > > Thanks, > > -Rong > > On Wed, Apr 16, 2014 at 8:34 PM, Jan Hubicka wrote: >>> GCOT_TOOL needs to use this function to read the string in gcda file >>> to memory to construct gcov_info objects. >>> As you noticed, gcov runtime does not need this interface. But >>> gcov-tool links with gcov runtime and it also uses the function. >>> We could make it available in gcov_runtime, but that will slightly >>> increase the memory footprint. >> >> Yep, it is not really pretty. I wrote bellow some plan how things may be >> structured in more convenient way. Any work in that direction would be welcome. >>> >>> The planned new functions for trunk version is: (1) overlap score b/w >>> two profiles (2) better dumping (top hot objects/function/counters) >>> and statistics. >>> Once this basic version is in, we can start to add the new functionality. >> >> Sounds good. I assume the autoFDO does not go via gcov tool but rather uses >> custom reader of profile data at GCC side? >> I wonder, are there any recent overview papers/slides/text of design of AutoFDO >> and other features to be merged? >> I remember the talk from GCC Summit and I did read some of pre-LTO LIPO >> sources & papers, but it would be nice to have somethin up to date. >>> >>> libgcov-util.o is built in gcc/ directory, rather in libgcc. >>> It's directly linked to gcov-tool. >>> So libgcov-util.o is built for HOST, not TARGET. >>> With makefile changes, we can built HOST version of libgcov-driver.o >>> and libgcov-merge.o. >>> I also need to make some static functions/variables public. >> >> I suppose that can go with IN_GCOV_TOOL ifdef. >> >> So we currently have basic gcov io handling in gcc/gcov-io.c that is borrowed >> by libgcc/libgcov* code. We also will get libgcov-util.c in libgcc directory >> that is actually borrowed by by gcc/gcov-tool.c code. >> >> We now have one runtime using STDIO for streaming and kernel has custom version >> that goes via /proc interface (last time I looked). We added some abstraction >> into libgcov-interface that is the part that relies on STDIO, partly via gcov-io.c >> code and now we have in-memory handling code in libgcov-util. >> >> I guess it would make most sentse to put all the gcov code into a new directory >> (libgcov) and make it stand-alone library that can be configured >> 1) for stdio based runtime as we do not >> 2) for runtime missing the interface and relyin on user providing it >> 3) for use within gcov file manipulation tools with reorg of >> GCC/gcov/gcov-dump/gcov-tool to all use the same low-level interfaces. >> In a longer term, I would like to make FDO profiling intstrumentation to happen >> at linktime. For that I need to make the instrumentation code (minimal spaning >> tree & friends) to work w/o cgraph that would ideally be done in a shared >> implementation >>> > Won't this get wrong answer when counters[0] is not the same? >>> > I would expected the merging code to compare the counters first. Similarly for delta counter. >>> >>> These *_op functions are for scaling only. So there is only one >>> profile involved (thus there is no comparison). >>> The merge handles are in libgcov-merge.c which have the code to handle >>> mismatched profile targets. >> >> I see, OK then. >>> > >>> > Adding correct rounding may actually make difference for Martin's startup time work. >>> >>> Do you mean to use something like in RDIV macro? >> >> Yes. >> >> Honza --001a11c256e620b27304f8aa4f24 Content-Type: text/plain; charset=US-ASCII; name="gcov_tool_patch_v4.txt" Content-Disposition: attachment; filename="gcov_tool_patch_v4.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_huu16tzi1 Content-length: 83241 MjAxNC0wNS0wNSAgUm9uZyBYdSAgPHh1ckBnb29nbGUuY29tPgoKCSogZ2Nj L2djb3YtaW8uYyAoZ2Nvdl9wb3NpdGlvbik6IE1ha2UgYXZhaWFsYmxlIHRv IGdjb3YtdG9vbC4KCShnY292X2lzX2Vycm9yKTogRGl0dG8uCgkoZ2Nvdl9y ZWFkX3N0cmluZyk6IERpdHRvLgoJKGdjb3ZfcmVhZF9zeW5jKTogRGl0dG8u CgkqIGdjYy9nY292LWlvLmg6IE1vdmUgY291bnRlciBkZWZpbmVzIHRvIGdj b3YtY291bnRlci5kZWYuCgkqIGdjYy9nY292LWR1bXAuYyAodGFnX2NvdW50 ZXJzKTogVXNlIGdjb3YtY291bnRlci5kZWYuCgkqIGdjYy9jb3ZlcmFnZS5j OiBEaXR0by4KCSogZ2NjL2djb3YtdG9vbC5jOiBPZmZsaW5lIGdjZGEgcHJv ZmlsZSBwcm9jZXNzaW5nIHRvb2wuCiAgICAgICAgKHVubGlua19nY2RhX2Zp bGUpOiBSZW1vdmUgb25lIGdjZGEgZmlsZS4KCSh1bmxpbmtfcHJvZmlsZV9k aXIpOiBSZW1vdmUgZ2NkYSBmaWxlcyBmcm9tIHRoZSBwcm9maWxlIHBhdGgu CgkocHJvZmlsZV9tZXJnZSk6IE1lcmdlIHR3byBwcm9maWxlcyBpbiBkaXJl Y3RvcnkuCgkocHJpbnRfbWVyZ2VfdXNhZ2VfbWVzc2FnZSk6IFByaW50IG1l cmdlIHVzYWdlLgo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qLCBpbnQpOworZXh0ZXJuIHZvaWQg Z2Nvdl9leGl0ICh2b2lkKTsKK2V4dGVybiB2b2lkIHNldF9nY292X2xpc3Qg KHN0cnVjdCBnY292X2luZm8gKik7CitleHRlcm4gdm9pZCBnY292X3NldF92 ZXJib3NlICh2b2lkKTsKKworc3RhdGljIGludCB2ZXJib3NlOworCisvKiBS ZW1vdmUgZmlsZSBOQU1FIGlmIGl0IGhhcyBhIGdjZGEgc3VmZml4LiAqLwor CitzdGF0aWMgaW50Cit1bmxpbmtfZ2NkYV9maWxlIChjb25zdCBjaGFyICpu YW1lLAorICAgICAgICAgICAgICAgICAgY29uc3Qgc3RydWN0IHN0YXQgKnN0 YXR1cyBBVFRSSUJVVEVfVU5VU0VELAorICAgICAgICAgICAgICAgICAgaW50 IHR5cGUgQVRUUklCVVRFX1VOVVNFRCwKKyAgICAgICAgICAgICAgICAgIHN0 cnVjdCBGVFcgKmZ0d2J1ZiBBVFRSSUJVVEVfVU5VU0VEKQoreworICBpbnQg cmV0ID0gMDsKKyAgaW50IGxlbiA9IHN0cmxlbiAobmFtZSk7CisgIGludCBs ZW4xID0gc3RybGVuIChHQ09WX0RBVEFfU1VGRklYKTsKKworICBpZiAobGVu ID4gbGVuMSAmJiAhc3RybmNtcCAobGVuIC1sZW4xICsgbmFtZSwgR0NPVl9E QVRBX1NVRkZJWCwgbGVuMSkpCisgICAgcmVtb3ZlIChuYW1lKTsKKworICBp ZiAocmV0KQorICAgIHsKKyAgICAgIGZub3RpY2UgKHN0ZGVyciwgImVycm9y IGluIHJlbW92aW5nICVzXG4iLCBuYW1lKTsKKyAgICAgIGV4aXQgKEZBVEFM X0VYSVRfQ09ERSk7CisgICAgfQorCisgIHJldHVybiByZXQ7Cit9CisKKy8q IFJlbW92ZSB0aGUgZ2NkYSBmaWxlcyBpbiBQQVRIIHJlY3Vyc2l2ZWx5LiAg Ki8KKworc3RhdGljIGludAordW5saW5rX3Byb2ZpbGVfZGlyIChjb25zdCBj aGFyICp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LworICB1bmxpbmtfcHJvZmlsZV9k aXIgKG91dCk7CisgIG1rZGlyIChvdXQsIDA3NTUpOworICBwd2QgPSBnZXRj d2QgKE5VTEwsIDApOworICBnY2NfYXNzZXJ0IChwd2QpOworICByZXQgPSBj aGRpciAob3V0KTsKKyAgZ2NjX2Fzc2VydCAocmV0ID09IDApOworCisgIHNl dF9nY292X2xpc3QgKGQxX3Byb2ZpbGUpOworICBnY292X2V4aXQgKCk7CisK KyAgcmV0ID0gY2hkaXIgKHB3ZCk7CisgIGZyZWUgKHB3ZCk7CisgIHJldHVy biAwOworfQorCisvKiBVc2FnZSBtZXNzYWdlIGZvciBwcm9maWxlIG1lcmdl LiAgKi8KKworc3RhdGljIHZvaWQKK3ByaW50X21lcmdlX3VzYWdlX21lc3Nh Z2UgKGludCBlcnJvcl9wKQoreworICBGSUxFICpmaWxlID0gZXJyb3JfcCA/ IHN0ZGVyciA6IHN0ZG91dDsKKworICBmbm90aWNlIChmaWxlLCAiICBtZXJn ZSBbb3B0aW9uc10gPGRpcjE+IDxkaXIyPiAgICAgICAgIE1lcmdlIGNvdmVy YWdlIGZpbGUgY29udGVudHNcbiIpOworICBmbm90aWNlIChmaWxlLCAiICAg IC12LCAtLXZlcmJvc2UgICAgICAgICAgICAgICAgICAgICAgIFZlcmJvc2Ug bW9kZVxuIik7CisgIGZub3RpY2UgKGZpbGUsICIgICAgLW8sIC0tb3V0cHV0 IDxkaXI+ICAgICAgICAgICAgICAgICAgT3V0cHV0IGRpcmVjdG9yeVxuIik7 CisgIGZub3RpY2UgKGZpbGUsICIgICAgLXcsIC0td2VpZ2h0IDx3MSx3Mj4g ICAgICAgICAgICAgICAgU2V0IHdlaWdodHMgKGZsb2F0IHBvaW50IHZhbHVl cylcbiIpOworfQorCitzdGF0aWMgY29uc3Qgc3RydWN0IG9wdGlvbiBtZXJn ZV9vcHRpb25zW10gPQoreworICB7ICJ2ZXJib3NlIiwgICAgICAgICAgICAg ICAgbm9fYXJndW1lbnQsICAg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gICAgICAg IGNhc2UgJ3cnOgorICAgICAgICAgIHNzY2FuZiAob3B0YXJnLCAiJWQsJWQi LCAmdzEsICZ3Mik7CisgICAgICAgICAgaWYgKHcxIDwgMCB8fCB3MiA8IDAp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZub3RpY2UgKHN0ZGVy ciwgIndlaWdodHMgbmVlZCB0byBiZSBub24tbmVnYXRpdmVcbiIpOworICAg ICAgICAgICAgICBleGl0IChGQVRBTF9FWElUX0NPREUpOworICAgICAgICAg ICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAg ICAgICAgIG1lcmdlX3VzYWdlICgpOworICAgICAgICB9CisgICAgfQorCisg IGlmIChvdXRwdXRfZGlyID09IE5VTEwpCisgICAgb3V0cHV0X2RpciA9ICJt ZXJnZWRfcHJvZmlsZSI7CisKKyAgaWYgKGFyZ2MgLSBvcHRpbmQgPT0gMikK KyAgICByZXQgPSBwcm9maWxlX21lcmdlIChhcmd2W29wdGluZF0sIGFyZ3Zb b3B0aW5kKzFdLCBvdXRwdXRfZGlyLCB3MSwgdzIpOworICBlbHNlCisgICAg bWVyZ2VfdXNhZ2UgKCk7CisKKyAgcmV0dXJuIHJldDsKK30KKworLyogSWYg Tl9WQUwgaXMgbm8temVybywgbm9ybWFsaXplIHRoZSBwcm9maWxlIGJ5IHNl dHRpbmcgdGhlIGxhcmdlc3QgY291bnRlcgorICAgY291bnRlciB2YWx1ZSB0 byBOX1ZBTCBhbmQgc2NhbGUgb3RoZXJzIGNvdW50ZXJzIHByb3BvcnRpb25h bGx5LgorICAgT3RoZXJ3aXNlLCBtdWx0aXBseSB0aGUgYWxsIGNvdW50ZXJz IGJ5IFNDQUxFLiAgKi8KKworc3RhdGljIGludAorcHJvZmlsZV9yZXdyaXRl IChjb25zdCBjaGFyICpkMSwgY29uc3QgY2hhciAqb3V0LCBsb25nIGxvbmcg bl92YWwsCisgICAgICAgICAgICAgICAgIGZsb2F0IHNjYWxlLCBpbnQgbiwg aW50IGQpCit7CisgIGNoYXIgKnB3ZDsKKyAgaW50IHJldDsKKyAgc3RydWN0 IGdjb3ZfaW5mbyAqIGQxX3Byb2ZpbGU7CisKKworICBkMV9wcm9maWxlID0g Z2Nvdl9yZWFkX3Byb2ZpbGVfZGlyIChkMSwgMCk7CisgIGlmICghZDFfcHJv ZmlsZSkKKyAgICByZXR1cm4gMTsKKworICAvKiBPdXRwdXQgbmV3IHByb2Zp bGUuICAqLworICB1bmxpbmtfcHJvZmlsZV9kaXIgKG91dCk7CisgIG1rZGly IChvdXQsIDA3NTUpOworICBwd2QgPSBnZXRjd2QgKE5VTEwsIDApOworICBn Y2NfYXNzZXJ0IChwd2QpOworICByZXQgPSBjaGRpciAob3V0KTsKKyAgZ2Nj X2Fzc2VydCAocmV0ID09IDApOworCisgIGlmIChuX3ZhbCkKKyAgICBnY292 X3Byb2ZpbGVfbm9ybWFsaXplIChkMV9wcm9maWxlLCAoZ2Nvdl90eXBlKSBu X3ZhbCk7CisgIGVsc2UKKyAgICBnY292X3Byb2ZpbGVfc2NhbGUgKGQxX3By b2ZpbGUsIHNjYWxlLCBuLCBkKTsKKworICBzZXRfZ2Nvdl9saXN0IChkMV9w cm9maWxlKTsKKyAgZ2Nvdl9leGl0ICgpOworCisgIHJldCA9IGNoZGlyIChw d2QpOworICBmcmVlIChwd2QpOworICByZXR1cm4gMDsKK30KKworLyogVXNh Z2UgZnVuY3Rpb24gZm9yIHByb2ZpbGUgcmV3cml0ZS4gICovCisKK3N0YXRp YyB2b2lkCitwcmludF9yZXdyaXRlX3VzYWdlX21lc3NhZ2UgKGludCBlcnJv cl9wKQoreworICBGSUxFICpmaWxlID0gZXJyb3JfcCA/IHN0ZGVyciA6IHN0 ZG91dDsKKworICBmbm90aWNlIChmaWxlLCAiICByZXdyaXRlIFtvcHRpb25z XSA8ZGlyPiAgICAgICAgICAgICAgIFJld3JpdGUgY292ZXJhZ2UgZmlsZSBj b250ZW50c1xuIik7CisgIG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ICh0cnVlKTsK KyAgZXhpdCAoRkFUQUxfRVhJVF9DT0RFKTsKK30KKworLyogRHJpdmVyIGZv ciBwcm9maWxlIHJld3JpdGUgc3ViLWNvbW1hbmQuICovCisKK3N0YXRpYyBp bnQKK2RvX3Jld3JpdGUgKGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKyAg aW50IG9wdDsKKyAgaW50IHJldDsKKyAgY29uc3QgY2hhciAqb3V0cHV0X2Rp ciA9IDA7CisgIGxvbmcgbG9uZyBub3JtYWxpemVfdmFsID0gMDsKKyAgZmxv YXQgc2NhbGUgPSAwLjA7CisgIGludCBudW1lcmF0b3IgPSAxOworICBpbnQg ZGVub21pbmF0b3IgPSAxOworICBpbnQgZG9fc2NhbGluZyA9IDA7CisKKyAg b3B0aW5kID0gMDsKKyAgd2hpbGUgKChvcHQgPSBnZXRvcHRfbG9uZyAoYXJn YywgYXJndiwgInZvOnM6bjoiLCByZXdyaXRlX29wdGlvbnMsIE5VTEwpKSAh PSAtMSkKKyAgICB7CisgICAgICBzd2l0Y2ggKG9wdCkKKyAgICAgICAgewor ICAgICAgICBjYXNlICd2JzoKKyAgICAgICAgICB2ZXJib3NlID0gMTsKKyAg ICAgICAgICBnY292X3NldF92ZXJib3NlICgpOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlICdvJzoKKyAgICAgICAgICBvdXRwdXRfZGlyID0g b3B0YXJnOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICduJzoK KyAgICAgICAgICBpZiAoIWRvX3NjYWxpbmcpCisgICAgICAgICAgICBub3Jt YWxpemVfdmFsID0gYXRvbGwgKG9wdGFyZyk7CisgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgZm5vdGljZSAoc3RkZXJyLCAic2NhbGluZyBjYW5ub3Qg Y28tZXhpc3Qgd2l0aCBub3JtYWxpemF0aW9uLCIKKyAgICAgICAgICAgICAg ICAiIHNraXBwaW5nXG4iKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg Y2FzZSAncyc6CisgICAgICAgICAgcmV0ID0gMDsKKyAgICAgICAgICBkb19z Y2FsaW5nID0gMTsKKyAgICAgICAgICBpZiAoc3Ryc3RyIChvcHRhcmcsICIv IikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldCA9IHNzY2Fu ZiAob3B0YXJnLCAiJWQvJWQiLCAmbnVtZXJhdG9yLCAmZGVub21pbmF0b3Ip OworICAgICAgICAgICAgICBpZiAocmV0ID09IDIpCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgZ2NjX2Fzc2VydCAobnVtZXJhdG9y ID49IDApOworICAgICAgICAgICAgICAgICAgZ2NjX2Fzc2VydCAoZGVub21p bmF0b3IgPiAwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKHJldCAhPSAyKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICByZXQgPSBzc2NhbmYgKG9wdGFyZywgIiVmIiwgJnNjYWxl KTsKKyAgICAgICAgICAgICAgZ2NjX2Fzc2VydCAocmV0ID09IDEpOworICAg ICAgICAgICAgICBkZW5vbWluYXRvciA9IDA7CisgICAgICAgICAgICB9CisK KyAgICAgICAgICBpZiAoc2NhbGUgPCAwLjApCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGZub3RpY2UgKHN0ZGVyciwgInNjYWxlIG5lZWRzIHRv IGJlIG5vbi1uZWdhdGl2ZVxuIik7CisgICAgICAgICAgICAgIGV4aXQgKEZB VEFMX0VYSVRfQ09ERSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYg KG5vcm1hbGl6ZV92YWwgIT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgZm5vdGljZSAoc3RkZXJyLCAibm9ybWFsaXphdGlvbiBjYW5ub3Qg Y28tZXhpc3Qgd2l0aCBzY2FsaW5nXG4iKTsKKyAgICAgICAgICAgICAgbm9y bWFsaXplX3ZhbCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgcmV3cml0ZV91c2Fn ZSAoKTsKKyAgICAgICAgfQorICAgIH0KKworICBpZiAob3V0cHV0X2RpciA9 PSBOVUxMKQorICAgIG91dHB1dF9kaXIgPSAicmV3cml0ZV9wcm9maWxlIjsK KworICBpZiAoYXJnYyAtIG9wdGluZCA9PSAxKQorICAgIHsKKyAgICAgIGlm IChkZW5vbWluYXRvciA+IDApCisgICAgICAgIHJldCA9IHByb2ZpbGVfcmV3 cml0ZSAoYXJndltvcHRpbmRdLCAgb3V0cHV0X2RpciwgMCwgMC4wLCBudW1l cmF0b3IsIGRlbm9taW5hdG9yKTsKKyAgICAgIGVsc2UKKyAgICAgICAgcmV0 ID0gcHJvZmlsZV9yZXdyaXRlIChhcmd2W29wdGluZF0sICBvdXRwdXRfZGly LCBub3JtYWxpemVfdmFsLCBzY2FsZSwgMCwgMCk7CisgICAgfQorICBlbHNl CisgICAgcmV3cml0ZV91c2FnZSAoKTsKKworICByZXR1cm4gcmV0OworfQor CisvKiBQcmludCBhIHVzYWdlIG1lc3NhZ2UgYW5kIGV4aXQuICBJZiBFUlJP Ul9QIGlzIG5vbnplcm8sIHRoaXMgaXMgYW4gZXJyb3IsCisgICBvdGhlcndp c2UgdGhlIG91dHB1dCBvZiAtLWhlbHAuICAqLworCitzdGF0aWMgdm9pZAor cHJpbnRfdXNhZ2UgKGludCBlcnJvcl9wKQoreworICBGSUxFICpmaWxlID0g ZXJyb3JfcCA/IHN0ZGVyciA6IHN0ZG91dDsKKyAgaW50IHN0YXR1cyA9IGVy cm9yX3AgPyBGQVRBTF9FWElUX0NPREUgOiBTVUNDRVNTX0VYSVRfQ09ERTsK KworICBmbm90aWNlIChmaWxlLCAiVXNhZ2U6ICVzIFtPUFRJT05dLi4uIFNV Ql9DT01NQU5EIFtPUFRJT05dLi4uXG5cbiIsIHByb2duYW1lKTsKKyAgZm5v dGljZ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iVGhlcmUgaXMgTk8gd2FycmFudHk7IG5vdCBldmVu IGZvciBNRVJDSEFOVEFCSUxJVFkgb3IgXG4iCisgICAgICAgICAgICAgIkZJ VE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLlxuXG4iKSk7CisgIGV4 aXQgKFNVQ0NFU1NfRVhJVF9DT0RFKTsKK30KKworc3RhdGljIGNvbnN0IHN0 cnVjdCBvcHRpb24gb3B0aW9uc1tdID0KK3sKKyAgeyAiaGVscCIsICAgICAg ICAgICAgICAgICBub19hcmd1bWVudCwgICAgICAgTlVMTCwgJ2gnIH0sCisg IHsgInZlcnNpb24iLCAgICAgICAgICAgICAgbm9fYXJndW1lbnQsICAgICAg IE5VTEwsICd2JyB9LAorICB7IDAsIDAsIDAsIDAgfQorfTsKKworLyogUHJv Y2VzcyBhcmdzLCByZXR1cm4gaW5kZXggdG8gZmlyc3Qgbm9uLWFyZy4gICov CisKK3N0YXRpYyBpbnQKK3Byb2Nlc3NfYXJncyAoaW50IGFyZ2MsIGNoYXIg Kiphcmd2KQoreworICBpbnQgb3B0OworCisgIHdoaWxlICgob3B0ID0gZ2V0 b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsICIraHYiLCBvcHRpb25zLCBOVUxMKSkg IT0gLTEpCisgICAgeworICAgICAgc3dpdGNoIChvcHQpCisgICAgICAgIHsK KyAgICAgICAgY2FzZSAnaCc6CisgICAgICAgICAgcHJpbnRfdXNhZ2UgKGZh bHNlKTsKKyAgICAgICAgICAvKiBQcmludF91c2FnZSB3aWxsIGV4aXQuICAq LworICAgICAgICBjYXNlICd2JzoKKyAgICAgICAgICBwcmludF92ZXJzaW9u ICgpOworICAgICAgICAgIC8qIFByaW50X3ZlcnNpb24gd2lsbCBleGl0LiAg Ki8KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICBwcmludF91c2FnZSAo dHJ1ZSk7CisgICAgICAgICAgLyogUHJpbnRfdXNhZ2Ugd2lsbCBleGl0LiAg Ki8KKyAgICAgICAgfQorICAgIH0KKworICByZXR1cm4gb3B0aW5kOworfQor CisvKiBNYWluIGZ1bmN0aW9uIGZvciBnY292LXRvb2wuICAqLworCitpbnQK K21haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKyAgY29uc3QgY2hh ciAqcDsKKyAgY29uc3QgY2hhciAqc3ViX2NvbW1hbmQ7CisKKyAgcCA9IGFy Z3ZbMF0gKyBzdHJsZW4gKGFyZ3ZbMF0pOworICB3aGlsZSAocCAhPSBhcmd2 WzBdICYmICFJU19ESVJfU0VQQVJBVE9SIChwWy0xXSkpCisgICAgLS1wOwor ICBwcm9nbmFtZSA9IHA7CisKKyAgeG1hbGxvY19zZXRfcHJvZ3JhbV9uYW1l IChwcm9nbmFtZSk7CisKKyAgLyogVW5sb2NrIHRoZSBzdGRpbyBzdHJlYW1z LiAgKi8KKyAgdW5sb2NrX3N0ZF9zdHJlYW1zICgpOworCisgIGdjY19pbml0 X2xpYmludGwgKCk7CisKKyAgZGlhZ25vc3RpY19pbml0aWFsaXplIChnbG9i YWxfZGMsIDApOworCisgIC8qIEhhbmRsZSByZXNwb25zZSBmaWxlcy4gICov CisgIGV4cGFuZGFyZ3YgKCZhcmdjLCAmYXJndik7CisKKyAgcHJvY2Vzc19h cmdzIChhcmdjLCBhcmd2KTsKKyAgaWYgKG9wdGluZCA+PSBhcmdjKQorICAg IHByaW50X3VzYWdlICh0cnVlKTsKKworICBzdWJfY29tbWFuZCA9IGFyZ3Zb b3B0aW5kXTsKKworICBpZiAoIXN0cmNtcCAoc3ViX2NvbW1hbmQsICJtZXJn ZSIpKQorICAgIHJldHVybiBkb19tZXJnZSAoYXJnYyAtIG9wdGluZCwgYXJn diArIG9wdGluZCk7CisgIGVsc2UgaWYgKCFzdHJjbXAgKHN1Yl9jb21tYW5k LCAicmV3cml0ZSIpKQorICAgIHJldHVybiBkb19yZXdyaXRlIChhcmdjIC0g b3B0aW5kLCBhcmd2ICsgb3B0aW5kKTsKKworICBw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Z2NjL2xpYmdjb3YtbWVyZ2UuYyBcCisgICQoU1lTVEVN X0gpIGNvcmV0eXBlcy5oICQoVE1fSCkgJChDT05GSUdfSCkgdmVyc2lvbi5o IGludGwuaCAkKERJQUdOT1NUSUNfSCkKK2xpYmdjb3YtdXRpbC5vOiAkKHNy Y2RpcikvLi4vbGliZ2NjL2xpYmdjb3YtdXRpbC5jICQoR0NPVl9UT09MX0RF UF9GSUxFUykKKwkrJChDT01QSUxFUikgLWMgJChBTExfQ09NUElMRVJGTEFH UykgJChBTExfQ1BQRkxBR1MpICQoSU5DTFVERVMpIC1vICRAICQ8CitsaWJn Y292LWRyaXZlci10b29sLm86ICQoc3JjZGlyKS8uLi9saWJnY2MvbGliZ2Nv di1kcml2ZXIuYyAkKEdDT1ZfVE9PTF9ERVBfRklMRVMpCisJKyQoQ09NUElM RVIpIC1jICQoQUxMX0NPTVBJTEVSRkxBR1MpICQoQUxMX0NQUEZMQUdTKSAk KElOQ0xVREVTKSBcCisJICAtRElOX0dDT1ZfVE9PTD0xIC1vICRAICQ8Cits aWJnY292LW1lcmdlLXRvb2wubzogJChzcmNkaXIpLy4uL2xpYmdjYy9saWJn Y292LW1lcmdlLmMgJChHQ09WX1RPT0xfREVQX0ZJTEVTKQorCSskKENPTVBJ TEVSKSAtYyAkKEFMTF9DT01QSUxFUkZMQUdTKSAkKEFMTF9DUFBGTEFHUykg JChJTkNMVURFUykgXAorCSAgLURJTl9HQ09WX1RPT0w9MSAtbyAkQCAkPAor R0NPVl9UT09MX09CSlMgPSBnY292LXRvb2wubyBsaWJnY292LXV0aWwubyBs aWJnY292LWRyaXZlci10b29sLm8gbGliZ2Nvdi1tZXJnZS10b29sLm8KK2dj b3YtdG9vbCQoZXhlZXh0KTogJChHQ09WX1RPT0xfT0JKUykgJChMSUJERVBT KQorCSskKExJTktFUikgJChBTExfTElOS0VSRkxBR1MpICQoTERGTEFHUykg JChHQ09WX1RPT0xfT0JKUykgJChMSUJTKSAtbyAkQAogIwwK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yAgICAgIGFsbCA9IEdDT1ZfR0VUX0NPVU5URVI7CiAKICAgICAgIGlm IChjb3VudGVyc1swXSA9PSB2YWx1ZSkKICAgICAgICAgY291bnRlcnNbMV0g Kz0gY291bnRlcjsKQEAgLTE0OCwxMCArMTQ4LDEwIEBAIF9fZ2Nvdl9tZXJn ZV9kZWx0YSAoZ2Nvdl90eXBlICpjb3VudGVycywgdW5zaWduZWQKICAgbl9t ZWFzdXJlcyA9IG5fY291bnRlcnMgLyA0OwogICBmb3IgKGkgPSAwOyBpIDwg bl9tZWFzdXJlczsgaSsrLCBjb3VudGVycyArPSA0KQogICAgIHsKLSAgICAg IC8qIGxhc3QgPSAqLyBnY292X3JlYWRfY291bnRlciAoKTsKLSAgICAgIHZh bHVlID0gZ2Nvdl9yZWFkX2NvdW50ZXIgKCk7Ci0gICAgICBjb3VudGVyID0g Z2Nvdl9yZWFkX2NvdW50ZXIgKCk7Ci0gICAgICBhbGwgPSBnY292X3JlYWRf Y291bnRlciAoKTsKKyAgICAgIC8qIGxhc3QgPSAqLyBHQ09WX0dFVF9DT1VO VEVSOworICAgICAgdmFsdWUgPSBHQ09WX0dFVF9DT1VOVEVSX1RBUkdFVDsK KyAgICAgIGNvdW50ZXIgPSBHQ09WX0dFVF9DT1VOVEVSOworICAgICAgYWxs ID0gR0NPVl9HRVRfQ09VTlRFUjsKIAogICAgICAgaWYgKGNvdW50ZXJzWzFd ID09IHZhbHVlKQogICAgICAgICBjb3VudGVyc1syXSArPSBjb3VudGVyOwpJ bmRleDogbGliZ2NjL2xpYmdjb3YtdXRpbC5jCj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0KLS0tIGxpYmdjYy9saWJnY292LXV0aWwuYwkocmV2aXNpb24gMCkK KysrIGxpYmdjYy9saWJnY292LXV0aWwuYwkocmV2aXNpb24gMCkKQEAgLTAs MCArMSw4NjYgQEAKKy8qIFV0aWxpdHkgZnVuY3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2ZpX3B0cjItPmtleSAhPSBpbmZvMikK KyAgICAgICAgY29udGludWU7CisKKyAgICAgIGlmIChnZmlfcHRyMS0+Y2Zn X2NoZWNrc3VtICE9IGdmaV9wdHIyLT5jZmdfY2hlY2tzdW0pCisgICAgICAg IHsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJpbiAlcywgY2ZnX2No ZWNrc3VtIG1pc21hdGNoLCBza2lwcGluZ1xuIiwKKyAgICAgICAgICAgICAg ICAgIGluZm8xLT5maWxlbmFtZSk7CisgICAgICAgICAgaGFzX21pc21hdGNo ID0gMTsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAg Y2lfcHRyMSA9IGdmaV9wdHIxLT5jdHJzOworICAgICAgY2lfcHRyMiA9IGdm aV9wdHIyLT5jdHJzOworICAgICAgZm9yICh0X2l4ID0gMDsgdF9peCAhPSBH Q09WX0NPVU5URVJTOyB0X2l4KyspCisgICAgICAgIHsKKyAgICAgICAgICBn Y292X21lcmdlX2ZuIG1lcmdlMSA9IGluZm8xLT5tZXJnZVt0X2l4XTsKKyAg ICAgICAgICBnY292X21lcmdlX2ZuIG1lcmdlMiA9IGluZm8yLT5tZXJnZVt0 X2l4XTsKKworICAgICAgICAgIGdjY19hc3NlcnQgKG1lcmdlMSA9PSBtZXJn ZTIpOworICAgICAgICAgIGlmICghbWVyZ2UxKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgZ2NjX2Fzc2VydCAoY2lfcHRyMS0+bnVtID09 IGNpX3B0cjItPm51bSk7CisgICAgICAgICAgbWVyZ2Vfd3JhcHBlciAobWVy Z2UxLCBjaV9wdHIxLT52YWx1ZXMsIGNpX3B0cjEtPm51bSwgY2lfcHRyMi0+ dmFsdWVzLCB3KTsKKyAgICAgICAgICBjaV9wdHIxKys7CisgICAgICAgICAg Y2lfcHRyMisrOworICAgICAgICB9CisgICAgfQorCisgIHJldHVybiBoYXNf bWlzbWF0Y2g7Cit9CisKKy8qIEZpbmQgYW5kIHJldHVybiB0aGUgbWF0Y2gg Z2Nvdl9pbmZvIG9iamVjdCBmb3IgSU5GTyBmcm9tIEFSUkFZLgorICAgU0la RSBpcyB0aGUgbGVuZ3RoIG9mIEFSUkFZLgorICAgUmV0dXJuIE5VTEwgaWYg dGhlcmUgaXMgbm8gbWF0Y2guICAqLworCitzdGF0aWMgc3RydWN0IGdjb3Zf aW5mbyAqCitmaW5kX21hdGNoX2djb3ZfaW5mbyAoc3RydWN0IGdjb3ZfaW5m byAqKmFycmF5LCBpbnQgc2l6ZSwgc3RydWN0IGdjb3ZfaW5mbyAqaW5mbykK K3sKKyAgc3RydWN0IGdjb3ZfaW5mbyAqZ2lfcHRyOworICBzdHJ1Y3QgZ2Nv dl9pbmZvICpyZXQgPSBOVUxMOworICBpbnQgaTsKKworICBmb3IgKGkgPSAw OyBpIDwgc2l6ZTsgaSsrKQorICAgIHsKKyAgICAgIGdpX3B0ciA9IGFycmF5 W2ldOworICAgICAgaWYgKGdpX3B0ciA9PSAwKQorICAgICAgICBjb250aW51 ZTsKKyAgICAgIGlmICghc3RyY21wIChnaV9wdHItPmZpbGVuYW1lLCBpbmZv LT5maWxlbmFtZSkpCisgICAgICAgIHsKKyAgICAgICAgICByZXQgPSBnaV9w dHI7CisgICAgICAgICAgYXJyYXlbaV0gPSAwOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgfQorCisgIGlmIChyZXQgJiYgcmV0LT5uX2Z1 bmN0aW9ucyAhPSBpbmZvLT5uX2Z1bmN0aW9ucykKKyAgICB7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICJtaXNtYXRjaGVkIHByb2ZpbGVzIGluICVzICgl ZCBmdW5jdGlvbnMiCisgICAgICAgICAgICAgICAgICAgICAgICIgdnMgJWQg ZnVuY3Rpb25zKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0LT5m aWxlbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0LT5uX2Z1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gICAgICAgaW5fc3JjX25vdF90Z3RbdW5tYXRj aF9pbmZvX2NudCsrXSA9IGdpX3B0cjsKKyAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgICAgZ2Nvdl9tZXJnZSAoZ2lfcHRyMSwgZ2lfcHRy LCB3Mik7CisgICAgfQorCisgIC8qIEZvciBtb2R1bGVzIGluIHNyYyBidXQg bm90IGluIHRndC4gV2UgYWRqdXN0IHRoZSBjb3VudGVyIGFuZCBhcHBlbmQu ICAqLworICBmb3IgKGkgPSAwOyBpIDwgdW5tYXRjaF9pbmZvX2NudDsgaSsr KQorICAgIHsKKyAgICAgIGdpX3B0ciA9IGluX3NyY19ub3RfdGd0W2ldOwor ICAgICAgZ2Nvdl9tZXJnZSAoZ2lfcHRyLCBnaV9wdHIsIHcyIC0gMSk7Cisg ICAgICB0Z3RfdGFpbC0+bmV4dCA9IGdpX3B0cjsKKyAgICAgIHRndF90YWls ID0gZ2lfcHRyOworICAgIH0KKworICByZXR1cm4gMDsKK30KKwordHlwZWRl ZiBnY292X3R5cGUgKCpjb3VudGVyX29wX2ZuKSAoZ2Nvdl90eXBlLCB2b2lk Kiwgdm9pZCopOworCisvKiBQZXJmb3JtaW5nIEZOIHVwb24gYXJjIGNvdW50 ZXJzLiAgKi8KKworc3RhdGljIHZvaWQKK19fZ2Nvdl9hZGRfY291bnRlcl9v cCAoZ2Nvdl90eXBlICpjb3VudGVycywgdW5zaWduZWQgbl9jb3VudGVycywK KyAgICAgICAgICAgICAgICAgICAgICAgY291bnRlcl9vcF9mbiBmbiwgdm9p ZCAqZGF0YTEsIHZvaWQgKmRhdGEyKQoreworICBmb3IgKDsgbl9jb3VudGVy czsgY291bnRlcnMrKywgbl9jb3VudGVycy0tKQorICAgIHsKKyAgICAgIGdj b3ZfdHlwZSB2YWwgPSAqY291bnRlcnM7CisgICAgICAqY291bnRlcnMgPSBm bih2YWwsIGRhdGExLCBkYXRhMik7CisgICAgfQorfQorCisvKiBQZXJmb3Jt aW5nIEZOIHVwb24gaW9yIGNvdW50ZXJzLiAgKi8KKworc3RhdGljIHZvaWQK K19fZ2Nvdl9pb3JfY291bnRlcl9vcCAoZ2Nvdl90eXBlICpjb3VudGVycyBB VFRSSUJVVEVfVU5VU0VELAorICAgICAgICAgICAgICAgICAgICAgICB1bnNp Z25lZCBuX2NvdW50ZXJzIEFUVFJJQlVURV9VTlVTRUQsCisgICAgICAgICAg ICAgICAgICAgICAgIGNvdW50ZXJfb3BfZm4gZm4gQVRUUklCVVRFX1VOVVNF RCwKKyAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqZGF0YTEgQVRUUklC VVRFX1VOVVNFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqZGF0 YTIgQVRUUklCVVRFX1VOVVNFRCkKK3sKKyAgLyogRG8gbm90aGluZy4gICov Cit9CisKKy8qIFBlcmZvcm1pbmcgRk4gdXBvbiB0aW1lLXByb2ZpbGUgY291 bnRlcnMuICAqLworCitzdGF0aWMgdm9pZAorX19nY292X3RpbWVfcHJvZmls ZV9jb3VudGVyX29wIChnY292X3R5cGUgKmNvdW50ZXJzLCB1bnNpZ25lZCBu X2NvdW50ZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj b3VudGVyX29wX2ZuIGZuLCB2b2lkICpkYXRhMSwgdm9pZCAqZGF0YTIpCit7 CisgIF9fZ2Nvdl9hZGRfY291bnRlcl9vcCAoY291bnRlcnMsIG5fY291bnRl cnMsIGZuLCBkYXRhMSwgZGF0YTIpOworfQorCisvKiBQZXJmb3JtYWluZyBG TiB1cG9uIGRlbHRhIGNvdW50ZXJzLiAgKi8KKworc3RhdGljIHZvaWQKK19f Z2Nvdl9kZWx0YV9jb3VudGVyX29wIChnY292X3R5cGUgKmNvdW50ZXJzLCB1 bnNpZ25lZCBuX2NvdW50ZXJzLAorICAgICAgICAgICAgICAgICAgICAgICAg IGNvdW50ZXJfb3BfZm4gZm4sIHZvaWQgKmRhdGExLCB2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gICAgaWYgKCFtZXJn ZSkKKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICBpZiAo ZCA9PSAwKQorICAgICAgICAgICAgICAoKmN0cl9mdW5jdGlvbnNbdF9peF0p IChjaV9wdHItPnZhbHVlcywgY2lfcHRyLT5udW0sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZwX3NjYWxlLCAmc2NhbGVfZmFj dG9yLCBOVUxMKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg KCpjdHJfZnVuY3Rpb25zW3RfaXhdKSAoY2lfcHRyLT52YWx1ZXMsIGNpX3B0 ci0+bnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnRfc2NhbGUsICZuLCAmZCk7CisgICAgICAgICAgICBjaV9wdHIrKzsK KyAgICAgICAgICB9CisgICAgICB9CisKKyAgcmV0dXJuIDA7Cit9CisKKy8q IERyaXZlciB0byBub3JtYWxpemUgcHJvZmlsZSBjb3VudGVycy4gICovCisK K2ludAorZ2Nvdl9wcm9maWxlX25vcm1hbGl6ZSAoc3RydWN0IGdjb3ZfaW5m byAqcHJvZmlsZSwgZ2Nvdl90eXBlIG1heF92YWwpCit7CisgIHN0cnVjdCBn Y292X2luZm8gKmdpX3B0cjsKKyAgZ2Nvdl90eXBlIGN1cnJfbWF4X3ZhbCA9 IDA7CisgIHVuc2lnbmVkIGZfaXg7CisgIHVuc2lnbmVkIGludCBpOworICBm bG9hdCBzY2FsZV9mYWN0b3I7CisKKyAgLyogRmluZCB0aGUgbGFyZ2VzdCBj b3VudCB2YWx1ZS4gICovCisgIGZvciAoZ2lfcHRyID0gcHJvZmlsZTsgZ2lf cHRyOyBnaV9wdHIgPSBnaV9wdHItPm5leHQpCisgICAgZm9yIChmX2l4ID0g MDsgZl9peCA8IGdpX3B0ci0+bl9mdW5jdGlvbnM7IGZfaXgrKykKKyAgICAg IHsKKyAgICAgICAgdW5zaWduZWQgdF9peDsKKyAgICAgICAgY29uc3Qgc3Ry dWN0IGdjb3ZfZm5faW5mbyAqZ2ZpX3B0ciA9IGdpX3B0ci0+ZnVuY3Rpb25z W2ZfaXhdOworICAgICAgICBjb25zdCBzdHJ1Y3QgZ2Nvdl9jdHJfaW5mbyAq Y2lfcHRyOworCisgICAgICAgIGlmICghZ2ZpX3B0ciB8fCBnZmlfcHRyLT5r ZXkgIT0gZ2lfcHRyKQorICAgICAgICAgIGNvbnRpbnVlOworCisgICAgICAg IGNpX3B0ciA9IGdmaV9wdHItPmN0cnM7CisgICAgICAgIGZvciAodF9peCA9 IDA7IHRfaXggPCAxOyB0X2l4KyspCisgICAgICAgICAgeworICAgICAgICAg ICAgZm9yIChpID0gMDsgaSA8IGNpX3B0ci0+bnVtOyBpKyspCisgICAgICAg ICAgICAgIGlmIChjaV9wdHItPnZhbHVlc1tpXSA+IGN1cnJfbWF4X3ZhbCkK KyAgICAgICAgICAgICAgICBjdXJyX21heF92YWwgPSBjaV9wdHItPnZhbHVl c1tpXTsKKyAgICAgICAgICAgIGNpX3B0cisrOworICAgICAgICAgIH0KKyAg ICAgIH0KKworICBzY2FsZV9mYWN0b3IgPSAoZmxvYXQpbWF4X3ZhbCAvIGN1 cnJfbWF4X3ZhbDsKKyAgaWYgKHZlcmJvc2UpCisgICAgZnByaW50ZiAoc3Rk b3V0LCAibWF4X3ZhbCBpcyAlbGxkXG4iLCAobG9uZyBsb25nKSBjdXJyX21h eF92YWwpOworCisgIHJldHVybiBnY292X3Byb2ZpbGVfc2NhbGUgKHByb2Zp bGUsIHNjYWxlX2ZhY3RvciwgMCwgMCk7Cit9CkluZGV4OiBsaWJnY2MvbGli Z2Nvdi5oCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxpYmdjYy9saWJn Y292LmgJKHJldmlzaW9uIDIwOTk4MSkKKysrIGxpYmdjYy9saWJnY292LmgJ KHdvcmtpb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