const Error = error{
    unexpected_result,
};

const main = fn () Error!void {
    const a = foo(5142);
    if (a != 2501) {
        return Error.unexpected_result;
    }
    const b = foo(5142);
    if (b != 2501) {
        return Error.unexpected_result;
    }
    if (a - b != 0) {
        return Error.unexpected_result;
    }
}

const foo = fn (arg: u32) u32 {
    var i: u32 = 0;
    while (i < arg) {
        if (i > 2500) {
            return i;
        }

        i += 1;
    }

    return 321;
}
