# An in-memory model of a workspace with scope-owned cleanup.
struct temporary_workspace:
    item_count: i32

func (workspace temporary_workspace) deinit():
    workspace.item_count = 0

func entry(item_count: i32) -> i32:
    var processed = 0
    with temporary_workspace(item_count = item_count) as workspace:
        processed = workspace.item_count * 2
    return processed
