fn processWithAlias(n: Int): Int = {
    let nums = List.range(1, n)
    let alias = nums
    let _len = List.length(alias)
    let doubled = List.map(nums, fn(x: Int): Int => x * 2)
    let filtered = List.filter(doubled, fn(x: Int): Bool => x > n)
    let reversed = List.reverse(filtered)
    List.length(reversed)
}

fn main(): Unit = {
    Console.print("=== RC Stress Test (Shared Refs) ===")
    let result1 = processWithAlias(100)
    let result2 = processWithAlias(200)
    let result3 = processWithAlias(500)
    let result4 = processWithAlias(1000)
    Console.print("Completed 4 chains with shared refs")
}
