#include <perms.h>

//          Edinburgh IMP77 Compiler - Version 8.4
//
//     1  %begin

int main(int argc, char **argv) { /*%begin*/
  _imp_initialise(argc, argv);

  //     2    ! This shows that the icode does not distinguish the two declarations,
  //     3    ! and the initialisation relies on finding the declaration on the stack.
  //     4    ! I suspect we can get by with having a single flex array for the
  //     5    ! current declarations initial values.
  //     6    !
  //     7    ! When we pop the stack at codegen time, we'll either hit an INIT
  //     8    ! first (at which point we save them up, in reverse order) or
  //     9    ! we hit the $DEF and there's no initialisation needed.
  //    10
  //    11    %ownintegerarray one(0:3)

  static int ONE[4];

  //    12
  //    13    %ownintegerarray two(0:3) = 1, 2, 3, 4

  static int TWO[4] = {1, 2, 3, 4};

  //    14
  //    15    one(2) = two(1)

  ONE[2] = TWO[1];

  //    16
  //    17  %endofprogram

  _imp_stop(0);
  return 0;
end_0:;
}