/ tests / expectations / compiler / function / flatten_test.out
flatten_test.out
  1  program test.alpha;
  2  
  3  struct Row:
  4      e1 as u8;
  5      e2 as u8;
  6      e3 as u8;
  7  
  8  struct Board:
  9      r1 as Row;
 10      r2 as Row;
 11      r3 as Row;
 12  
 13  closure win:
 14      input r0 as Board;
 15      input r1 as u8;
 16      is.eq r0.r1.e1 r1 into r2;
 17      is.eq r0.r1.e2 r1 into r3;
 18      and r2 r3 into r4;
 19      is.eq r0.r1.e3 r1 into r5;
 20      and r4 r5 into r6;
 21      is.eq r0.r2.e1 r1 into r7;
 22      is.eq r0.r2.e2 r1 into r8;
 23      and r7 r8 into r9;
 24      is.eq r0.r2.e3 r1 into r10;
 25      and r9 r10 into r11;
 26      or r6 r11 into r12;
 27      is.eq r0.r3.e1 r1 into r13;
 28      is.eq r0.r3.e3 r1 into r14;
 29      and r13 r14 into r15;
 30      is.eq r0.r3.e3 r1 into r16;
 31      and r15 r16 into r17;
 32      or r12 r17 into r18;
 33      is.eq r0.r1.e1 r1 into r19;
 34      is.eq r0.r2.e1 r1 into r20;
 35      and r19 r20 into r21;
 36      is.eq r0.r3.e1 r1 into r22;
 37      and r21 r22 into r23;
 38      or r18 r23 into r24;
 39      is.eq r0.r1.e2 r1 into r25;
 40      is.eq r0.r2.e3 r1 into r26;
 41      and r25 r26 into r27;
 42      is.eq r0.r3.e2 r1 into r28;
 43      and r27 r28 into r29;
 44      or r24 r29 into r30;
 45      is.eq r0.r1.e3 r1 into r31;
 46      is.eq r0.r2.e3 r1 into r32;
 47      and r31 r32 into r33;
 48      is.eq r0.r3.e3 r1 into r34;
 49      and r33 r34 into r35;
 50      or r30 r35 into r36;
 51      is.eq r0.r1.e1 r1 into r37;
 52      is.eq r0.r2.e2 r1 into r38;
 53      and r37 r38 into r39;
 54      is.eq r0.r3.e3 r1 into r40;
 55      and r39 r40 into r41;
 56      or r36 r41 into r42;
 57      is.eq r0.r1.e3 r1 into r43;
 58      is.eq r0.r2.e2 r1 into r44;
 59      and r43 r44 into r45;
 60      is.eq r0.r3.e1 r1 into r46;
 61      and r45 r46 into r47;
 62      or r42 r47 into r48;
 63      output r48 as boolean;
 64  
 65  function main:
 66      input r0 as u8.public;
 67      input r1 as u8.private;
 68      input r2 as u8.private;
 69      input r3 as Board.private;
 70      is.eq r1 1u8 into r4;
 71      is.eq r2 1u8 into r5;
 72      and r4 r5 into r6;
 73      is.eq r3.r1.e1 0u8 into r7;
 74      and r6 r7 into r8;
 75      cast r0 r3.r1.e2 r3.r1.e3 into r9 as Row;
 76      cast r9 r3.r2 r3.r3 into r10 as Board;
 77      is.eq r2 2u8 into r11;
 78      and r4 r11 into r12;
 79      is.eq r3.r1.e2 0u8 into r13;
 80      and r12 r13 into r14;
 81      cast r3.r1.e1 r0 r3.r1.e3 into r15 as Row;
 82      cast r15 r3.r2 r3.r3 into r16 as Board;
 83      is.eq r2 3u8 into r17;
 84      and r4 r17 into r18;
 85      is.eq r3.r1.e3 0u8 into r19;
 86      and r18 r19 into r20;
 87      cast r3.r1.e1 r3.r1.e2 r0 into r21 as Row;
 88      cast r21 r3.r2 r3.r3 into r22 as Board;
 89      is.eq r1 2u8 into r23;
 90      and r23 r5 into r24;
 91      is.eq r3.r2.e1 0u8 into r25;
 92      and r24 r25 into r26;
 93      cast r0 r3.r2.e2 r3.r2.e3 into r27 as Row;
 94      cast r3.r1 r27 r3.r3 into r28 as Board;
 95      and r23 r11 into r29;
 96      is.eq r3.r2.e2 0u8 into r30;
 97      and r29 r30 into r31;
 98      cast r3.r2.e1 r0 r3.r2.e3 into r32 as Row;
 99      cast r3.r1 r32 r3.r3 into r33 as Board;
