
     1  %begin
     2  
        O LINE   1 "regression-bugs-tmp/write-mouses.imp"
        H BEGIN  _lev0id0 {lev=0 --> 1}

     3  %routine MOUSES WRITE(%integer n, p)
     4  
           O LINE   3 "regression-bugs-tmp/write-mouses.imp"
           $ DEF    MOUSESWRITE (_lev0id0_MOUSESWRITE) p1=V_00ad a/tf=7 b/format=0 c/ostate=0  type=0 (<type:0>) form=7 (routine) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
              { START  ( FORMAL PARAMETERS  {lev=2 --> 3, nested=0 --> 1}
                 $ DEF    N p1=V_00ae a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
                 $ DEF    P p1=V_00af a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
              } FINISH ) {lev=2}

     5  %string(72)%fn ITOS(%integer n, p)
              O LINE   5 "regression-bugs-tmp/write-mouses.imp"
              $ DEF    ITOS (_lev0id0_MOUSESWRITE_ITOS) p1=V_00b0 a/tf=38 b/format=48 c/ostate=10  type=3 (string) form=8 (function) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=1 unass=0
                 { START  ( FORMAL PARAMETERS  {lev=3 --> 4, nested=0 --> 1}
                    $ DEF    N p1=V_00b1 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
                    $ DEF    P p1=V_00b2 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
                 } FINISH ) {lev=3}

     6     %byte %array s(0:72)
                 O LINE   6 "regression-bugs-tmp/write-mouses.imp"
                 $ DEF    S p1=V_00b3 a/tf=1b b/format=2 c/ostate=100  type=1 (integer) form=11 (array) special=1 (byte-integer) linkage=0 (auto) spec=0 indirect=0 unass=0
                 N PUSHI  #0x00000000
                 N PUSHI  #0x00000048
                 d DIM    0001 0001

     7     %integer x, sign
                 O LINE   7 "regression-bugs-tmp/write-mouses.imp"
                 $ DEF    X p1=V_00b4 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
                 $ DEF    SIGN p1=V_00b5 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0

     8     x = 73
                 O LINE   8 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 N PUSHI  #0x00000049
                 S ASSVAL

     9     sign = 0
                 O LINE   9 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   SIGN
                 N PUSHI  #0x00000000
                 S ASSVAL

    10     %if p > 0 %start
                 O LINE   10 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   P
                 N PUSHI  #0x00000000
                 ? JUMPIF <= L_0004

    11        sign = ' '
                 O LINE   11 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   SIGN
                 N PUSHI  #0x00000020
                 S ASSVAL

    12        p = 72-p
                 O LINE   12 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   P
                 N PUSHI  #0x00000048
                 @ PUSH   P
                 - SUB   
                 S ASSVAL

    13     %else
                 O LINE   13 "regression-bugs-tmp/write-mouses.imp"
                 F GOTO   L_0003
                 : LOCATE L_0004

    14        p = p+73
                 O LINE   14 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   P
                 @ PUSH   P
                 N PUSHI  #0x00000049
                 + ADD   
                 S ASSVAL

    15     %finish
                 O LINE   15 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0003

    16     p = 1 %if p <= 0
                 O LINE   16 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   P
                 N PUSHI  #0x00000000
                 ? JUMPIF > L_0004
                 @ PUSH   P
                 N PUSHI  #0x00000001
                 S ASSVAL
                 : LOCATE L_0004

    17     %if n < 0 %start
                 O LINE   17 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 N PUSHI  #0x00000000
                 ? JUMPIF >= L_0004

    18        sign = '-'
                 O LINE   18 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   SIGN
                 N PUSHI  #0x0000002d
                 S ASSVAL

    19        n = -n
                 O LINE   19 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 @ PUSH   N
                 U NEGATE
                 S ASSVAL

    20        %if n < 0 %start;      !max int
                 O LINE   20 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 N PUSHI  #0x00000000
                 ? JUMPIF >= L_0007

    21           n = n//(-10)
                 O LINE   21 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 @ PUSH   N
                 N PUSHI  #0x0000000a
                 U NEGATE
                 / QUOT  
                 S ASSVAL

    22           x = x-1
                 O LINE   22 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 @ PUSH   X
                 N PUSHI  #0x00000001
                 - SUB   
                 S ASSVAL

    23           s(x) = '8'
                 O LINE   23 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 N PUSHI  #0x00000038
                 S ASSVAL

    24        %finish
                 O LINE   24 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0007

    25     %finish
                 O LINE   25 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0004

    26     %cycle
                 O LINE   26 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0003

    27        x=x-1
                 O LINE   27 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 @ PUSH   X
                 N PUSHI  #0x00000001
                 - SUB   
                 S ASSVAL

    28        s(x) = rem(n,10)+'0'
                 O LINE   28 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 @ PUSH   REM
                 @ PUSH   N
                 p ASSPAR
                 N PUSHI  #0x0000000a
                 p ASSPAR
                 E CALL  
                 N PUSHI  #0x00000030
                 + ADD   
                 S ASSVAL

    29        n = n//10
                 O LINE   29 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 @ PUSH   N
                 N PUSHI  #0x0000000a
                 / QUOT  
                 S ASSVAL

    30     %repeat %until n = 0
                 O LINE   30 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   N
                 N PUSHI  #0x00000000
                 ? JUMPIF = L_0004
                 B REPEAT L_0003
                 : LOCATE L_0004

    31     %if sign # 0 %start
                 O LINE   31 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   SIGN
                 N PUSHI  #0x00000000
                 ? JUMPIF = L_0004

    32        x = x-1;  s(x) = sign
                 O LINE   32 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 @ PUSH   X
                 N PUSHI  #0x00000001
                 - SUB   
                 S ASSVAL
                 O LINE   32 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 @ PUSH   SIGN
                 S ASSVAL

    33     %finish
                 O LINE   33 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0004

    34     %while x > p %cycle
                 O LINE   34 "regression-bugs-tmp/write-mouses.imp"
                 : LOCATE L_0003
                 @ PUSH   X
                 @ PUSH   P
                 ? JUMPIF <= L_0004

    35        x = x-1;  s(x) = ' '
                 O LINE   35 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 @ PUSH   X
                 N PUSHI  #0x00000001
                 - SUB   
                 S ASSVAL
                 O LINE   35 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 N PUSHI  #0x00000020
                 S ASSVAL

    36     %repeat
                 O LINE   36 "regression-bugs-tmp/write-mouses.imp"
                 B REPEAT L_0003
                 : LOCATE L_0004

    37     x = x-1
                 O LINE   37 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   X
                 @ PUSH   X
                 N PUSHI  #0x00000001
                 - SUB   
                 S ASSVAL

    38     s(x) = 72-x
                 O LINE   38 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 N PUSHI  #0x00000048
                 @ PUSH   X
                 - SUB   
                 S ASSVAL

    39     %result = string(addr(s(x)))
                 O LINE   39 "regression-bugs-tmp/write-mouses.imp"
                 @ PUSH   STRING
                 @ PUSH   ADDR
                 @ PUSH   S
                 @ PUSH   X
                 a ACCESS
                 p ASSPAR
                 E CALL  
                 p ASSPAR
                 E CALL  
                 V RESULT

    40  %end
    41  
                 O LINE   40 "regression-bugs-tmp/write-mouses.imp"
              ; END    _lev0id0_MOUSESWRITE_ITOS {lev=3 --> 2}

    42     printstring(itos(n, p))
              O LINE   42 "regression-bugs-tmp/write-mouses.imp"
              @ PUSH   PRINTSTRING
              @ PUSH   ITOS
              @ PUSH   N
              p ASSPAR
              @ PUSH   P
              p ASSPAR
              E CALL  
              p ASSPAR
              E CALL  

    43  %end
    44  
              O LINE   43 "regression-bugs-tmp/write-mouses.imp"
           ; END    _lev0id0_MOUSESWRITE {lev=2 --> 1}

    45  %endofprogram
           O LINE   45 "regression-bugs-tmp/write-mouses.imp"
        ; END    _lev0id0 {lev=1 --> 0}
        ; END     {lev=0 --> -1}


