monotone

monotone Mtn Source Tree

Root/tests/t_unidiff.at

1# -*- Autoconf -*-
2
3AT_SETUP([calculation of unidiffs])
4
5MIMENCODE=`which mimencode 2>/dev/null`
6if test -z "$MIMENCODE" ; then
7 exit 77
8fi
9
10MONOTONE_SETUP
11
12AT_DATA(firstfile.b64, [LyogU3Vicm91dGluZXMgc2hhcmVkIGJ5IGFsbCBsYW5ndWFnZXMgdGhhdCBhcmUgdmFyaWFu
13dHMgb2YgQy4KICAgQ29weXJpZ2h0IChDKSAxOTkyLCA5MywgOTQsIDk1LCA5NiwgMTk5NyBG
14cmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4KClRoaXMgZmlsZSBpcyBwYXJ0IG9mIEdO
15VSBDQy4KCkdOVSBDQyBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBp
16dCBhbmQvb3IgbW9kaWZ5Cml0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwg
17UHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CnRoZSBGcmVlIFNvZnR3YXJlIEZvdW5k
18YXRpb247IGVpdGhlciB2ZXJzaW9uIDIsIG9yIChhdCB5b3VyIG9wdGlvbikKYW55IGxhdGVy
19IHZlcnNpb24uCgpHTlUgQ0MgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3
20aWxsIGJlIHVzZWZ1bCwKYnV0IFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4g
21dGhlIGltcGxpZWQgd2FycmFudHkgb2YKTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9S
22IEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQpHTlUgR2VuZXJhbCBQdWJsaWMgTGlj
23ZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgoKWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkI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Chmb3Jt
330YXRfdHlwZSksCgkJCQkgICAgICJfX3NjYW5mX18iKSkpCgkgICAgICBpc19zY2FuID0gMTsK
331CSAgICBlbHNlIGlmIChUUkVFX0NPREUgKGZvcm1hdF90eXBlKSA9PSBJREVOVElGSUVSX05P
332REUpCgkgICAgICB7CgkJZXJyb3IgKCJgJXMnIGlzIGFuIHVucmVjb2duaXplZCBmb3JtYXQg
333ZnVuY3Rpb24gdHlwZSIsCgkJICAgICAgIElERU5USUZJRVJfUE9JTlRFUiAoZm9ybWF0X3R5
334cGUpKTsKCQljb250aW51ZTsKCSAgICAgIH0KCSAgICBlbHNlCgkgICAgICB7CgkJZXJyb3Ig
335KCJ1bnJlY29nbml6ZWQgZm9ybWF0IHNwZWNpZmllciIpOwoJCWNvbnRpbnVlOwoJICAgICAg
336fQoKCSAgICAvKiBTdHJpcCBhbnkgY29udmVyc2lvbnMgZnJvbSB0aGUgc3RyaW5nIGluZGV4
337IGFuZCBmaXJzdCBhcmcgbnVtYmVyCgkgICAgICAgYW5kIHZlcmlmeSB0aGV5IGFyZSBjb25z
338dGFudHMuICAqLwoJICAgIHdoaWxlIChUUkVFX0NPREUgKGZvcm1hdF9udW1fZXhwcikgPT0g
339Tk9QX0VYUFIKCQkgICB8fCBUUkVFX0NPREUgKGZvcm1hdF9udW1fZXhwcikgPT0gQ09OVkVS
340VF9FWFBSCgkJICAgfHwgVFJFRV9DT0RFIChmb3JtYXRfbnVtX2V4cHIpID09IE5PTl9MVkFM
341VUVfRVhQUikKCSAgICAgIGZvcm1hdF9udW1fZXhwciA9IFRSRUVfT1BFUkFORCAoZm9ybWF0
342X251bV9leHByLCAwKTsKCgkgICAgd2hpbGUgKFRSRUVfQ09ERSAoZmlyc3RfYXJnX251bV9l
343eHByKSA9PSBOT1BfRVhQUgoJCSAgIHx8IFRSRUVfQ09ERSAoZmlyc3RfYXJnX251bV9leHBy
344KSA9PSBDT05WRVJUX0VYUFIKCQkgICB8fCBUUkVFX0NPREUgKGZpcn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SAoZGVjbCksCgkJCQkgICAgaXNfc2NhbiwgZm9ybWF0X251bSwgZmlyc3Rf
375YXJnX251bSk7CgkgICAgYnJlYWs7CgkgIH0KCgljYXNlIEFfRk9STUFUX0FSRzoKCSAgewoJ
376ICAgIHRyZWUgZm9ybWF0X251bV9leHByID0gVFJFRV9WQUxVRSAoYXJncyk7CgkgICAgaW50
377IGZvcm1hdF9udW0sIGFyZ19udW07CgkgICAgdHJlZSBhcmd1bWVudDsKCQoJICAgIGlmIChU
378UkVFX0NPREUgKGRlY2wpICE9IEZVTkNUSU9OX0RFQ0wpCgkgICAgICB7CgkJZXJyb3Jfd2l0
379aF9kZWNsIChkZWNsLAoJCQkgImFyZ3VtZW50IGZvcm1hdCBzcGVjaWZpZWQgZm9yIG5vbi1m
380dW5jdGlvbiBgJXMnIik7CgkJY29udGludWU7CgkgICAgICB9CgkKCSAgICAvKiBTdHJpcCBh
381bnkgY29udmVyc2lvbnMgZnJvbSB0aGUgZmlyc3QgYXJnIG51bWJlciBhbmQgdmVyaWZ5IGl0
382CgkgICAgICAgaXMgYSBjb25zdGFudC4gICovCgkgICAgd2hpbGUgKFRSRUVfQ09ERSAoZm9y
383bWF0X251bV9leHByKSA9PSBOT1BfRVhQUgoJCSAgIHx8IFRSRUVfQ09ERSAoZm9ybWF0X251
384bV9leHByKSA9PSBDT05WRVJUX0VYUFIKCQkgICB8fCBUUkVFX0NPREUgKGZvcm1hdF9udW1f
385ZXhwcikgPT0gTk9OX0xWQUxVRV9FWFBSKQoJICAgICAgZm9ybWF0X251bV9leHByID0gVFJF
386RV9PUEVSQU5EIChmb3JtYXRfbnVtX2V4cHIsIDApOwoKCSAgICBpZiAoVFJFRV9DT0RFIChm
387b3JtYXRfbnVtX2V4cHIpICE9IElOVEVHRVJfQ1NUKQoJICAgICAgewoJCWVycm9yICgiZm9y
388bWF0IHN0cmluZyBoYXMgbm9uLWNvbnN0YW50IG9wZXJhbmQgbnVtYmVyIik7CgkJY29udGlu
389dWU7Cg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Y3MsICpwcmVmaXhfYXR0cmlidXRl
433czsKewogIHRyZWUgdCwgcywgYSwgbmV4dCwgc3BlY3MsIGF0dHJzOwoKICAvKiBUaGlzIGNh
434biBoYXBwZW4gaW4gYysrIChlZzogZGVjbDogdHlwZXNwZWMgaW5pdGRlY2xzICc7JykuICAq
435LwogIGlmIChzcGVjc19hdHRycyAhPSBOVUxMX1RSRUUKICAgICAgJiYgVFJFRV9DT0RFIChz
436cGVjc19hdHRycykgIT0gVFJFRV9MSVNUKQogICAgewogICAgICAqZGVjbHNwZWNzID0gc3Bl
437Y3NfYXR0cnM7CiAgICAgICpwcmVmaXhfYXR0cmlidXRlcyA9IE5VTExfVFJFRTsKICAgICAg
438cmV0dXJuOwogICAgfQoKICAvKiBSZW1lbWJlciB0byBrZWVwIHRoZSBsaXN0cyBpbiB0aGUg
439c2FtZSBvcmRlciwgZWxlbWVudC13aXNlLiAgKi8KCiAgc3BlY3MgPSBzID0gTlVMTF9UUkVF
440OwogIGF0dHJzID0gYSA9IE5VTExfVFJFRTsKICBmb3IgKHQgPSBzcGVjc19hdHRyczsgdDsg
441dCA9IG5leHQpCiAgICB7CiAgICAgIG5leHQgPSBUUkVFX0NIQUlOICh0KTsKICAgICAgLyog
442RGVjbHNwZWNzIGhhdmUgYSBub24tTlVMTCBUUkVFX1ZBTFVFLiAgKi8KICAgICAgaWYgKFRS
443RUVfVkFMVUUgKHQpICE9IE5VTExfVFJFRSkKCXsKCSAgaWYgKHNwZWNzID09IE5VTExfVFJF
444RSkKCSAgICBzcGVjcyA9IHMgPSB0OwoJICBlbHNlCgkgICAgewoJICAgICAgVFJFRV9DSEFJ
445TiAocykgPSB0OwoJICAgICAgcyA9IHQ7CgkgICAgfQoJfQogICAgICBlbHNlCgl7CgkgIGlm
446IChhdHRycyA9PSBOVUxMX1RSRUUpCgkgICAgYXR0cnMgPSBhID0gVFJFRV9QVVJQT1NFICh0
447KTsKCSAgZWxzZQoJICAgIHsKCSAgICAgIFRSRUVfQ0h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1Y3R1cmUuCiAgIFBBUkFNUyBp
607cyB0aGUgbGlzdCBvZiBhcmd1bWVudCB2YWx1ZXMuICAqLwoKc3RhdGljIHZvaWQKY2hlY2tf
608Zm9ybWF0X2luZm8gKGluZm8sIHBhcmFtcykKICAgICBmdW5jdGlvbl9mb3JtYXRfaW5mbyAq
609aW5mbzsKICAgICB0cmVlIHBhcmFtczsKewogIGludCBpOwogIGludCBhcmdfbnVtOwogIGlu
610dCBzdXBwcmVzc2VkLCB3aWRlLCBwcmVjaXNlOwogIGludCBsZW5ndGhfY2hhcjsKICBpbnQg
611Zm9ybWF0X2NoYXI7CiAgaW50IGZvcm1hdF9sZW5ndGg7CiAgdHJlZSBmb3JtYXRfdHJlZTsK
612ICB0cmVlIGN1cl9wYXJhbTsKICB0cmVlIGN1cl90eXBlOwogIHRyZWUgd2FudGVkX3R5cGU7
613CiAgdHJlZSBmaXJzdF9maWxsaW5fcGFyYW07CiAgY2hhciAqZm9ybWF0X2NoYXJzOwogIGZv
614cm1hdF9jaGFyX2luZm8gKmZjaTsKICBzdGF0aWMgY2hhciBtZXNzYWdlWzEzMl07CiAgY2hh
615ciBmbGFnX2NoYXJzWzhdOwogIGludCBoYXNfb3BlcmFuZF9udW1iZXIgPSAwOwoKICAvKiBT
616a2lwIHRvIGZvcm1hdCBhcmd1bWVudC4gIElmIHRoZSBhcmd1bWVudCBpc24ndCBhdmFpbGFi
617bGUsIHRoZXJlJ3MKICAgICBubyB3b3JrIGZvciB1cyB0byBkbzsgcHJvdG90eXBlIGNoZWNr
618aW5nIHdpbGwgY2F0Y2ggdGhlIHByb2JsZW0uICAqLwogIGZvciAoYXJnX251bSA9IDE7IDsg
619KythcmdfbnVtKQogICAgewogICAgICBpZiAocGFyYW1zID09IDApCglyZXR1cm47CiAgICAg
620IGlmIChhcmdfbnVtID09IGluZm8tPmZvcm1hdF9udW0pCglicmVhazsKICAgICAgcGFyYW1z
621ID0gVFJFRV9DSEFJTiAocGFyYW1zKTsKICAgIH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gYXN0ZXJpc2suCgkJIEluIHRoaXMgY2FzZSwgYW4gaW50IGFyZ3VtZW50
725IHN1cHBsaWVzIHRoZS4uLnByZWNpc2lvbi4iICAqLwoJICAgICAgaWYgKCpmb3JtYXRfY2hh
726cnMgPT0gJyonKQoJCXsKCQkgIGlmIChpbmZvLT5maXJzdF9hcmdfbnVtICE9IDApCgkJICAg
727IHsKCQkgICAgICArK2Zvcm1hdF9jaGFyczsKCQkgICAgICBpZiAocGFyYW1zID09IDApCgkJ
728ICAgICAgICB7CgkJCSAgd2FybmluZyAodGZhZmYpOwoJCQkgIHJldHVybjsKCQkJfQoJCSAg
729ICAgIGN1cl9wYXJhbSA9IFRSRUVfVkFMVUUgKHBhcmFtcyk7CgkJICAgICAgcGFyYW1zID0g
730VFJFRV9DSEFJTiAocGFyYW1zKTsKCQkgICAgICArK2FyZ19udW07CgkJICAgICAgaWYgKFRZ
731UEVfTUFJTl9WQVJJQU5UIChUUkVFX1RZUEUgKGN1cl9wYXJhbSkpCgkJCSAgIT0gaW50ZWdl
732cl90eXBlX25vZGUpCgkJICAgICAgICB7CgkJICAgICAgICAgIHNwcmludGYgKG1lc3NhZ2Us
733CgkJCQkgICAiZmllbGQgd2lkdGggaXMgbm90IHR5cGUgaW50IChhcmcgJWQpIiwKCQkJCSAg
734IGFyZ19udW0pOwoJCSAgICAgICAgICB3YXJuaW5nIChtZXNzYWdlKTsKCQkgICAgICAgIH0K
735CQkgICAgfQoJCX0KCSAgICAgIGVsc2UKCQl7CgkJICB3aGlsZSAoaXNkaWdpdCAoKmZvcm1h
736dF9jaGFycykpCgkJICAgICsrZm9ybWF0X2NoYXJzOwoJCX0KCSAgICB9Cgl9CiAgICAgIGlm
737ICgqZm9ybWF0X2NoYXJzID09ICdoJyB8fCAqZm9ybWF0X2NoYXJzID09ICdsJykKCWxlbmd0
738aF9jaGFyID0gKmZvcm1hdF9jaGFycysrOwogICAgICBlbHNlIGlmICgqZm9ybWF0X2NoYXJz
739ID09ICdxJy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WYgKGluZm8tPmZpcnN0X2FyZ19udW0gPT0gMCkKCWNvbnRpbnVlOwogICAgICBpZiAoZmNp
813LT5wb2ludGVyX2NvdW50ID09IDAgJiYgd2FudGVkX3R5cGUgPT0gdm9pZF90eXBlX25vZGUp
814CgkvKiBUaGlzIHNwZWNpZmllciB0YWtlcyBubyBhcmd1bWVudC4gICovCgljb250aW51ZTsK
815ICAgICAgaWYgKHBhcmFtcyA9PSAwKQoJewoJICB3YXJuaW5nICh0ZmFmZik7CgkgIHJldHVy
816bjsKCX0KICAgICAgY3VyX3BhcmFtID0gVFJFRV9WQUxVRSAocGFyYW1zKTsKICAgICAgcGFy
817YW1zID0gVFJFRV9DSEFJTiAocGFyYW1zKTsKICAgICAgKythcmdfbnVtOwogICAgICBjdXJf
818dHlwZSA9IFRSRUVfVFlQRSAoY3VyX3BhcmFtKTsKCiAgICAgIC8qIENoZWNrIHRoZSB0eXBl
819cyBvZiBhbnkgYWRkaXRpb25hbCBwb2ludGVyIGFyZ3VtZW50cwoJIHRoYXQgcHJlY2VkZSB0
820aGUgInJlYWwiIGFyZ3VtZW50LiAgKi8KICAgICAgZm9yIChpID0gMDsgaSA8IGZjaS0+cG9p
821bnRlcl9jb3VudCArIGFmbGFnOyArK2kpCgl7CgkgIGlmIChUUkVFX0NPREUgKGN1cl90eXBl
822KSA9PSBQT0lOVEVSX1RZUEUpCgkgICAgewoJICAgICAgY3VyX3R5cGUgPSBUUkVFX1RZUEUg
823KGN1cl90eXBlKTsKCSAgICAgIGNvbnRpbnVlOwoJICAgIH0KCSAgaWYgKFRSRUVfQ09ERSAo
824Y3VyX3R5cGUpICE9IEVSUk9SX01BUkspCgkgICAgewoJICAgICAgc3ByaW50ZiAobWVzc2Fn
825ZSwKCQkgICAgICAgImZvcm1hdCBhcmd1bWVudCBpcyBub3QgYSAlcyAoYXJnICVkKSIsCgkJ
826ICAgICAgICgoZmNpLT5wb2ludGVyX2NvdW50ICsgYWZsYWcgPT0gMSkKCQkJPyAicG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25nX2xvbmdfaW50ZWdlcl90eXBlX25vZGU7CgogIGlmIChtb2RlID09IFRZ
1004UEVfTU9ERSAoaW50UUlfdHlwZV9ub2RlKSkKICAgIHJldHVybiB1bnNpZ25lZHAgPyB1bnNp
1005Z25lZF9pbnRRSV90eXBlX25vZGUgOiBpbnRRSV90eXBlX25vZGU7CgogIGlmIChtb2RlID09
1006IFRZUEVfTU9ERSAoaW50SElfdHlwZV9ub2RlKSkKICAgIHJldHVybiB1bnNpZ25lZHAgPyB1
1007bnNpZ25lZF9pbnRISV90eXBlX25vZGUgOiBpbnRISV90eXBlX25vZGU7CgogIGlmIChtb2Rl
1008ID09IFRZUEVfTU9ERSAoaW50U0lfdHlwZV9ub2RlKSkKICAgIHJldHVybiB1bnNpZ25lZHAg
1009PyB1bnNpZ25lZF9pbnRTSV90eXBlX25vZGUgOiBpbnRTSV90eXBlX25vZGU7CgogIGlmICht
1010b2RlID09IFRZUEVfTU9ERSAoaW50RElfdHlwZV9ub2RlKSkKICAgIHJldHVybiB1bnNpZ25l
1011ZHAgPyB1bnNpZ25lZF9pbnRESV90eXBlX25vZGUgOiBpbnRESV90eXBlX25vZGU7CgogIGlm
1012IChtb2RlID09IFRZUEVfTU9ERSAoZmxvYXRfdHlwZV9ub2RlKSkKICAgIHJldHVybiBmbG9h
1013dF90eXBlX25vZGU7CgogIGlmIChtb2RlID09IFRZUEVfTU9ERSAoZG91YmxlX3R5cGVfbm9k
1014ZSkpCiAgICByZXR1cm4gZG91YmxlX3R5cGVfbm9kZTsKCiAgaWYgKG1vZGUgPT0gVFlQRV9N
1015T0RFIChsb25nX2RvdWJsZV90eXBlX25vZGUpKQogICAgcmV0dXJuIGxvbmdfZG91YmxlX3R5
1016cGVfbm9kZTsKCiAgaWYgKG1vZGUgPT0gVFlQRV9NT0RFIChidWlsZF9wb2ludGVyX3R5cGUg
1017KGNoYXJfdHlwZV9ub2RlKSkpCiAgICByZXR1cm4gYnVpbGRfcG9pbnRlcl90eXBlIChjaGF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GNoYXIgKil4cmVhbGxvYyAoZGlyZWN0aXZlX2J1ZmZlciwgYnVmZmVyX2xlbmd0
1393aCk7CgkgIHAgPSAmZGlyZWN0aXZlX2J1ZmZlcltieXRlc191c2VkXTsKCSAgYnVmZmVyX2xp
1394bWl0ID0gJmRpcmVjdGl2ZV9idWZmZXJbYnVmZmVyX2xlbmd0aF07CiAgICAgICAgfQoKICAg
1395ICAgYyA9IGdldGMgKGZpbnB1dCk7CgogICAgICAvKiBEaXNjYXJkIGluaXRpYWwgd2hpdGVz
1396cGFjZS4gICovCiAgICAgIGlmICgoYyA9PSAnICcgfHwgYyA9PSAnXHQnKSAmJiBwID09IGRp
1397cmVjdGl2ZV9idWZmZXIpCgljb250aW51ZTsKCiAgICAgIC8qIERldGVjdCB0aGUgZW5kIG9m
1398IHRoZSBkaXJlY3RpdmUuICAqLwogICAgICBpZiAobG9va2luZ19mb3IgPT0gMAoJICAmJiAo
1399YyA9PSAnXG4nIHx8IGMgPT0gRU9GKSkKCXsKICAgICAgICAgIHVuZ2V0YyAoYywgZmlucHV0
1400KTsKCSAgYyA9ICdcMCc7Cgl9CgogICAgICAqcCsrID0gYzsKCiAgICAgIGlmIChjID09IDAp
1401CglyZXR1cm4gZGlyZWN0aXZlX2J1ZmZlcjsKCiAgICAgIC8qIEhhbmRsZSBzdHJpbmcgYW5k
1402IGNoYXJhY3RlciBjb25zdGFudCBzeW50YXguICAqLwogICAgICBpZiAobG9va2luZ19mb3Ip
1403Cgl7CgkgIGlmIChsb29raW5nX2ZvciA9PSBjICYmICFjaGFyX2VzY2FwZWQpCgkgICAgbG9v
1404a2luZ19mb3IgPSAwOwkvKiBGb3VuZCB0ZXJtaW5hdG9yLi4uIHN0b3AgbG9va2luZy4gICov
1405Cgl9CiAgICAgIGVsc2UKICAgICAgICBpZiAoYyA9PSAnXCcnIHx8IGMgPT0gJyInKQoJICBs
1406b29raW5nX2ZvciA9IGM7CS8qIERvbid0IHN0b3AgYnVmZmVyaW5nIHVudGl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466Z25lZF9saXRlcmFsX3R5cGVfbm9kZQogICAgICAgICAgICAgICAgICAgICA6IHdpZGVzdF9p
2467bnRlZ2VyX2xpdGVyYWxfdHlwZV9ub2RlOwoKICBpZiAobW9kZSA9PSBRSW1vZGUpCiAgICBy
2468ZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfaW50UUlfdHlwZV9ub2RlIDogaW50UUlfdHlw
2469ZV9ub2RlOwoKICBpZiAobW9kZSA9PSBISW1vZGUpCiAgICByZXR1cm4gdW5zaWduZWRwID8g
2470dW5zaWduZWRfaW50SElfdHlwZV9ub2RlIDogaW50SElfdHlwZV9ub2RlOwoKICBpZiAobW9k
2471ZSA9PSBTSW1vZGUpCiAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfaW50U0lfdHlw
2472ZV9ub2RlIDogaW50U0lfdHlwZV9ub2RlOwoKICBpZiAobW9kZSA9PSBESW1vZGUpCiAgICBy
2473ZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfaW50RElfdHlwZV9ub2RlIDogaW50RElfdHlw
2474ZV9ub2RlOwoKI2lmIEhPU1RfQklUU19QRVJfV0lERV9JTlQgPj0gNjQKICBpZiAobW9kZSA9
2475PSBUWVBFX01PREUgKGludFRJX3R5cGVfbm9kZSkpCiAgICByZXR1cm4gdW5zaWduZWRwID8g
2476dW5zaWduZWRfaW50VElfdHlwZV9ub2RlIDogaW50VElfdHlwZV9ub2RlOwojZW5kaWYKCiAg
2477aWYgKG1vZGUgPT0gVFlQRV9NT0RFIChmbG9hdF90eXBlX25vZGUpKQogICAgcmV0dXJuIGZs
2478b2F0X3R5cGVfbm9kZTsKCiAgaWYgKG1vZGUgPT0gVFlQRV9NT0RFIChkb3VibGVfdHlwZV9u
2479b2RlKSkKICAgIHJldHVybiBkb3VibGVfdHlwZV9ub2RlOwoKICBpZiAobW9kZSA9PSBUWVBF
2480X01PREUgKGxvbmdfZG91YmxlX3R5cGVfbm9kZSkpCiAgICByZXR1cm4gbG9uZ19kb3VibGVf
2481dHlwZV9ub2RlOwoKICBpZiAobW9kZSA9PSBUWVBFX01PREUgKGJ1aWxkX3BvaW50ZXJfdHlw
2482ZSAoY2hhcl90eXBlX25vZGUpKSkKICAgIHJldHVybiBidWlsZF9wb2ludGVyX3R5cGUgKGNo
2483YXJfdHlwZV9ub2RlKTsKCiAgaWYgKG1vZGUgPT0gVFlQRV9NT0RFIChidWlsZF9wb2ludGVy
2484X3R5cGUgKGludGVnZXJfdHlwZV9ub2RlKSkpCiAgICByZXR1cm4gYnVpbGRfcG9pbnRlcl90
2485eXBlIChpbnRlZ2VyX3R5cGVfbm9kZSk7CgogIHN3aXRjaCAobW9kZSkKICAgIHsKICAgIGNh
2486c2UgVjE2UUltb2RlOgogICAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfVjE2UUlf
2487dHlwZV9ub2RlIDogVjE2UUlfdHlwZV9ub2RlOwogICAgY2FzZSBWOEhJbW9kZToKICAgICAg
2488cmV0dXJuIHVuc2lnbmVkcCA/IHVuc2lnbmVkX1Y4SElfdHlwZV9ub2RlIDogVjhISV90eXBl
2489X25vZGU7CiAgICBjYXNlIFY0U0ltb2RlOgogICAgICByZXR1cm4gdW5zaWduZWRwID8gdW5z
2490aWduZWRfVjRTSV90eXBlX25vZGUgOiBWNFNJX3R5cGVfbm9kZTsKICAgIGNhc2UgVjJESW1v
2491ZGU6CiAgICAgIHJldHVybiB1bnNpZ25lZHAgPyB1bnNpZ25lZF9WMkRJX3R5cGVfbm9kZSA6
2492IFYyRElfdHlwZV9ub2RlOwogICAgY2FzZSBWMlNJbW9kZToKICAgICAgcmV0dXJuIHVuc2ln
2493bmVkcCA/IHVuc2lnbmVkX1YyU0lfdHlwZV9ub2RlIDogVjJTSV90eXBlX25vZGU7CiAgICBj
2494YXNlIFYySEltb2RlOgogICAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfVjJISV90
2495eXBlX25vZGUgOiBWMkhJX3R5cGVfbm9kZTsKICAgIGNhc2UgVjRISW1vZGU6CiAgICAgIHJl
2496dHVybiB1bnNpZ25lZHAgPyB1bnNpZ25lZF9WNEhJX3R5cGVfbm9kZSA6IFY0SElfdHlwZV9u
2497b2RlOwogICAgY2FzZSBWOFFJbW9kZToKICAgICAgcmV0dXJuIHVuc2lnbmVkcCA/IHVuc2ln
2498bmVkX1Y4UUlfdHlwZV9ub2RlIDogVjhRSV90eXBlX25vZGU7CiAgICBjYXNlIFYxREltb2Rl
2499OgogICAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfVjFESV90eXBlX25vZGUgOiBW
2500MURJX3R5cGVfbm9kZTsKICAgIGNhc2UgVjE2U0Ztb2RlOgogICAgICByZXR1cm4gVjE2U0Zf
2501dHlwZV9ub2RlOwogICAgY2FzZSBWNFNGbW9kZToKICAgICAgcmV0dXJuIFY0U0ZfdHlwZV9u
2502b2RlOwogICAgY2FzZSBWMlNGbW9kZToKICAgICAgcmV0dXJuIFYyU0ZfdHlwZV9ub2RlOwog
2503ICAgY2FzZSBWMkRGbW9kZToKICAgICAgcmV0dXJuIFYyREZfdHlwZV9ub2RlOwogICAgZGVm
2504YXVsdDoKICAgICAgYnJlYWs7CiAgICB9CgogIHJldHVybiAwOwp9CgovKiBSZXR1cm4gYW4g
2505dW5zaWduZWQgdHlwZSB0aGUgc2FtZSBhcyBUWVBFIGluIG90aGVyIHJlc3BlY3RzLiAgKi8K
2506dHJlZQpjX2NvbW1vbl91bnNpZ25lZF90eXBlICh0cmVlIHR5cGUpCnsKICB0cmVlIHR5cGUx
2507ID0gVFlQRV9NQUlOX1ZBUklBTlQgKHR5cGUpOwogIGlmICh0eXBlMSA9PSBzaWduZWRfY2hh
2508cl90eXBlX25vZGUgfHwgdHlwZTEgPT0gY2hhcl90eXBlX25vZGUpCiAgICByZXR1cm4gdW5z
2509aWduZWRfY2hhcl90eXBlX25vZGU7CiAgaWYgKHR5cGUxID09IGludGVnZXJfdHlwZV9ub2Rl
2510KQog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ICh0eXBlKSA9PSBUWVBFX1BS
2568RUNJU0lPTiAoaW50VElfdHlwZV9ub2RlKSkKICAgIHJldHVybiB1bnNpZ25lZHAgPyB1bnNp
2569Z25lZF9pbnRUSV90eXBlX25vZGUgOiBpbnRUSV90eXBlX25vZGU7CiNlbmRpZgogIGlmIChU
2570WVBFX1BSRUNJU0lPTiAodHlwZSkgPT0gVFlQRV9QUkVDSVNJT04gKGludERJX3R5cGVfbm9k
2571ZSkpCiAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfaW50RElfdHlwZV9ub2RlIDog
2572aW50RElfdHlwZV9ub2RlOwogIGlmIChUWVBFX1BSRUNJU0lPTiAodHlwZSkgPT0gVFlQRV9Q
2573UkVDSVNJT04gKGludFNJX3R5cGVfbm9kZSkpCiAgICByZXR1cm4gdW5zaWduZWRwID8gdW5z
2574aWduZWRfaW50U0lfdHlwZV9ub2RlIDogaW50U0lfdHlwZV9ub2RlOwogIGlmIChUWVBFX1BS
2575RUNJU0lPTiAodHlwZSkgPT0gVFlQRV9QUkVDSVNJT04gKGludEhJX3R5cGVfbm9kZSkpCiAg
2576ICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRfaW50SElfdHlwZV9ub2RlIDogaW50SElf
2577dHlwZV9ub2RlOwogIGlmIChUWVBFX1BSRUNJU0lPTiAodHlwZSkgPT0gVFlQRV9QUkVDSVNJ
2578T04gKGludFFJX3R5cGVfbm9kZSkpCiAgICByZXR1cm4gdW5zaWduZWRwID8gdW5zaWduZWRf
2579aW50UUlfdHlwZV9ub2RlIDogaW50UUlfdHlwZV9ub2RlOwoKICByZXR1cm4gdHlwZTsKfQoM
2580Ci8qIFJldHVybiB0aGUgbWluaW11bSBudW1iZXIgb2YgYml0cyBuZWVkZWQgdG8gcmVwcmVz
2581ZW50IFZBTFVFIGluIGEKICAgc2lnbmVkIG9yIHVuc2lnbmVkIHR5cGUsIFVOU0lHTkVEUCBz
2582YXlzIHdoaWNoLiAgKi8KCnV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RoIG9wZXJhdGlvbgogICBDT0RFLiAg
2597Tk9QX0VYUFIgaXMgdXNlZCBhcyBhIHNwZWNpYWwgY2FzZSAoc2VlCiAgIGNfY29tbW9uX3Ry
2598dXRodmFsdWVfY29udmVyc2lvbikuICAqLwoKdm9pZApiaW5hcnlfb3BfZXJyb3IgKGVudW0g
2599dHJlZV9jb2RlIGNvZGUpCnsKICBjb25zdCBjaGFyICpvcG5hbWU7CgogIHN3aXRjaCAoY29k
2600ZSkKICAgIHsKICAgIGNhc2UgTk9QX0VYUFI6CiAgICAgIGVycm9yICgiaW52YWxpZCB0cnV0
2601aC12YWx1ZSBleHByZXNzaW9uIik7CiAgICAgIHJldHVybjsKCiAgICBjYXNlIFBMVVNfRVhQ
2602UjoKICAgICAgb3BuYW1lID0gIisiOyBicmVhazsKICAgIGNhc2UgTUlOVVNfRVhQUjoKICAg
2603ICAgb3BuYW1lID0gIi0iOyBicmVhazsKICAgIGNhc2UgTVVMVF9FWFBSOgogICAgICBvcG5h
2604bWUgPSAiKiI7IGJyZWFrOwogICAgY2FzZSBNQVhfRVhQUjoKICAgICAgb3BuYW1lID0gIm1h
2605eCI7IGJyZWFrOwogICAgY2FzZSBNSU5fRVhQUjoKICAgICAgb3BuYW1lID0gIm1pbiI7IGJy
2606ZWFrOwogICAgY2FzZSBFUV9FWFBSOgogICAgICBvcG5hbWUgPSAiPT0iOyBicmVhazsKICAg
2607IGNhc2UgTkVfRVhQUjoKICAgICAgb3BuYW1lID0gIiE9IjsgYnJlYWs7CiAgICBjYXNlIExF
2608X0VYUFI6CiAgICAgIG9wbmFtZSA9ICI8PSI7IGJyZWFrOwogICAgY2FzZSBHRV9FWFBSOgog
2609ICAgICBvcG5hbWUgPSAiPj0iOyBicmVhazsKICAgIGNhc2UgTFRfRVhQUjoKICAgICAgb3Bu
2610YW1lID0gIjwiOyBicmVhazsKICAgIGNhc2UgR1RfRVhQUjoKICAgICAgb3BuYW1lID0gIj4i
2611OyBicmVhazsKICAgIGNhc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gX19hbGlnbm9mIGtleXdvcmQ6IFJldHVybiB0aGUg
3116bWluaW11bSByZXF1aXJlZAogICBhbGlnbm1lbnQgb2YgRVhQUiwgbWVhc3VyZWQgaW4gYnl0
3117ZXMuICBGb3IgVkFSX0RFQ0wncyBhbmQKICAgRklFTERfREVDTCdzIHJldHVybiBERUNMX0FM
3118SUdOICh3aGljaCBjYW4gYmUgc2V0IGZyb20gYW4KICAgImFsaWduZWQiIF9fYXR0cmlidXRl
3119X18gc3BlY2lmaWNhdGlvbikuICAqLwoKdHJlZQpjX2FsaWdub2ZfZXhwciAodHJlZSBleHBy
3120KQp7CiAgdHJlZSB0OwoKICBpZiAoVFJFRV9DT0RFIChleHByKSA9PSBWQVJfREVDTCkKICAg
3121IHQgPSBzaXplX2ludCAoREVDTF9BTElHTiAoZXhwcikgLyBCSVRTX1BFUl9VTklUKTsKCiAg
3122ZWxzZSBpZiAoVFJFRV9DT0RFIChleHByKSA9PSBDT01QT05FTlRfUkVGCgkgICAmJiBERUNM
3123X0NfQklUX0ZJRUxEIChUUkVFX09QRVJBTkQgKGV4cHIsIDEpKSkKICAgIHsKICAgICAgZXJy
3124b3IgKCJgX19hbGlnbm9mJyBhcHBsaWVkIHRvIGEgYml0LWZpZWxkIik7CiAgICAgIHQgPSBz
3125aXplX29uZV9ub2RlOwogICAgfQogIGVsc2UgaWYgKFRSRUVfQ09ERSAoZXhwcikgPT0gQ09N
3126UE9ORU5UX1JFRgoJICAgJiYgVFJFRV9DT0RFIChUUkVFX09QRVJBTkQgKGV4cHIsIDEpKSA9
3127PSBGSUVMRF9ERUNMKQogICAgdCA9IHNpemVfaW50IChERUNMX0FMSUdOIChUUkVFX09QRVJB
3128TkQgKGV4cHIsIDEpKSAvIEJJVFNfUEVSX1VOSVQpOwoKICBlbHNlIGlmIChUUkVFX0NPREUg
3129KGV4cHIpID09IElORElSRUNUX1JFRikKICAgIHsKICAgICAgdHJlZSB0ID0gVFJFRV9PUEVS
3130QU5EIChleHByLCAwK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fVU5TSUdORUQsICJ1bnNpZ25lZCBpbnQiLCB1bnNp
3188Z25lZF90eXBlX25vZGUpOwogIHJlY29yZF9idWlsdGluX3R5cGUgKFJJRF9NQVgsICJsb25n
3189IHVuc2lnbmVkIGludCIsCgkJICAgICAgIGxvbmdfdW5zaWduZWRfdHlwZV9ub2RlKTsKICBp
3190ZiAoY19kaWFsZWN0X2N4eCAoKSkKICAgIHJlY29yZF9idWlsdGluX3R5cGUgKFJJRF9NQVgs
3191ICJ1bnNpZ25lZCBsb25nIiwgbG9uZ191bnNpZ25lZF90eXBlX25vZGUpOwogIHJlY29yZF9i
3192dWlsdGluX3R5cGUgKFJJRF9NQVgsICJsb25nIGxvbmcgaW50IiwKCQkgICAgICAgbG9uZ19s
3193b25nX2ludGVnZXJfdHlwZV9ub2RlKTsKICByZWNvcmRfYnVpbHRpbl90eXBlIChSSURfTUFY
3194LCAibG9uZyBsb25nIHVuc2lnbmVkIGludCIsCgkJICAgICAgIGxvbmdfbG9uZ191bnNpZ25l
3195ZF90eXBlX25vZGUpOwogIGlmIChjX2RpYWxlY3RfY3h4ICgpKQogICAgcmVjb3JkX2J1aWx0
3196aW5fdHlwZSAoUklEX01BWCwgImxvbmcgbG9uZyB1bnNpZ25lZCIsCgkJCSBsb25nX2xvbmdf
3197dW5zaWduZWRfdHlwZV9ub2RlKTsKICByZWNvcmRfYnVpbHRpbl90eXBlIChSSURfU0hPUlQs
3198ICJzaG9ydCBpbnQiLCBzaG9ydF9pbnRlZ2VyX3R5cGVfbm9kZSk7CiAgcmVjb3JkX2J1aWx0
3199aW5fdHlwZSAoUklEX01BWCwgInNob3J0IHVuc2lnbmVkIGludCIsCgkJICAgICAgIHNob3J0
3200X3Vuc2lnbmVkX3R5cGVfbm9kZSk7CiAgaWYgKGNfZGlhbGVjdF9jeHggKCkpCiAgICByZWNv
3201cmRfYnVpbHRpbl90eXBlIChSSURfTUFYLCAidW5zaWduZWQgc2hvcnQiLAoJCQkgc2hvcnRf
3202dW5z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CJgJXMn
4248IGF0dHJpYnV0ZSBpZ25vcmVkIiwgSURFTlRJRklFUl9QT0lOVEVSIChuYW1lKSk7CiAgZWxz
4249ZQogICAgewogICAgICBpbnQgajsKICAgICAgY29uc3QgY2hhciAqcCA9IElERU5USUZJRVJf
4250UE9JTlRFUiAoVFJFRV9WQUxVRSAoYXJncykpOwogICAgICBpbnQgbGVuID0gc3RybGVuIChw
4251KTsKICAgICAgZW51bSBtYWNoaW5lX21vZGUgbW9kZSA9IFZPSURtb2RlOwogICAgICB0cmVl
4252IHR5cGVmbTsKICAgICAgdHJlZSBwdHJfdHlwZTsKCiAgICAgIGlmIChsZW4gPiA0ICYmIHBb
4253MF0gPT0gJ18nICYmIHBbMV0gPT0gJ18nCgkgICYmIHBbbGVuIC0gMV0gPT0gJ18nICYmIHBb
4254bGVuIC0gMl0gPT0gJ18nKQoJewoJICBjaGFyICpuZXdwID0gKGNoYXIgKikgYWxsb2NhIChs
4255ZW4gLSAxKTsKCgkgIHN0cmNweSAobmV3cCwgJnBbMl0pOwoJICBuZXdwW2xlbiAtIDRdID0g
4256J1wwJzsKCSAgcCA9IG5ld3A7Cgl9CgogICAgICAvKiBDaGFuZ2UgdGhpcyB0eXBlIHRvIGhh
4257dmUgYSB0eXBlIHdpdGggdGhlIHNwZWNpZmllZCBtb2RlLgoJIEZpcnN0IGNoZWNrIGZvciB0
4258aGUgc3BlY2lhbCBtb2Rlcy4gICovCiAgICAgIGlmICghIHN0cmNtcCAocCwgImJ5dGUiKSkK
4259CW1vZGUgPSBieXRlX21vZGU7CiAgICAgIGVsc2UgaWYgKCFzdHJjbXAgKHAsICJ3b3JkIikp
4260Cgltb2RlID0gd29yZF9tb2RlOwogICAgICBlbHNlIGlmICghIHN0cmNtcCAocCwgInBvaW50
4261ZXIiKSkKCW1vZGUgPSBwdHJfbW9kZTsKICAgICAgZWxzZQoJZm9yIChqID0gMDsgaiA8IE5V
4262TV9NQUNISU5FX01PREVTOyBqKyspCgkgIGlmICghc3R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
4320ICBkZWNsID0gKm5vZGU7CiAgICAgIHR5cGUgPSAmVFJFRV9UWVBFIChkZWNsKTsKICAgICAg
4321aXNfdHlwZSA9IFRSRUVfQ09ERSAoKm5vZGUpID09IFRZUEVfREVDTDsKICAgIH0KICBlbHNl
4322IGlmIChUWVBFX1AgKCpub2RlKSkKICAgIHR5cGUgPSBub2RlLCBpc190eXBlID0gMTsKCiAg
4323LyogU3RyaXAgYW55IE5PUHMgb2YgYW55IGtpbmQuICAqLwogIHdoaWxlIChUUkVFX0NPREUg
4324KGFsaWduX2V4cHIpID09IE5PUF9FWFBSCgkgfHwgVFJFRV9DT0RFIChhbGlnbl9leHByKSA9
4325PSBDT05WRVJUX0VYUFIKCSB8fCBUUkVFX0NPREUgKGFsaWduX2V4cHIpID09IE5PTl9MVkFM
4326VUVfRVhQUikKICAgIGFsaWduX2V4cHIgPSBUUkVFX09QRVJBTkQgKGFsaWduX2V4cHIsIDAp
4327OwoKICBpZiAoVFJFRV9DT0RFIChhbGlnbl9leHByKSAhPSBJTlRFR0VSX0NTVCkKICAgIHsK
4328ICAgICAgZXJyb3IgKCJyZXF1ZXN0ZWQgYWxpZ25tZW50IGlzIG5vdCBhIGNvbnN0YW50Iik7
4329CiAgICAgICpub19hZGRfYXR0cnMgPSB0cnVlOwogICAgfQogIGVsc2UgaWYgKChpID0gdHJl
4330ZV9sb2cyIChhbGlnbl9leHByKSkgPT0gLTEpCiAgICB7CiAgICAgIGVycm9yICgicmVxdWVz
4331dGVkIGFsaWdubWVudCBpcyBub3QgYSBwb3dlciBvZiAyIik7CiAgICAgICpub19hZGRfYXR0
4332cnMgPSB0cnVlOwogICAgfQogIGVsc2UgaWYgKGkgPiBIT1NUX0JJVFNfUEVSX0lOVCAtIDIp
4333CiAgICB7CiAgICAgIGVycm9yICgicmVxdWVzdGVkIGFsaWdubWVudCBpcyB0b28gbGFyZ2Ui
4334KTsKICAgICAgKm5vX2FkZF9hdHRycyA9IHRydWU7CiAgICB9CiAgZWxz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