//! A package executed by both hosted compilation and the kernel loader.

/// Counter owned by each package instance.
unsafe static counter: i64 = 1;
/// Read-only table of slices into this instance's initialized data, which the loader relocates.
constant FACTORS: [*[u8]; 2] = ["6", "7"];

/// Compute a result through a package-local call.
unsafe fn calculate(value: i64) -> i64 {
    set counter += value * (FACTORS[0][0] as i64 - 48);
    return counter;
}

/// Return the result checked by both execution paths.
@default unsafe fn main() -> i32 {
    return calculate(7) as i32;
}