100      and r23 r17 into r34;
101      is.eq r3.r2.e3 0u8 into r35;
102      and r34 r35 into r36;
103      cast r3.r2.e1 r3.r2.e2 r0 into r37 as Row;
104      cast r3.r1 r37 r3.r3 into r38 as Board;
105      is.eq r1 3u8 into r39;
106      and r39 r5 into r40;
107      is.eq r3.r3.e1 0u8 into r41;
108      and r40 r41 into r42;
109      cast r0 r3.r3.e2 r3.r3.e3 into r43 as Row;
110      cast r3.r1 r3.r2 r43 into r44 as Board;
111      and r39 r11 into r45;
112      is.eq r3.r3.e2 0u8 into r46;
113      and r45 r46 into r47;
114      cast r3.r3.e1 r0 r3.r3.e3 into r48 as Row;
115      cast r3.r1 r3.r2 r48 into r49 as Board;
116      and r39 r17 into r50;
117      is.eq r3.r3.e3 0u8 into r51;
118      and r50 r51 into r52;
119      cast r3.r3.e1 r3.r3.e2 r0 into r53 as Row;
120      cast r3.r1 r3.r2 r53 into r54 as Board;
121      ternary r52 r54.r1.e1 r3.r1.e1 into r55;
122      ternary r52 r54.r1.e2 r3.r1.e2 into r56;
123      ternary r52 r54.r1.e3 r3.r1.e3 into r57;
124      cast r55 r56 r57 into r58 as Row;
125      ternary r52 r54.r2.e1 r3.r2.e1 into r59;
126      ternary r52 r54.r2.e2 r3.r2.e2 into r60;
127      ternary r52 r54.r2.e3 r3.r2.e3 into r61;
128      cast r59 r60 r61 into r62 as Row;
129      ternary r52 r54.r3.e1 r3.r3.e1 into r63;
130      ternary r52 r54.r3.e2 r3.r3.e2 into r64;
131      ternary r52 r54.r3.e3 r3.r3.e3 into r65;
132      cast r63 r64 r65 into r66 as Row;
133      cast r58 r62 r66 into r67 as Board;
134      ternary r47 r49.r1.e1 r67.r1.e1 into r68;
135      ternary r47 r49.r1.e2 r67.r1.e2 into r69;
136      ternary r47 r49.r1.e3 r67.r1.e3 into r70;
137      cast r68 r69 r70 into r71 as Row;
138      ternary r47 r49.r2.e1 r67.r2.e1 into r72;
139      ternary r47 r49.r2.e2 r67.r2.e2 into r73;
140      ternary r47 r49.r2.e3 r67.r2.e3 into r74;
141      cast r72 r73 r74 into r75 as Row;
142      ternary r47 r49.r3.e1 r67.r3.e1 into r76;
143      ternary r47 r49.r3.e2 r67.r3.e2 into r77;
144      ternary r47 r49.r3.e3 r67.r3.e3 into r78;
145      cast r76 r77 r78 into r79 as Row;
146      cast r71 r75 r79 into r80 as Board;
147      ternary r42 r44.r1.e1 r80.r1.e1 into r81;
148      ternary r42 r44.r1.e2 r80.r1.e2 into r82;
149      ternary r42 r44.r1.e3 r80.r1.e3 into r83;
150      cast r81 r82 r83 into r84 as Row;
151      ternary r42 r44.r2.e1 r80.r2.e1 into r85;
152      ternary r42 r44.r2.e2 r80.r2.e2 into r86;
153      ternary r42 r44.r2.e3 r80.r2.e3 into r87;
154      cast r85 r86 r87 into r88 as Row;
155      ternary r42 r44.r3.e1 r80.r3.e1 into r89;
156      ternary r42 r44.r3.e2 r80.r3.e2 into r90;
157      ternary r42 r44.r3.e3 r80.r3.e3 into r91;
158      cast r89 r90 r91 into r92 as Row;
159      cast r84 r88 r92 into r93 as Board;
160      ternary r36 r38.r1.e1 r93.r1.e1 into r94;
161      ternary r36 r38.r1.e2 r93.r1.e2 into r95;
162      ternary r36 r38.r1.e3 r93.r1.e3 into r96;
163      cast r94 r95 r96 into r97 as Row;
164      ternary r36 r38.r2.e1 r93.r2.e1 into r98;
165      ternary r36 r38.r2.e2 r93.r2.e2 into r99;
166      ternary r36 r38.r2.e3 r93.r2.e3 into r100;
167      cast r98 r99 r100 into r101 as Row;
168      ternary r36 r38.r3.e1 r93.r3.e1 into r102;
169      ternary r36 r38.r3.e2 r93.r3.e2 into r103;
170      ternary r36 r38.r3.e3 r93.r3.e3 into r104;
171      cast r102 r103 r104 into r105 as Row;
172      cast r97 r101 r105 into r106 as Board;
173      ternary r31 r33.r1.e1 r106.r1.e1 into r107;
174      ternary r31 r33.r1.e2 r106.r1.e2 into r108;
175      ternary r31 r33.r1.e3 r106.r1.e3 into r109;
176      cast r107 r108 r109 into r110 as Row;
177      ternary r31 r33.r2.e1 r106.r2.e1 into r111;
178      ternary r31 r33.r2.e2 r106.r2.e2 into r112;
179      ternary r31 r33.r2.e3 r106.r2.e3 into r113;
180      cast r111 r112 r113 into r114 as Row;
181      ternary r31 r33.r3.e1 r106.r3.e1 into r115;
182      ternary r31 r33.r3.e2 r106.r3.e2 into r116;
183      ternary r31 r33.r3.e3 r106.r3.e3 into r117;
184      cast r115 r116 r117 into r118 as Row;
185      cast r110 r114 r118 into r119 as Board;
186      ternary r26 r28.r1.e1 r119.r1.e1 into r120;
187      ternary r26 r28.r1.e2 r119.r1.e2 into r121;
188      ternary r26 r28.r1.e3 r119.r1.e3 into r122;
189      cast r120 r121 r122 into r123 as Row;
190      ternary r26 r28.r2.e1 r119.r2.e1 into r124;
191      ternary r26 r28.r2.e2 r119.r2.e2 into r125;
192      ternary r26 r28.r2.e3 r119.r2.e3 into r126;
193      cast r124 r125 r126 into r127 as Row;
194      ternary r26 r28.r3.e1 r119.r3.e1 into r128;
195      ternary r26 r28.r3.e2 r119.r3.e2 into r129;
196      ternary r26 r28.r3.e3 r119.r3.e3 into r130;
197      cast r128 r129 r130 into r131 as Row;
198      cast r123 r127 r131 into r132 as Board;
199      ternary r20 r22.r1.e1 r132.r1.e1 into r133;
200      ternary r20 r22.r1.e2 r132.r1.e2 into r134;
201      ternary r20 r22.r1.e3 r132.r1.e3 into r135;
202      cast r133 r134 r135 into r136 as Row;
203      ternary r20 r22.r2.e1 r132.r2.e1 into r137;
204      ternary r20 r22.r2.e2 r132.r2.e2 into r138;
205      ternary r20 r22.r2.e3 r132.r2.e3 into r139;
206      cast r137 r138 r139 into r140 as Row;
207      ternary r20 r22.r3.e1 r132.r3.e1 into r141;
208      ternary r20 r22.r3.e2 r132.r3.e2 into r142;
209      ternary r20 r22.r3.e3 r132.r3.e3 into r143;
210      cast r141 r142 r143 into r144 as Row;
211      cast r136 r140 r144 into r145 as Board;
212      ternary r14 r16.r1.e1 r145.r1.e1 into r146;
213      ternary r14 r16.r1.e2 r145.r1.e2 into r147;
214      ternary r14 r16.r1.e3 r145.r1.e3 into r148;
215      cast r146 r147 r148 into r149 as Row;
216      ternary r14 r16.r2.e1 r145.r2.e1 into r150;
217      ternary r14 r16.r2.e2 r145.r2.e2 into r151;
218      ternary r14 r16.r2.e3 r145.r2.e3 into r152;
219      cast r150 r151 r152 into r153 as Row;
220      ternary r14 r16.r3.e1 r145.r3.e1 into r154;
221      ternary r14 r16.r3.e2 r145.r3.e2 into r155;
222      ternary r14 r16.r3.e3 r145.r3.e3 into r156;
223      cast r154 r155 r156 into r157 as Row;
224      cast r149 r153 r157 into r158 as Board;
225      ternary r8 r10.r1.e1 r158.r1.e1 into r159;
226      ternary r8 r10.r1.e2 r158.r1.e2 into r160;
227      ternary r8 r10.r1.e3 r158.r1.e3 into r161;
228      cast r159 r160 r161 into r162 as Row;
229      ternary r8 r10.r2.e1 r158.r2.e1 into r163;
230      ternary r8 r10.r2.e2 r158.r2.e2 into r164;
231      ternary r8 r10.r2.e3 r158.r2.e3 into r165;
232      cast r163 r164 r165 into r166 as Row;
233      ternary r8 r10.r3.e1 r158.r3.e1 into r167;
234      ternary r8 r10.r3.e2 r158.r3.e2 into r168;
235      ternary r8 r10.r3.e3 r158.r3.e3 into r169;
236      cast r167 r168 r169 into r170 as Row;
237      cast r162 r166 r170 into r171 as Board;
238      call win r171 1u8 into r172;
239      not r172 into r173;
240      call win r171 2u8 into r174;
241      and r173 r174 into r175;
242      ternary r175 r171.r1.e1 r171.r1.e1 into r176;
243      ternary r175 r171.r1.e2 r171.r1.e2 into r177;
244      ternary r175 r171.r1.e3 r171.r1.e3 into r178;
245      cast r176 r177 r178 into r179 as Row;
246      ternary r175 r171.r2.e1 r171.r2.e1 into r180;
247      ternary r175 r171.r2.e2 r171.r2.e2 into r181;
248      ternary r175 r171.r2.e3 r171.r2.e3 into r182;
249      cast r180 r181 r182 into r183 as Row;
250      ternary r175 r171.r3.e1 r171.r3.e1 into r184;
251      ternary r175 r171.r3.e2 r171.r3.e2 into r185;
252      ternary r175 r171.r3.e3 r171.r3.e3 into r186;
253      cast r184 r185 r186 into r187 as Row;
254      cast r179 r183 r187 into r188 as Board;
255      ternary r172 r171.r1.e1 r188.r1.e1 into r189;
256      ternary r172 r171.r1.e2 r188.r1.e2 into r190;
257      ternary r172 r171.r1.e3 r188.r1.e3 into r191;
258      cast r189 r190 r191 into r192 as Row;
259      ternary r172 r171.r2.e1 r188.r2.e1 into r193;
260      ternary r172 r171.r2.e2 r188.r2.e2 into r194;
261      ternary r172 r171.r2.e3 r188.r2.e3 into r195;
262      cast r193 r194 r195 into r196 as Row;
263      ternary r172 r171.r3.e1 r188.r3.e1 into r197;
264      ternary r172 r171.r3.e2 r188.r3.e2 into r198;
265      ternary r172 r171.r3.e3 r188.r3.e3 into r199;
266      cast r197 r198 r199 into r200 as Row;
267      cast r192 r196 r200 into r201 as Board;
268      ternary r175 2u8 0u8 into r202;
269      ternary r172 1u8 r202 into r203;
270      output r201 as Board.private;
271      output r203 as u8.private;