program main
  fn make_words(head: string) -> (array string 3)
    array : (array string 3)
      var head : string
      string "middle" : string
      string "tail" : string
  fn at(values: (array string 3), i: i32) -> string
    index : string
      var values : (array string 3)
      var i : i32
  fn echo(values: (array string 3)) -> (array string 3)
    var values : (array string 3)
  fn call_return_index(i: i32) -> string
    index : string
      call make_words : (array string 3)
        string "call" : string
      var i : i32
  fn local_array_flow(i: i32) -> string
    local let words : unit
      call make_words : (array string 3)
        string "local" : string
    call at : string
      var words : (array string 3)
      var i : i32
  fn parameter_local_copy(values: (array string 3), i: i32) -> string
    local let copy : unit
      var values : (array string 3)
    index : string
      var copy : (array string 3)
      var i : i32
  fn main() -> i32
    if : i32
      binary = : bool
        call call_return_index : string
          int 1 : i32
        string "middle" : string
      int 0 : i32
      int 1 : i32
  test "string array parameter value flow"
    binary = : bool
      call at : string
        call make_words : (array string 3)
          string "alpha" : string
        int 0 : i32
      string "alpha" : string
  test "string array dynamic index"
    binary = : bool
      call at : string
        call make_words : (array string 3)
          string "alpha" : string
        int 2 : i32
      string "tail" : string
  test "string array local call value flow"
    binary = : bool
      call local_array_flow : string
        int 1 : i32
      string "middle" : string
  test "string array parameter local copy"
    binary = : bool
      call parameter_local_copy : string
        call make_words : (array string 3)
          string "omega" : string
        int 0 : i32
      string "omega" : string
  test "string array return call value flow"
    binary = : bool
      index : string
        call echo : (array string 3)
          call make_words : (array string 3)
            string "zeta" : string
        int 2 : i32
      string "tail" : string
