Ticket #8: IntEnum_final.grin

File IntEnum_final.grin, 8.7 kB (added by SamB, 6 years ago)

The final Grin code I get

Line 
1-- lhc --keep-tmp-files -dgrin -dcore-mangled -oIntEnum IntEnum.hs
2-- lhc 0.6.20081216 (zhu) compiled by ghc-6.8 on a i386 running linux
3
4
5-- Cafs
6v-957878805 := (@hole)
7v-966922773 := (@hole)
8-- Functions
9ftheMain$6 :: &N -> [&N]
10ftheMain$6 ni710 = do
11  nd100048 <- eval ni710
12  case nd100048 of
13    (CLhc.Prim.: ni714 ni716) -> do
14      nd100050 <- eval ni714
15      (CLhc.Prim.Char w304) <- return nd100050
16      (void)lhc_utf8_putchar(int) w304
17      ftheMain$6 ni716
18    [] -> return &(CLhc.Basics.())
19
20fLhc.Show.shows :: &N &N -> [N]
21fLhc.Show.shows ni1559062240 ni1902233550 = do
22  fLhc.Show.showsPrec (TLhc.Prim.Int) &(CLhc.Prim.Int 0) ni1559062240 ni1902233550
23
24ftheMain$4 ::  -> [N]
25ftheMain$4  = do
26  ftheMain$3 16777215
27
28ftheMain$5 ::  -> [N]
29ftheMain$5  = do
30  ftheMain$2 257 ni-957878805
31
32ftheMain$2 :: bits32 &N -> [N]
33ftheMain$2 w674 ni676 = do
34  h100042 <- 0 `Gte` w674
35  case h100042 of
36    1 -> return []
37    0 -> do
38      nd100044 <- eval ni676
39      case nd100044 of
40        (CLhc.Prim.: ni682 ni684) -> do
41          w686 <- w674 - 1
42          ni688 <- store (FtheMain$2 w686 ni684)
43          return (CLhc.Prim.: ni682 ni688)
44        [] -> return []
45
46ftheMain$3 :: bits32 -> [N]
47ftheMain$3 w420 = do
48  ni422 <- store (CLhc.Prim.Int w420)
49  h100046 <- w420 `Lte` max(bits32)::bits32
50  case h100046 of
51    1 -> do
52      w428 <- w420 + (33554431 - 16777215)
53      ni430 <- store (FtheMain$3 w428)
54      return (CLhc.Prim.: ni422 ni430)
55    0 -> return []
56
57bap_1_Lhc.Show.showsPrec_100028 :: &N &N -> [N]
58bap_1_Lhc.Show.showsPrec_100028 ni87 ni89 = do
59  nd100030 <- fetch ni87
60  bapply_12329 nd100030 ni89
61
62bap_1_Lhc.Show.showsPrec_100016 :: &N &N -> [N]
63bap_1_Lhc.Show.showsPrec_100016 ni86 ni88 = do
64  nd100018 <- fetch ni86
65  bapply_12329 nd100018 ni88
66
67bapply_12329 :: N &N -> [N]
68bapply_12329 nd1 ni2 = do
69  case nd1 of
70    (P1_Lhc.Show.showsPrec$5 w3) -> fLhc.Show.showsPrec$5 w3 ni2
71    (P1_Lhc.Show.showsPrec$4 w7) -> fLhc.Show.showsPrec$4 w7 ni2
72
73b_main ::  -> []
74b_main  = do
75  update ni-957878805 (FtheMain$4)
76  update ni-966922773 (FtheMain$5)
77  ftheMain
78
79ftheMain ::  -> []
80ftheMain  = do
81  nd100038 <- fLhc.Show.showsPrec (TLhc.Prim.[] (TLhc.Prim.Int)) &(CLhc.Prim.Int 0) ni-966922773 &[]
82  ni442 <- store nd100038
83  ni0 <- ftheMain$6 ni442
84  (void)lhc_utf8_putchar(int) 10
85
86fLhc.Show.showsPrec :: N &N &N &N -> [N]
87fLhc.Show.showsPrec nd1876430363 ni114079652 ni1989490482 ni1378948956 = do
88  case nd1876430363 of
89    (TLhc.Prim.[] nd0) -> do
90      nd100006 <- eval ni1989490482
91      case nd100006 of
92        (CLhc.Prim.: ni498 ni500) -> do
93          ni502 <- store (FLhc.Show.showsPrec$2 ni500 ni1378948956)
94          ni504 <- store (FLhc.Show.shows ni498 ni502)
95          return (CLhc.Prim.: &(CLhc.Prim.Char 91) ni504)
96        [] -> fLhc.Show.showsPrec$3 &"[]" ni1378948956
97    (TLhc.Prim.Int) -> do
98      nd100008 <- eval ni1989490482
99      (CLhc.Prim.Int w671) <- return nd100008
100      h100010 <- w671 == min(bits32)::bits32
101      case h100010 of
102        1 -> do
103          nd100012 <- fetch ni114079652
104          (CLhc.Prim.Int w550) <- return nd100012
105          ni552 <- store (P1_Lhc.Show.showsPrec$4 w671)
106          h100014 <- 6 `Lt` w550
107          case h100014 of
108            1 -> do
109              ni578 <- store (CLhc.Prim.: &(CLhc.Prim.Char 41) ni1378948956)
110              ni580 <- store (Bap_1_Lhc.Show.showsPrec_100016 ni552 ni578)
111              return (CLhc.Prim.: &(CLhc.Prim.Char 40) ni580)
112            0 -> fLhc.Show.showsPrec$4 w671 ni1378948956
113        0 -> do
114          h100022 <- 0 `Gt` w671
115          case h100022 of
116            1 -> do
117              nd100024 <- fetch ni114079652
118              (CLhc.Prim.Int w586) <- return nd100024
119              ni588 <- store (P1_Lhc.Show.showsPrec$5 w671)
120              h100026 <- 6 `Lt` w586
121              case h100026 of
122                1 -> do
123                  ni598 <- store (CLhc.Prim.: &(CLhc.Prim.Char 41) ni1378948956)
124                  ni600 <- store (Bap_1_Lhc.Show.showsPrec_100028 ni588 ni598)
125                  return (CLhc.Prim.: &(CLhc.Prim.Char 40) ni600)
126                0 -> fLhc.Show.showsPrec$5 w671 ni1378948956
127            0 -> fW@.fLhc.Inst.Show.showWord w671 ni1378948956
128
129fLhc.Show.showsPrec$5 :: bits32 &N -> [N]
130fLhc.Show.showsPrec$5 w641 ni590 = do
131  w592 <- (bits32)Neg w641
132  ni594 <- store (FW@.fLhc.Inst.Show.showWord w592 ni590)
133  return (CLhc.Prim.: &(CLhc.Prim.Char 45) ni594)
134
135fLhc.Show.showsPrec$3 :: &N &N -> [N]
136fLhc.Show.showsPrec$3 ni528 ni530 = do
137  nd100036 <- eval ni528
138  case nd100036 of
139    (CLhc.Prim.: ni534 ni536) -> do
140      ni538 <- store (FLhc.Show.showsPrec$3 ni536 ni530)
141      return (CLhc.Prim.: ni534 ni538)
142    [] -> eval ni530
143
144fLhc.Show.showsPrec$4 :: bits32 &N -> [N]
145fLhc.Show.showsPrec$4 w622 ni554 = do
146  ni556 <- store (FW@.fLhc.Inst.Show.showWord w622 ni554)
147  return (CLhc.Prim.: &(CLhc.Prim.Char 45) ni556)
148
149fLhc.Show.showsPrec$2 :: &N &N -> [N]
150fLhc.Show.showsPrec$2 ni508 ni510 = do
151  nd100034 <- eval ni508
152  case nd100034 of
153    (CLhc.Prim.: ni514 ni516) -> do
154      ni518 <- store (FLhc.Show.showsPrec$2 ni516 ni510)
155      ni520 <- store (FLhc.Show.shows ni514 ni518)
156      return (CLhc.Prim.: &(CLhc.Prim.Char 44) ni520)
157    [] -> return (CLhc.Prim.: &(CLhc.Prim.Char 93) ni510)
158
159fW@.fLhc.Inst.Show.showWord :: bits32 &N -> [N]
160fW@.fLhc.Inst.Show.showWord w1368789043 ni1372065837 = do
161  fW@.fR@.fLhc.Inst.Show.showWord w1368789043 ni1372065837
162
163fW@.fR@.fLhc.Inst.Show.showWord :: bits32 &N -> [N]
164fW@.fR@.fLhc.Inst.Show.showWord w1499950522 ni280340684 = do
165  w752 <- w1499950522 / 10
166  w762 <- w1499950522 % 10
167  w1241062752 <- 48 + w762
168  ni2192046 <- store (CLhc.Prim.Char w1241062752)
169  case w752 of
170    0 -> return (CLhc.Prim.: ni2192046 ni280340684)
171    w0 -> do
172      ni1379012655 <- store (CLhc.Prim.: ni2192046 ni280340684)
173      fW@.fR@.fLhc.Inst.Show.showWord w752 ni1379012655
174