module demo.ownbasic air 0 lang 0.1 features [capabilities, effects, heap, ownership, resources] fn @bump(%c: mut) -> void effects [] entry: %v_1 = load %c %c_2 = const.u64 1 %t_3 = add.checked.u64 %v_1, %c_2 store %c, %t_3 ret fn @main(%heap: cap) -> u64 effects [mem.alloc] entry: %c_1 = const.u64 41 own.new %c_1, %heap, ok -> @ok_2, err -> @err_4 ok_2(%ok_3: own): %x_6 = borrow.mut %ok_3 call @bump(%x_6) borrow.end %x_6 %v_7 = own.take %ok_3 br @endmatch_9(%v_7) err_4(%err_5: alloc_error): %c_8 = const.u64 0 br @endmatch_9(%c_8) endmatch_9(%match_10: u64): ret %match_10