arXiv:2610.30877cs.SEOct 2026

Manuscript Offprint

arXiv:2610.30877

ATLAS: A Multi-Agent Framework for Lifting Binary to Canonical Compiler IR

Xiaoao Zhu, Ni Zhang, Jie Ren, Zhiqiang Li, Jie Zheng, Zhanyong Tang, Zheng Wang

Xiaoao Zhu, Ni Zhang, Jie Ren*, Member, IEEE, Zhiqiang Li, Jie Zheng, Zhanyong Tang Member, IEEE, Zheng Wang Member, IEEE

Abstract—Lifting stripped, heavily optimized binaries to a canonical, pre-optimization LLVM intermediate representation (IR) is essential for downstream security analysis and legacy software migration when source code is unavailable. However, aggressive compiler optimizations rewrite control and data flow, remove structural metadata, and introduce type-erased low-level idioms, causing current lifters to produce malformed or semantically divergent IR.

We present ATLAS, a multi-agent framework designed to reconstruct formally valid and canonical LLVM IR from optimized disassembly. ATLAS combines (i) Structure-aware, region-level retrieval, which utilizes pseudo-probe attribution to align optimized instructions with canonical IR exemplars, and (ii) a collaborative refinement loop that closes the gap between probabilistic generation and deterministic compiler constraints. Concretely, a LIFT agent generates an initial IR draft conditioned on retrieved exemplars, an ADVISOR agent interprets LLVM verifier/compilation diagnostics and static checks to propose localized repair actions, and a VALIDATION agent applies the edits, re-runs toolchain verification and (when available) runtime checks, and feeds the resulting diagnostics back to the ADVISOR. The agents iterate until the IR is verifier-clean and behaviorally consistent, or a budget limit is reached.

On HumanEval-Decompile and MBPP, ATLAS outperforms seven baselines on lifting LLVM IR, achieving 91.8% re-executability and 89.4% CFG similarity across ARM, x86-64, and RISC-V binaries. Moreover, our evaluation demonstrates that ATLAS also outperforms the Binary to C to IR pipelines in pointer-flow precision and downstream analyzability. By recovering a well-formed, machine-centric representation, ATLAS enables practical cross-ISA recompilation and verifiable binary-only migration workflows.

Index Terms—Binary Lifting, LLVM IR, Large Language Models, Multi-Agent Systems, Retrieval-Augmented Generation.

I. INTRODUCTION

Recovering usable program representations from binaries is important for software security analysis, legacy-system maintenance, and migration across heterogeneous computing platforms. In these settings, source code may be unavailable, while the deployed executable remains available for inspection.

Figure

Figure 1. The compilation pipeline from source code to optimized binaries and the reverse lifting task, which targets canonical, pre-optimization compiler IR.

and testing. Binary recovery must therefore provide a representation that supports both reasoning about program behavior and subsequent transformation. Although much recent decompilation research targets human-readable source code [1], [2], downstream compiler workflows also require explicit control flow, consistent types, and well-defined memory operations.

Compiler intermediate representation (IR) provides a useful target for these workflows. LLVM IR can be checked by the LLVM verifier, consumed by program-analysis tools, and recompiled using different compiler backends. Figure 1 illustrates the lifting task considered in this paper: reconstructing canonical, pre-optimization LLVM IR from optimized binaries. We use canonical as an operational reference, defined by the unoptimized IR emitted under a fixed clang -00 toolchain configuration. This reference provides a consistent target for structural recovery; it does not imply that an optimized binary uniquely determines its original IR. The practical objective is to recover well-formed IR that preserves the binary's behavior on the evaluated inputs and remains useful for analysis and recompilation.

This recovery task is difficult because compiler optimizations alter control and data flow, eliminate variables, and replace structured computations with architecture-specific instruction sequences. Rule-based lifters, including LLVM-MCTOLL [3] and RetDec [4], translate machine instructions and reconstruct program structure through deterministic rules and analysis. Their recovered representations can nevertheless differ substantially from compiler-generated IR. Large language models (LLMs) provide a complementary means of inferring code structure, but plausible output can still contain invalid types, inconsistent static single assignment (SSA) definitions, or incorrect computations. Successful lifting consequently requires both structural checks and behavioral evidence.

Our prior work, BRIDGE [5], combines control-flow-aware retrieval with iterative verification for binary-to-canonical-IR lifting. It uses pseudo-probe attribution to construct aligned

This work was supported in part by the National Natural Science Foundation of China under Grant 62372281 and in part by the Fundamental Research Funds for the Central Universities of China under Grant GK202501010 (Corresponding author: Jie Ren.)

