diff --git a/tools/clean_asm.py b/tools/clean_asm.py
index 24aadd3..03d0286 100644
--- a/tools/clean_asm.py
+++ b/tools/clean_asm.py
@@ -1,29 +1,31 @@
import argparse
import re
-def main():
+def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("path", type=str, help="Input file path")
- #parser.add_argument("--abi", type=str, default="", help="Optionaler String (Standard: '')")
args = parser.parse_args()
regex = r"(\:\n)(.*?)(^[^\n]+\n[^\n]+result_.*?\n\n)"
- subst = "\\g<1>\\g<2>\\g<3>"
+ subst = "\\g<1>\\g<2>\\g<3>"
with open(args.path, 'rt') as f:
text = f.read()
outp_flag = "Disassembly of section .text" not in text
+ text = text.replace('\t', ' ' * 4)
text = text.replace('>', '>')
text = text.replace('<', '<')
text = re.sub(regex, subst, text, 0, re.MULTILINE | re.DOTALL)
+ text = re.sub(r" +", " ", text, 0, re.MULTILINE | re.DOTALL)
+
print('')
for line in text.splitlines():
if outp_flag:
- print(line.replace(' ', ' ') + '
')
+ print(line + '
')
if "Disassembly of section .text:" in line:
outp_flag = True
@@ -31,4 +33,4 @@ def main():
print('')
if __name__ == "__main__":
- main()
\ No newline at end of file
+ main()