{"id":19297475,"url":"https://github.com/wormtql/megumin","last_synced_at":"2025-04-22T09:31:15.320Z","repository":{"id":166840785,"uuid":"629808655","full_name":"wormtql/megumin","owner":"wormtql","description":"An AArch64 superoptimizer and emulator","archived":false,"fork":false,"pushed_at":"2024-06-21T05:32:12.000Z","size":2797,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-21T23:15:53.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wormtql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-19T04:22:41.000Z","updated_at":"2024-06-21T05:32:15.000Z","dependencies_parsed_at":"2023-07-17T17:50:25.228Z","dependency_job_id":"cba6549d-16ce-47db-9e01-a7c595d9edcd","html_url":"https://github.com/wormtql/megumin","commit_stats":null,"previous_names":["wormtql/megumin"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormtql%2Fmegumin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormtql%2Fmegumin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormtql%2Fmegumin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wormtql%2Fmegumin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wormtql","download_url":"https://codeload.github.com/wormtql/megumin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223893164,"owners_count":17220834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T23:05:01.842Z","updated_at":"2024-11-09T23:05:02.801Z","avatar_url":"https://github.com/wormtql.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n*Megumin* is a super-optimizer targeting AArch64 assemblies.  \nCurrently it only supports integral instructions and floating point instructions (partly).\n\n### Dependency\nSee **megumin/3rd** for all third-party dependencies\n| Dependency | Description |\n| --- | --- |\n| Z3 | Symbolic execution |\n| thread-pool | Parallel optimization |\n| argparse | Parsing user arguments |\n| Catch2 | Unit tests |\n| keystone | Compile AArch64 assembilies to machine code |\n| abseil | Large integer arithmetic |\n\n## Build\n### On Linux\n#### Clone repository\n```bash\ngit clone https://github.com/wormtql/megumin.git --recursive\ncd megumin\n```\n#### Build Z3\n```bash\nmkdir z3_build\nmkdir z3_install\ncd z3_build\ncmake -DCMAKE_BUILD_TYPE=Release ../3rd/z3\ncmake --build .\ncmake -DCMAKE_INSTALL_PREFIX=\u003cpath_to_z3_install\u003e -P cmake_install.cmake\n```\n#### Build keystone\n```bash\n./build_keystone.sh\n```\n#### Build megumin\n```bash\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build .\n```\n### On Windows\n#### Clone repository\nSame as Linux\n#### Build Z3\n- Download Z3 binaries\n- Extract to `z3_install`\n#### Build keystone\n- Download binary distributions from [keystone](https://www.keystone-engine.org/)\n- Extract to `keystone_install`\n- Make sure the `keystone.dll` lies in `keystone_install/keystone.dll`\n#### Build megumin\nuse either `cmake` or `Visual Studio` or `CLion` or `VS Code` to build\n\n## Binaries\nUse `xxx.exe --help` to see options\n### auto-opt\nOptimize a single file assemblies\n| Parameter | Description |\n| --- | --- |\n| --input-file | Assembly file to be optimized |\n| --correct-file | Store the optimize results |\n| --error-file | Store errors |\n| --time-per-opt | Time spent per basic block per launch (ms) |\n| --thread-count | Specify how many threads to use |\n### apply-opt\nApply optimize result to original assembly file\n| Parameter | Description |\n| --- | --- |\n| --source-file | The original assembly file |\n| --output-file | The output assembly file |\n| --optimizations | The optimize result, should be the output of `auto-opt` |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormtql%2Fmegumin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwormtql%2Fmegumin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwormtql%2Fmegumin/lists"}