program main
  fn maybe_value(value: i32) -> (option i32)
    some : (option i32)
      var value : i32
  fn maybe_empty() -> (option i32)
    none : (option i32)
  fn maybe_wide_value(value: i64) -> (option i64)
    some : (option i64)
      var value : i64
  fn maybe_wide_empty() -> (option i64)
    none : (option i64)
  fn maybe_float_value(value: f64) -> (option f64)
    some : (option f64)
      var value : f64
  fn maybe_float_empty() -> (option f64)
    none : (option f64)
  fn maybe_flag_value(value: bool) -> (option bool)
    some : (option bool)
      var value : bool
  fn maybe_flag_empty() -> (option bool)
    none : (option bool)
  fn maybe_string_value(value: string) -> (option string)
    some : (option string)
      var value : string
  fn maybe_string_empty() -> (option string)
    none : (option string)
  fn result_ok_value(value: i32) -> (result i32 i32)
    ok : (result i32 i32)
      var value : i32
  fn result_err_value(code: i32) -> (result i32 i32)
    err : (result i32 i32)
      var code : i32
  fn option_direct_payload() -> i32
    unwrap_some : i32
      some : (option i32)
        int 42 : i32
  fn option_param_payload(value: (option i32)) -> i32
    unwrap_some : i32
      var value : (option i32)
  fn option_local_payload() -> i32
    local let value : unit
      call maybe_value : (option i32)
        int 21 : i32
    unwrap_some : i32
      var value : (option i32)
  fn option_call_payload() -> i32
    unwrap_some : i32
      call maybe_value : (option i32)
        int 22 : i32
  fn option_guarded_payload(value: (option i32)) -> i32
    if : i32
      is_some : bool
        var value : (option i32)
      unwrap_some : i32
        var value : (option i32)
      int 0 : i32
  fn option_wide_direct_payload() -> i64
    unwrap_some : i64
      some : (option i64)
        i64 2147483648 : i64
  fn option_wide_param_payload(value: (option i64)) -> i64
    unwrap_some : i64
      var value : (option i64)
  fn option_wide_local_payload() -> i64
    local let value : unit
      call maybe_wide_value : (option i64)
        i64 21 : i64
    unwrap_some : i64
      var value : (option i64)
  fn option_wide_call_payload() -> i64
    unwrap_some : i64
      call maybe_wide_value : (option i64)
        i64 22 : i64
  fn option_wide_guarded_payload(value: (option i64)) -> i64
    if : i64
      is_some : bool
        var value : (option i64)
      unwrap_some : i64
        var value : (option i64)
      i64 0 : i64
  fn option_float_direct_payload() -> f64
    unwrap_some : f64
      some : (option f64)
        float 42.5 : f64
  fn option_float_param_payload(value: (option f64)) -> f64
    unwrap_some : f64
      var value : (option f64)
  fn option_float_local_payload() -> f64
    local let value : unit
      call maybe_float_value : (option f64)
        float 21.5 : f64
    unwrap_some : f64
      var value : (option f64)
  fn option_float_call_payload() -> f64
    unwrap_some : f64
      call maybe_float_value : (option f64)
        float 22.5 : f64
  fn option_float_guarded_payload(value: (option f64)) -> f64
    if : f64
      is_some : bool
        var value : (option f64)
      unwrap_some : f64
        var value : (option f64)
      float 0 : f64
  fn option_flag_direct_payload() -> bool
    unwrap_some : bool
      some : (option bool)
        bool true : bool
  fn option_flag_param_payload(value: (option bool)) -> bool
    unwrap_some : bool
      var value : (option bool)
  fn option_flag_local_payload() -> bool
    local let value : unit
      call maybe_flag_value : (option bool)
        bool true : bool
    unwrap_some : bool
      var value : (option bool)
  fn option_flag_call_payload() -> bool
    unwrap_some : bool
      call maybe_flag_value : (option bool)
        bool true : bool
  fn option_flag_guarded_payload(value: (option bool)) -> bool
    if : bool
      is_some : bool
        var value : (option bool)
      unwrap_some : bool
        var value : (option bool)
      bool false : bool
  fn option_string_direct_payload() -> string
    unwrap_some : string
      some : (option string)
        string "slovo" : string
  fn option_string_param_payload(value: (option string)) -> string
    unwrap_some : string
      var value : (option string)
  fn option_string_local_payload() -> string
    local let value : unit
      call maybe_string_value : (option string)
        string "oak" : string
    unwrap_some : string
      var value : (option string)
  fn option_string_call_payload() -> string
    unwrap_some : string
      call maybe_string_value : (option string)
        string "pine" : string
  fn option_string_guarded_payload(value: (option string)) -> string
    if : string
      is_some : bool
        var value : (option string)
      unwrap_some : string
        var value : (option string)
      string "fallback" : string
  fn result_ok_direct_payload() -> i32
    unwrap_ok : i32
      ok : (result i32 i32)
        int 30 : i32
  fn result_err_direct_payload() -> i32
    unwrap_err : i32
      err : (result i32 i32)
        int 7 : i32
  fn result_ok_param_payload(value: (result i32 i32)) -> i32
    unwrap_ok : i32
      var value : (result i32 i32)
  fn result_err_param_payload(value: (result i32 i32)) -> i32
    unwrap_err : i32
      var value : (result i32 i32)
  fn result_ok_local_payload() -> i32
    local let value : unit
      call result_ok_value : (result i32 i32)
        int 31 : i32
    unwrap_ok : i32
      var value : (result i32 i32)
  fn result_err_call_payload() -> i32
    unwrap_err : i32
      call result_err_value : (result i32 i32)
        int 9 : i32
  fn main() -> i32
    int 0 : i32
  test "unwrap some direct constructor"
    binary = : bool
      call option_direct_payload : i32
      int 42 : i32
  test "unwrap some local"
    binary = : bool
      call option_local_payload : i32
      int 21 : i32
  test "unwrap some call"
    binary = : bool
      call option_call_payload : i32
      int 22 : i32
  test "unwrap some parameter"
    binary = : bool
      call option_param_payload : i32
        call maybe_value : (option i32)
          int 23 : i32
      int 23 : i32
  test "guarded unwrap some present"
    binary = : bool
      call option_guarded_payload : i32
        call maybe_value : (option i32)
          int 24 : i32
      int 24 : i32
  test "guarded unwrap some absent"
    binary = : bool
      call option_guarded_payload : i32
        call maybe_empty : (option i32)
      int 0 : i32
  test "unwrap some i64 direct constructor"
    binary = : bool
      call option_wide_direct_payload : i64
      i64 2147483648 : i64
  test "unwrap some i64 local"
    binary = : bool
      call option_wide_local_payload : i64
      i64 21 : i64
  test "unwrap some i64 call"
    binary = : bool
      call option_wide_call_payload : i64
      i64 22 : i64
  test "unwrap some i64 parameter"
    binary = : bool
      call option_wide_param_payload : i64
        call maybe_wide_value : (option i64)
          i64 23 : i64
      i64 23 : i64
  test "guarded unwrap some i64 present"
    binary = : bool
      call option_wide_guarded_payload : i64
        call maybe_wide_value : (option i64)
          i64 24 : i64
      i64 24 : i64
  test "guarded unwrap some i64 absent"
    binary = : bool
      call option_wide_guarded_payload : i64
        call maybe_wide_empty : (option i64)
      i64 0 : i64
  test "unwrap some f64 direct constructor"
    binary = : bool
      call option_float_direct_payload : f64
      float 42.5 : f64
  test "unwrap some f64 local"
    binary = : bool
      call option_float_local_payload : f64
      float 21.5 : f64
  test "unwrap some f64 call"
    binary = : bool
      call option_float_call_payload : f64
      float 22.5 : f64
  test "unwrap some f64 parameter"
    binary = : bool
      call option_float_param_payload : f64
        call maybe_float_value : (option f64)
          float 23.5 : f64
      float 23.5 : f64
  test "guarded unwrap some f64 present"
    binary = : bool
      call option_float_guarded_payload : f64
        call maybe_float_value : (option f64)
          float 24.5 : f64
      float 24.5 : f64
  test "guarded unwrap some f64 absent"
    binary = : bool
      call option_float_guarded_payload : f64
        call maybe_float_empty : (option f64)
      float 0 : f64
  test "unwrap some bool direct constructor"
    call option_flag_direct_payload : bool
  test "unwrap some bool local"
    call option_flag_local_payload : bool
  test "unwrap some bool call"
    call option_flag_call_payload : bool
  test "unwrap some bool parameter"
    call option_flag_param_payload : bool
      call maybe_flag_value : (option bool)
        bool true : bool
  test "guarded unwrap some bool present"
    call option_flag_guarded_payload : bool
      call maybe_flag_value : (option bool)
        bool true : bool
  test "guarded unwrap some bool absent"
    if : bool
      call option_flag_guarded_payload : bool
        call maybe_flag_empty : (option bool)
      bool false : bool
      bool true : bool
  test "unwrap some string direct constructor"
    binary = : bool
      call option_string_direct_payload : string
      string "slovo" : string
  test "unwrap some string local"
    binary = : bool
      call option_string_local_payload : string
      string "oak" : string
  test "unwrap some string call"
    binary = : bool
      call option_string_call_payload : string
      string "pine" : string
  test "unwrap some string parameter"
    binary = : bool
      call option_string_param_payload : string
        call maybe_string_value : (option string)
          string "birch" : string
      string "birch" : string
  test "guarded unwrap some string present"
    binary = : bool
      call option_string_guarded_payload : string
        call maybe_string_value : (option string)
          string "cedar" : string
      string "cedar" : string
  test "guarded unwrap some string absent"
    binary = : bool
      call option_string_guarded_payload : string
        call maybe_string_empty : (option string)
      string "fallback" : string
  test "unwrap ok direct constructor"
    binary = : bool
      call result_ok_direct_payload : i32
      int 30 : i32
  test "unwrap err direct constructor"
    binary = : bool
      call result_err_direct_payload : i32
      int 7 : i32
  test "unwrap ok parameter"
    binary = : bool
      call result_ok_param_payload : i32
        call result_ok_value : (result i32 i32)
          int 32 : i32
      int 32 : i32
  test "unwrap err parameter"
    binary = : bool
      call result_err_param_payload : i32
        call result_err_value : (result i32 i32)
          int 8 : i32
      int 8 : i32
  test "unwrap ok local"
    binary = : bool
      call result_ok_local_payload : i32
      int 31 : i32
  test "unwrap err call"
    binary = : bool
      call result_err_call_payload : i32
      int 9 : i32
