When analyzing, verifying, or translating software, we rarely deal with clean, uniform logic. Instead, code manifests in a chaotic spectrum of formats: low-level register-based bytecode, highly dynamic scripting languages, declarative rule sets, or multi-language hybrid frameworks. Attempting to perform static analysis or machine translation directly on these native formats introduces a massive semantic gap—the distance between raw syntax and the underlying program intent.
To overcome this complexity, researchers leverage a shared strategy: lifting diverse code formats into a simplified, structured intermediate representation (IR). By stripping away language-specific syntax, normalizing control flow, and flattening complex operations into uniform primitives (such as three-address code), this approach unifies disparate execution models. This simplification is not merely a cosmetic cleanup; it is a foundational mechanism that enables downstream tools—whether traditional static analyzers or modern large language models (LLMs)—to reason about code with precision.
Lifting Bytecode for Static Analysis and Security Auditing
Low-level execution formats, such as mobile application bytecode or smart contract binaries, are optimized for machine execution rather than automated comprehension. For instance, Android's Dalvik virtual machine uses a register-based bytecode that complicates traditional static analysis tools built for stack-based desktop environments.
To bridge this gap, William Enck et al. developed the ded decompiler in A Study of Android Application Security, which retargets register-based bytecode into a structured IR. This optimization refines control flow and eliminates translation artifacts, making the recovered code compatible with standard security auditing suites. Similarly, Alexandre Bartel et al. introduced Dexpler in Dexpler: Converting Android Dalvik Bytecode to Jimple for Static Analysis with Soot, demonstrating that directly translating register-based bytecode into Jimple—a high-level three-address code IR—preserves semantic structure while avoiding the errors and overhead of multi-stage bytecode conversions.
By normalizing bytecode into a structured IR, complex dataflow tracking becomes feasible. Li Li et al. in Detecting Privacy Leaks in Android Apps and Jianmeng Huang et al. in Static Analysis of Superfluous Network Transmissions in Android Applications utilize this abstraction layer to simplify instruction sets, allowing standard dataflow algorithms to efficiently track privacy leaks and redundant network transmissions. This technique extends to highly complex, multi-language environments as well: Yonghui Liu et al. developed ReuNify in ReuNify: A Step Towards Whole Program Analysis for React Native Android Apps, which unifies JavaScript logic and native Java bytecode into a single, cohesive IR to expose hidden cross-language privacy leaks.
A parallel challenge exists in blockchain ecosystems, where smart contracts are deployed as opaque bytecode. In An overview on smart contracts: Challenges, advances and platforms, Zibin Zheng et al. highlight how reverse-engineering tools translate compiled bytecode back into human-readable intermediate forms to facilitate legal and technical verification. Building on this, Shuo Yang et al. introduced Hyperion in Hyperion: Unveiling DApp Inconsistencies using LLM and Dataflow-Guided Symbolic Execution, lifting low-level bytecode into a structured IR to provide a clean foundation for advanced dataflow tracking and symbolic execution.
Taming Dynamic and Declarative Syntax
High-level languages present the opposite problem of bytecode: their syntax is often too flexible, expressive, or abstract for automated tools to reason about directly. Python, for example, features extreme dynamism where classes are mutable objects and functions are first-class citizens.
To apply classic static analysis to such environments, the system must normalize this dynamic syntax. In PoTo: A Hybrid Andersen's Points-to Analysis for Python, Ana L. Milanova et al. convert complex Python syntax into a simplified three-address code IR. This normalization step flattens flexible module systems and dynamic functions into a uniform logical framework, allowing traditional inclusion-based points-to and type-inference algorithms to scale to large codebases. Similarly, Julian Dolby et al. designed Ariadne in Ariadne: analysis for machine learning programs, translating Python abstract syntax trees (ASTs) into a common IR to adapt existing static analysis infrastructure to machine learning code.
This concept of structural simplification dates back to foundational work in program understanding. Stanley Letovsky argued in Program Understanding with the Lambda Calculus that the lambda calculus ($\lambda$C) serves as an ideal IR because it balances formal logic with programming structures, enabling tools to mechanically reason about high-level "plans." In the realm of declarative programming, David Gadbois et al. developed the STAR system in Discovering Procedural Executions of Rule-Based Programs, which translates declarative rule-based logic into an IR that explicitly supports loops and conditionals, bridging the gap between high-level logic and efficient procedural execution.
Lowering and Refactoring for Formal Verification
For formal verification tools, the primary obstacle is the sheer breadth of language features. Verification engines designed for procedural logic cannot natively handle object-oriented behaviors like virtual method dispatch or low-level hardware interactions like embedded assembly. The solution is to lower or refactor these features into explicit, uniform constructs within the IR.
In JBMC: A Bounded Model Checking Tool for Verifying Java Bytecode, Pascal Kesseli et al. demonstrate this mechanism by transforming Java bytecode into an intermediate control-flow graph (CFG). Crucially, high-level features like virtual method calls are lowered into explicit switch statements based on runtime type information, allowing complex object-oriented behaviors to be verified by procedural engines.
Conversely, when dealing with low-level systems, Zhaofeng Yu et al. in Exploring and Exploiting the Resource Isolation Attack Surface of WebAssembly Containers extract LLVM IR from source code by refactoring embedded assembly into a structured format. This ensures that opaque hardware interactions are made explicitly visible to static analysis pipelines rather than being treated as uninterpretable blocks.
Intermediate Representations as Cognitive Pivots for AI
As large language models become central to software engineering, simplified IRs are increasingly used as "cognitive pivots" to improve AI reasoning, translation, and repair. LLMs often struggle with the vast syntactic differences between programming languages or the granular complexity of raw compiler representations.
To improve program translation, Yufan Huang et al. introduced Code Distillation (CoDist) in Program Translation via Code Distillation. Instead of translating directly from a source language to a target language, CoDist treats translation as a decompilation task: source code is first distilled into a language-agnostic IR pivot, which is then decoded into the target language. This decouples logic comprehension from target syntax generation. Similarly, Zixi Jia et al. proposed Middle Code Prediction (MCP) in Middle Code Prediction: Enhancing Code Generation for Uncommon Programming Languages in Robotics, forcing LLMs to first generate a simplified "middle code" (resembling pseudo-code) before expanding it into complex, domain-specific robotics APIs.
For automated program repair, Jiajun Jiang et al. introduced REPATT in Boosting Redundancy-Based Automated Program Repair by Fine-Grained Pattern Mining, utilizing a Simplified Three-Address Code (S-TAC) representation. By abstracting away specific code structures and operators into S-TAC, the system can easily match and reuse fine-grained code patterns across entirely different contexts.
However, the semantic gap remains a challenge for raw compiler formats; Hailong Jiang et al. in Can Large Language Models Understand Intermediate Representations in Compilers? evaluated LLM comprehension of LLVM IR, finding that while models can parse syntax, they struggle with instruction-level logic, underscoring the ongoing need for human-readable, simplified abstractions over raw compiler code.
Key Foundational Work
Discovering Procedural Executions of Rule-Based Programs (1994) — contributed 1 concept elements to this direction.
Program Understanding with the Lambda Calculus (1987) — contributed 1 concept elements to this direction.