Xiaoao Zhu, Ni Zhang, Jie Ren and Zhiqiang Li are with the School of Artificial Intelligence and Computer Science, Shaanxi Normal University. Xi'an, Shaanxi, China. (Xiaoao Zhu and Ni Zhang are co-first authors.)

Jie Zheng, Zhanyong Tang, with the School of Computer Science, Northwest University, Xian, China.

Zheng Wang is with the School of Computing, University of Leeds, LS2 9JT Leeds, U.K.

E-mail: renjie@snnu.edu.cn.

assembly–IR exemplars and incorporates static diagnostics and runtime feedback into refinement. ATLAS builds on this foundation and develops the repair and validation workflow further. Its focus is on localizing repairs, obtaining behavioral evidence when developer-written tests are unavailable, and assessing whether the resulting IR supports reuse across instruction set architectures (ISAs).

Three challenges motivate these extensions. First, compiler diagnostics must be translated into appropriately scoped repairs. A reported type error or malformed phi instruction can involve definitions, uses, and predecessor blocks beyond the reported line. Repair therefore requires identifying the relevant dependencies and enforcing their constraints together. Regenerating a function from an error log provides little control over which valid parts of the current candidate are changed. A more targeted workflow must connect each diagnostic to an affected IR region and a concrete repair action.

Second, behavioral feedback requires an executable interface and a usable reference. Curated benchmarks supply function signatures and unit tests, whereas binary-only settings may provide neither. Generating test inputs alone is insufficient: the system must infer how to call the function, construct a feasible harness, and obtain reference observations from the original executable. Incorrect interface assumptions can make test failures uninformative. The resulting observations must also be interpreted within their coverage, since passing a finite set of tests does not establish equivalence for all inputs.

Third, successful execution on the source architecture does not establish cross-ISA reusability. Recovered IR may retain assumptions about data layout, external interfaces, or machine-specific operations. Recompiling and testing it on another architecture therefore provides an additional assessment of its utility. This assessment complements structural similarity and same-architecture execution by examining whether recovered computations can be reused through a different compiler backend.

We present ATLAS, a multi-agent framework that organizes lifting around three explicit responsibilities: initial synthesis, repair planning, and patch validation. The LIFT AGENT uses CFG-aligned retrieval to generate an initial IR candidate. The ADVISOR AGENT interprets compiler, verifier, and runtime diagnostics, identifies the affected instructions and dependencies, and proposes localized repair actions. Its repair context includes predecessor constraints for phi nodes, def-use slices for inconsistent values, and available binary-interface information for external calls. The VALIDATION AGENT applies these actions and re-runs toolchain checks and available behavioral tests. Failures are returned with the updated candidate for further diagnosis, with refinement bounded by a maximum of five repair iterations. This organization makes the diagnostic evidence, proposed changes, and validation outcomes explicit at each step.

To support refinement without developer-written tests, AT-LAS also constructs behavioral checks from the original binary. It combines static interface inference with observations from dynamic instrumentation, uses these inputs to propose candidate function signatures and test harnesses, and screens candidates through consistency checks and fuzzing-based execution. For accepted harnesses, it compares the original binary and the recompiled IR on the same inputs, including return values and observable memory effects. These differential observations provide concrete evidence for subsequent repairs without requiring source-level expected outputs.

We evaluate ATLAS on HumanEval-Decompile [1] and MBPP [6], covering x86-64, ARM64, and RISC-V binaries compiled at optimization levels -00 through -03. The evaluation includes rule-based and general-purpose LLM baselines where supported, studies retrieval granularity, refinement, and test availability, and examines downstream SVF-based analysis [7] and cross-ISA migration. On HumanEval-Decompile, ATLAS achieves 94.5% re-executability for x86-64 inputs, averaged across optimization levels. In the x86-64-to-ARM64 migration experiment, it achieves 93.6% re-executability on the target architecture. These results characterize lifting quality and downstream utility under the evaluated configurations.

This paper makes the following contributions:

• We present ATLAS, a multi-agent framework that separates synthesis, repair planning, and validation for lifting optimized, stripped binaries to canonical LLVM IR.

• We support structure-aware retrieval across multiple ISAs using aligned assembly–IR exemplars and LoRA adaptation of the assembly encoder for ARM64 and RISC-V.

• We develop localized repair that maps diagnostics to affected IR slices and derives type, def-use, and control-flow constraints to guide targeted edits.

• We develop a behavioral validation workflow combining interface inference, dynamic observations, harness screening, and differential execution to guide repairs without developer-written tests.

• We evaluate ATLAS across three ISAs and four optimization levels, examining lifting quality, component effectiveness, downstream analysis, and cross-ISA migration.

References (37)