neo-decompiler 0.10.2

Neo N3 NEF decompiler: parse, disassemble, lift bytecode to high-level pseudocode and C# skeletons, with a CLI, JSON reports, and optional WebAssembly bindings.
Documentation
use super::*;
use crate::instruction::OpCode;

#[test]
fn high_level_lifts_do_while_loop() {
    // Script: body; PUSH1; JMPIF -3; RET
    let script = [
        OpCode::Push1.byte(),
        OpCode::Nop.byte(),
        OpCode::Push1.byte(),
        OpCode::Jmpif.byte(),
        0xFD,
        OpCode::Ret.byte(),
    ];
    let nef_bytes = build_nef(&script);
    let decompilation = Decompiler::new()
        .decompile_bytes(&nef_bytes)
        .expect("decompile succeeds");

    let high_level = decompilation
        .high_level
        .as_deref()
        .expect("high-level output");
    assert!(
        high_level.contains("do {"),
        "missing do/while header: {high_level}"
    );
    assert!(
        high_level.contains("} while ("),
        "missing do/while tail: {high_level}"
    );
}