This repository was archived by the owner on Dec 23, 2022. It is now read-only.
forked from nitlang/nit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore__bytes.sep.1.c
2459 lines (2459 loc) · 68.8 KB
/
core__bytes.sep.1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "core__bytes.sep.0.h"
/* method bytes$Bytes$items for (self: Bytes): CString */
char* core___core__Bytes___items(val* self) {
char* var /* : CString */;
char* var1 /* : CString */;
var1 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var = var1;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$items= for (self: Bytes, CString) */
void core___core__Bytes___items_61d(val* self, char* p0) {
self->attrs[COLOR_core__bytes__Bytes___items].str = p0; /* _items on <self:Bytes> */
RET_LABEL:;
}
/* method bytes$Bytes$length for (self: Bytes): Int */
long core___core__Bytes___core__abstract_collection__Collection__length(val* self) {
long var /* : Int */;
long var1 /* : Int */;
var1 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var = var1;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$length= for (self: Bytes, Int) */
void core___core__Bytes___core__array__AbstractArrayRead__length_61d(val* self, long p0) {
self->attrs[COLOR_core__bytes__Bytes___length].l = p0; /* _length on <self:Bytes> */
RET_LABEL:;
}
/* method bytes$Bytes$capacity for (self: Bytes): Int */
long core___core__Bytes___capacity(val* self) {
long var /* : Int */;
long var1 /* : Int */;
var1 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on <self:Bytes> */
var = var1;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$capacity= for (self: Bytes, Int) */
void core___core__Bytes___capacity_61d(val* self, long p0) {
self->attrs[COLOR_core__bytes__Bytes___capacity].l = p0; /* _capacity on <self:Bytes> */
RET_LABEL:;
}
/* method bytes$Bytes$persisted for (self: Bytes): Bool */
short int core___core__Bytes___persisted(val* self) {
short int var /* : Bool */;
short int var1 /* : Bool */;
var1 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on <self:Bytes> */
var = var1;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$persisted= for (self: Bytes, Bool) */
void core___core__Bytes___persisted_61d(val* self, short int p0) {
self->attrs[COLOR_core__bytes__Bytes___persisted].s = p0; /* _persisted on <self:Bytes> */
RET_LABEL:;
}
/* method bytes$Bytes$empty for (self: Bytes) */
void core___core__Bytes___empty(val* self) {
static char* varoncenew;
static int varoncenew_guard;
char* var /* : CString */;
char* var1 /* : CString */;
char* var2 /* : CString */;
char* var4 /* : CString */;
char* var_ns /* var ns: CString */;
if (likely(varoncenew_guard)) {
var = varoncenew;
} else {
var1 = NULL/*special!*/;
var = var1;
varoncenew = var;
varoncenew_guard = 1;
}
{
{ /* Inline native$CString$new (var,0l) on <var:CString> */
var4 = (char*)nit_alloc(0l);
var2 = var4;
goto RET_LABEL3;
RET_LABEL3:(void)0;
}
}
var_ns = var2;
{
((void(*)(val* self, char* p0))(self->class->vft[COLOR_core__bytes__Bytes__items_61d]))(self, var_ns); /* items= on <self:Bytes>*/
}
{
((void(*)(val* self, long p0))(self->class->vft[COLOR_core__array__AbstractArrayRead__length_61d]))(self, 0l); /* length= on <self:Bytes>*/
}
{
((void(*)(val* self, long p0))(self->class->vft[COLOR_core__bytes__Bytes__capacity_61d]))(self, 0l); /* capacity= on <self:Bytes>*/
}
{
((void(*)(val* self))(self->class->vft[COLOR_core__kernel__Object__init]))(self); /* init on <self:Bytes>*/
}
RET_LABEL:;
}
/* method bytes$Bytes$with_capacity for (self: Bytes, Int) */
void core___core__Bytes___with_capacity(val* self, long p0) {
long var_cap /* var cap: Int */;
static char* varoncenew;
static int varoncenew_guard;
char* var /* : CString */;
char* var1 /* : CString */;
char* var2 /* : CString */;
char* var4 /* : CString */;
char* var_ns /* var ns: CString */;
var_cap = p0;
if (likely(varoncenew_guard)) {
var = varoncenew;
} else {
var1 = NULL/*special!*/;
var = var1;
varoncenew = var;
varoncenew_guard = 1;
}
{
{ /* Inline native$CString$new (var,var_cap) on <var:CString> */
var4 = (char*)nit_alloc(var_cap);
var2 = var4;
goto RET_LABEL3;
RET_LABEL3:(void)0;
}
}
var_ns = var2;
{
((void(*)(val* self, char* p0))(self->class->vft[COLOR_core__bytes__Bytes__items_61d]))(self, var_ns); /* items= on <self:Bytes>*/
}
{
((void(*)(val* self, long p0))(self->class->vft[COLOR_core__array__AbstractArrayRead__length_61d]))(self, 0l); /* length= on <self:Bytes>*/
}
{
((void(*)(val* self, long p0))(self->class->vft[COLOR_core__bytes__Bytes__capacity_61d]))(self, var_cap); /* capacity= on <self:Bytes>*/
}
{
((void(*)(val* self))(self->class->vft[COLOR_core__kernel__Object__init]))(self); /* init on <self:Bytes>*/
}
RET_LABEL:;
}
/* method bytes$Bytes$is_empty for (self: Bytes): Bool */
short int core___core__Bytes___core__abstract_collection__Collection__is_empty(val* self) {
short int var /* : Bool */;
long var1 /* : Int */;
long var3 /* : Int */;
short int var4 /* : Bool */;
short int var6 /* : Bool */;
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var3 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var1 = var3;
RET_LABEL2:(void)0;
}
}
{
{ /* Inline kernel$Int$== (var1,0l) on <var1:Int> */
var6 = var1 == 0l;
var4 = var6;
goto RET_LABEL5;
RET_LABEL5:(void)0;
}
}
var = var4;
goto RET_LABEL;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$[] for (self: Bytes, Int): Byte */
unsigned char core___core__Bytes___core__abstract_collection__SequenceRead___91d_93d(val* self, long p0) {
unsigned char var /* : Byte */;
long var_i /* var i: Int */;
short int var1 /* : Bool */;
short int var3 /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
short int var4 /* : Bool */;
long var5 /* : Int */;
long var7 /* : Int */;
short int var8 /* : Bool */;
short int var10 /* : Bool */;
int cltype11;
int idtype12;
const char* var_class_name13;
short int var14 /* : Bool */;
char* var15 /* : CString */;
char* var17 /* : CString */;
unsigned char var18 /* : Byte */;
unsigned char var20 /* : Byte */;
var_i = p0;
{
{ /* Inline kernel$Int$>= (var_i,0l) on <var_i:Int> */
/* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */
/* <0l:Int> isa OTHER */
var3 = 1; /* easy <0l:Int> isa OTHER*/
if (unlikely(!var3)) {
var_class_name = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726);
fatal_exit(1);
}
var4 = var_i >= 0l;
var1 = var4;
goto RET_LABEL2;
RET_LABEL2:(void)0;
}
}
if (unlikely(!var1)) {
if(catchStack.cursor >= 0){
longjmp(catchStack.envs[catchStack.cursor], 1);
}
PRINT_ERROR("Runtime error: %s", "Assert failed");
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 184);
fatal_exit(1);
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var7 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var5 = var7;
RET_LABEL6:(void)0;
}
}
{
{ /* Inline kernel$Int$< (var_i,var5) on <var_i:Int> */
/* Covariant cast for argument 0 (i) <var5:Int> isa OTHER */
/* <var5:Int> isa OTHER */
var10 = 1; /* easy <var5:Int> isa OTHER*/
if (unlikely(!var10)) {
var_class_name13 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name13);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725);
fatal_exit(1);
}
var14 = var_i < var5;
var8 = var14;
goto RET_LABEL9;
RET_LABEL9:(void)0;
}
}
if (unlikely(!var8)) {
if(catchStack.cursor >= 0){
longjmp(catchStack.envs[catchStack.cursor], 1);
}
PRINT_ERROR("Runtime error: %s", "Assert failed");
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 185);
fatal_exit(1);
}
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var17 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var15 = var17;
RET_LABEL16:(void)0;
}
}
{
{ /* Inline native$CString$[] (var15,var_i) on <var15:CString> */
var20 = (unsigned char)((int)var15[var_i]);
var18 = var20;
goto RET_LABEL19;
RET_LABEL19:(void)0;
}
}
var = var18;
goto RET_LABEL;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$[] for (self: SequenceRead[nullable Object], Int): nullable Object */
val* VIRTUAL_core___core__Bytes___core__abstract_collection__SequenceRead___91d_93d(val* self, long p0) {
val* var /* : nullable Object */;
unsigned char var1 /* : Byte */;
val* var2 /* : nullable Object */;
var1 = core___core__Bytes___core__abstract_collection__SequenceRead___91d_93d(self, p0);
var2 = BOX_core__Byte(var1); /* autobox from Byte to nullable Object */
var = var2;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$[]= for (self: Bytes, Int, Byte) */
void core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(val* self, long p0, unsigned char p1) {
short int var /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
long var_i /* var i: Int */;
unsigned char var_v /* var v: Byte */;
short int var1 /* : Bool */;
short int var3 /* : Bool */;
short int var4 /* : Bool */;
short int var6 /* : Bool */;
int cltype7;
int idtype8;
const char* var_class_name9;
short int var10 /* : Bool */;
long var11 /* : Int */;
long var13 /* : Int */;
short int var14 /* : Bool */;
short int var16 /* : Bool */;
int cltype17;
int idtype18;
const char* var_class_name19;
short int var20 /* : Bool */;
long var21 /* : Int */;
long var23 /* : Int */;
short int var24 /* : Bool */;
short int var26 /* : Bool */;
char* var27 /* : CString */;
char* var29 /* : CString */;
/* Covariant cast for argument 1 (v) <p1:Byte> isa Byte */
/* <p1:Byte> isa Byte */
var = 1; /* easy <p1:Byte> isa Byte*/
if (unlikely(!var)) {
var_class_name = type_core__Byte.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Byte", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 370);
fatal_exit(1);
}
var_i = p0;
var_v = p1;
{
{ /* Inline bytes$Bytes$persisted (self) on <self:Bytes> */
var3 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on <self:Bytes> */
var1 = var3;
RET_LABEL2:(void)0;
}
}
if (var1){
{
core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on <self:Bytes>*/
}
} else {
}
{
{ /* Inline kernel$Int$>= (var_i,0l) on <var_i:Int> */
/* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */
/* <0l:Int> isa OTHER */
var6 = 1; /* easy <0l:Int> isa OTHER*/
if (unlikely(!var6)) {
var_class_name9 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name9);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726);
fatal_exit(1);
}
var10 = var_i >= 0l;
var4 = var10;
goto RET_LABEL5;
RET_LABEL5:(void)0;
}
}
if (unlikely(!var4)) {
if(catchStack.cursor >= 0){
longjmp(catchStack.envs[catchStack.cursor], 1);
}
PRINT_ERROR("Runtime error: %s", "Assert failed");
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 375);
fatal_exit(1);
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var13 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var11 = var13;
RET_LABEL12:(void)0;
}
}
{
{ /* Inline kernel$Int$<= (var_i,var11) on <var_i:Int> */
/* Covariant cast for argument 0 (i) <var11:Int> isa OTHER */
/* <var11:Int> isa OTHER */
var16 = 1; /* easy <var11:Int> isa OTHER*/
if (unlikely(!var16)) {
var_class_name19 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name19);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 724);
fatal_exit(1);
}
var20 = var_i <= var11;
var14 = var20;
goto RET_LABEL15;
RET_LABEL15:(void)0;
}
}
if (unlikely(!var14)) {
if(catchStack.cursor >= 0){
longjmp(catchStack.envs[catchStack.cursor], 1);
}
PRINT_ERROR("Runtime error: %s", "Assert failed");
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 376);
fatal_exit(1);
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var23 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var21 = var23;
RET_LABEL22:(void)0;
}
}
{
{ /* Inline kernel$Int$== (var_i,var21) on <var_i:Int> */
var26 = var_i == var21;
var24 = var26;
goto RET_LABEL25;
RET_LABEL25:(void)0;
}
}
if (var24){
{
core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_v); /* Direct call bytes$Bytes$add on <self:Bytes>*/
}
} else {
}
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var29 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var27 = var29;
RET_LABEL28:(void)0;
}
}
{
{ /* Inline native$CString$[]= (var27,var_i,var_v) on <var27:CString> */
var27[var_i]=(unsigned char)var_v;
RET_LABEL30:(void)0;
}
}
RET_LABEL:;
}
/* method bytes$Bytes$[]= for (self: Sequence[nullable Object], Int, nullable Object) */
void VIRTUAL_core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(val* self, long p0, val* p1) {
unsigned char var /* : Byte */;
var = ((struct instance_core__Byte*)p1)->value; /* autounbox from nullable Object to Byte */;
core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(self, p0, var); /* Direct call bytes$Bytes$[]= on <self:Sequence[nullable Object](Bytes)>*/
RET_LABEL:;
}
/* method bytes$Bytes$add for (self: Bytes, Byte) */
void core___core__Bytes___core__abstract_collection__SimpleCollection__add(val* self, unsigned char p0) {
short int var /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
unsigned char var_c /* var c: Byte */;
short int var1 /* : Bool */;
short int var3 /* : Bool */;
long var4 /* : Int */;
long var6 /* : Int */;
long var7 /* : Int */;
long var9 /* : Int */;
short int var10 /* : Bool */;
short int var12 /* : Bool */;
int cltype13;
int idtype14;
const char* var_class_name15;
short int var16 /* : Bool */;
long var17 /* : Int */;
long var19 /* : Int */;
char* var20 /* : CString */;
char* var22 /* : CString */;
long var23 /* : Int */;
long var25 /* : Int */;
val* var_ /* var : Bytes */;
long var27 /* : Int */;
long var29 /* : Int */;
long var30 /* : Int */;
short int var32 /* : Bool */;
int cltype33;
int idtype34;
const char* var_class_name35;
long var36 /* : Int */;
/* Covariant cast for argument 0 (c) <p0:Byte> isa Byte */
/* <p0:Byte> isa Byte */
var = 1; /* easy <p0:Byte> isa Byte*/
if (unlikely(!var)) {
var_class_name = type_core__Byte.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Byte", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 381);
fatal_exit(1);
}
var_c = p0;
{
{ /* Inline bytes$Bytes$persisted (self) on <self:Bytes> */
var3 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on <self:Bytes> */
var1 = var3;
RET_LABEL2:(void)0;
}
}
if (var1){
{
core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on <self:Bytes>*/
}
} else {
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var6 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var4 = var6;
RET_LABEL5:(void)0;
}
}
{
{ /* Inline bytes$Bytes$capacity (self) on <self:Bytes> */
var9 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on <self:Bytes> */
var7 = var9;
RET_LABEL8:(void)0;
}
}
{
{ /* Inline kernel$Int$>= (var4,var7) on <var4:Int> */
/* Covariant cast for argument 0 (i) <var7:Int> isa OTHER */
/* <var7:Int> isa OTHER */
var12 = 1; /* easy <var7:Int> isa OTHER*/
if (unlikely(!var12)) {
var_class_name15 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name15);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726);
fatal_exit(1);
}
var16 = var4 >= var7;
var10 = var16;
goto RET_LABEL11;
RET_LABEL11:(void)0;
}
}
if (var10){
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var19 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var17 = var19;
RET_LABEL18:(void)0;
}
}
{
core___core__Bytes___core__array__AbstractArray__enlarge(self, var17); /* Direct call bytes$Bytes$enlarge on <self:Bytes>*/
}
} else {
}
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var22 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var20 = var22;
RET_LABEL21:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var25 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var23 = var25;
RET_LABEL24:(void)0;
}
}
{
{ /* Inline native$CString$[]= (var20,var23,var_c) on <var20:CString> */
var20[var23]=(unsigned char)var_c;
RET_LABEL26:(void)0;
}
}
var_ = self;
{
{ /* Inline bytes$Bytes$length (var_) on <var_:Bytes> */
var29 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <var_:Bytes> */
var27 = var29;
RET_LABEL28:(void)0;
}
}
{
{ /* Inline kernel$Int$+ (var27,1l) on <var27:Int> */
/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
/* <1l:Int> isa OTHER */
var32 = 1; /* easy <1l:Int> isa OTHER*/
if (unlikely(!var32)) {
var_class_name35 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728);
fatal_exit(1);
}
var36 = var27 + 1l;
var30 = var36;
goto RET_LABEL31;
RET_LABEL31:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length= (var_,var30) on <var_:Bytes> */
var_->attrs[COLOR_core__bytes__Bytes___length].l = var30; /* _length on <var_:Bytes> */
RET_LABEL37:(void)0;
}
}
RET_LABEL:;
}
/* method bytes$Bytes$add for (self: SimpleCollection[nullable Object], nullable Object) */
void VIRTUAL_core___core__Bytes___core__abstract_collection__SimpleCollection__add(val* self, val* p0) {
unsigned char var /* : Byte */;
var = ((struct instance_core__Byte*)p0)->value; /* autounbox from nullable Object to Byte */;
core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var); /* Direct call bytes$Bytes$add on <self:SimpleCollection[nullable Object](Bytes)>*/
RET_LABEL:;
}
/* method bytes$Bytes$add_char for (self: Bytes, Char) */
void core___core__Bytes___add_char(val* self, uint32_t p0) {
uint32_t var_c /* var c: Char */;
short int var /* : Bool */;
short int var2 /* : Bool */;
long var3 /* : Int */;
long var_cln /* var cln: Int */;
long var4 /* : Int */;
long var6 /* : Int */;
long var_ln /* var ln: Int */;
long var7 /* : Int */;
short int var9 /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
long var10 /* : Int */;
char* var11 /* : CString */;
char* var13 /* : CString */;
long var14 /* : Int */;
long var16 /* : Int */;
val* var_ /* var : Bytes */;
long var17 /* : Int */;
long var19 /* : Int */;
long var20 /* : Int */;
short int var22 /* : Bool */;
int cltype23;
int idtype24;
const char* var_class_name25;
long var26 /* : Int */;
var_c = p0;
{
{ /* Inline bytes$Bytes$persisted (self) on <self:Bytes> */
var2 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on <self:Bytes> */
var = var2;
RET_LABEL1:(void)0;
}
}
if (var){
{
core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on <self:Bytes>*/
}
} else {
}
{
var3 = core__abstract_text___Char___u8char_len(var_c);
}
var_cln = var3;
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var6 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var4 = var6;
RET_LABEL5:(void)0;
}
}
var_ln = var4;
{
{ /* Inline kernel$Int$+ (var_ln,var_cln) on <var_ln:Int> */
/* Covariant cast for argument 0 (i) <var_cln:Int> isa OTHER */
/* <var_cln:Int> isa OTHER */
var9 = 1; /* easy <var_cln:Int> isa OTHER*/
if (unlikely(!var9)) {
var_class_name = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728);
fatal_exit(1);
}
var10 = var_ln + var_cln;
var7 = var10;
goto RET_LABEL8;
RET_LABEL8:(void)0;
}
}
{
core___core__Bytes___core__array__AbstractArray__enlarge(self, var7); /* Direct call bytes$Bytes$enlarge on <self:Bytes>*/
}
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var13 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var11 = var13;
RET_LABEL12:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var16 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var14 = var16;
RET_LABEL15:(void)0;
}
}
{
core__flat___CString___set_char_at(var11, var14, var_c); /* Direct call flat$CString$set_char_at on <var11:CString>*/
}
var_ = self;
{
{ /* Inline bytes$Bytes$length (var_) on <var_:Bytes> */
var19 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <var_:Bytes> */
var17 = var19;
RET_LABEL18:(void)0;
}
}
{
{ /* Inline kernel$Int$+ (var17,var_cln) on <var17:Int> */
/* Covariant cast for argument 0 (i) <var_cln:Int> isa OTHER */
/* <var_cln:Int> isa OTHER */
var22 = 1; /* easy <var_cln:Int> isa OTHER*/
if (unlikely(!var22)) {
var_class_name25 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name25);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728);
fatal_exit(1);
}
var26 = var17 + var_cln;
var20 = var26;
goto RET_LABEL21;
RET_LABEL21:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length= (var_,var20) on <var_:Bytes> */
var_->attrs[COLOR_core__bytes__Bytes___length].l = var20; /* _length on <var_:Bytes> */
RET_LABEL27:(void)0;
}
}
RET_LABEL:;
}
/* method bytes$Bytes$append for (self: Bytes, Collection[Byte]) */
void core___core__Bytes___core__abstract_collection__Sequence__append(val* self, val* p0) {
short int var /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
val* var_arr /* var arr: Collection[Byte] */;
short int var1 /* : Bool */;
int cltype2;
int idtype3;
char* var4 /* : CString */;
char* var6 /* : CString */;
long var7 /* : Int */;
long var9 /* : Int */;
val* var_ /* var : Collection[Byte] */;
val* var10 /* : Iterator[nullable Object] */;
val* var_11 /* var : Iterator[Byte] */;
short int var12 /* : Bool */;
val* var13 /* : nullable Object */;
unsigned char var14 /* : Byte */;
unsigned char var_i /* var i: Byte */;
/* Covariant cast for argument 0 (arr) <p0:Collection[Byte]> isa Collection[Byte] */
/* <p0:Collection[Byte]> isa Collection[Byte] */
var = 1; /* easy <p0:Collection[Byte]> isa Collection[Byte]*/
if (unlikely(!var)) {
var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[Byte]", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 408);
fatal_exit(1);
}
var_arr = p0;
/* <var_arr:Collection[Byte]> isa Bytes */
cltype2 = type_core__Bytes.color;
idtype3 = type_core__Bytes.id;
if(cltype2 >= (((long)var_arr&3)?type_info[((long)var_arr&3)]:var_arr->type)->table_size) {
var1 = 0;
} else {
var1 = (((long)var_arr&3)?type_info[((long)var_arr&3)]:var_arr->type)->type_table[cltype2] == idtype3;
}
if (var1){
{
{ /* Inline bytes$Bytes$items (var_arr) on <var_arr:Collection[Byte](Bytes)> */
var6 = var_arr->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <var_arr:Collection[Byte](Bytes)> */
var4 = var6;
RET_LABEL5:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length (var_arr) on <var_arr:Collection[Byte](Bytes)> */
var9 = var_arr->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <var_arr:Collection[Byte](Bytes)> */
var7 = var9;
RET_LABEL8:(void)0;
}
}
{
core___core__Bytes___append_ns(self, var4, var7); /* Direct call bytes$Bytes$append_ns on <self:Bytes>*/
}
} else {
var_ = var_arr;
{
var10 = ((val*(*)(val* self))((((long)var_&3)?class_info[((long)var_&3)]:var_->class)->vft[COLOR_core__abstract_collection__Collection__iterator]))(var_); /* iterator on <var_:Collection[Byte]>*/
}
var_11 = var10;
for(;;) {
{
var12 = ((short int(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var_11->class)->vft[COLOR_core__abstract_collection__Iterator__is_ok]))(var_11); /* is_ok on <var_11:Iterator[Byte]>*/
}
if (var12){
} else {
goto BREAK_label;
}
{
var13 = ((val*(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var_11->class)->vft[COLOR_core__abstract_collection__Iterator__item]))(var_11); /* item on <var_11:Iterator[Byte]>*/
}
var14 = ((struct instance_core__Byte*)var13)->value; /* autounbox from nullable Object to Byte */;
var_i = var14;
{
core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_i); /* Direct call bytes$Bytes$add on <self:Bytes>*/
}
{
((void(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var_11->class)->vft[COLOR_core__abstract_collection__Iterator__next]))(var_11); /* next on <var_11:Iterator[Byte]>*/
}
}
BREAK_label: (void)0;
{
((void(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var_11->class)->vft[COLOR_core__abstract_collection__Iterator__finish]))(var_11); /* finish on <var_11:Iterator[Byte]>*/
}
}
RET_LABEL:;
}
/* method bytes$Bytes$pop for (self: Bytes): Byte */
unsigned char core___core__Bytes___core__abstract_collection__Sequence__pop(val* self) {
unsigned char var /* : Byte */;
long var1 /* : Int */;
long var3 /* : Int */;
short int var4 /* : Bool */;
short int var6 /* : Bool */;
int cltype;
int idtype;
const char* var_class_name;
short int var7 /* : Bool */;
val* var_ /* var : Bytes */;
long var8 /* : Int */;
long var10 /* : Int */;
long var11 /* : Int */;
short int var13 /* : Bool */;
int cltype14;
int idtype15;
const char* var_class_name16;
long var17 /* : Int */;
char* var19 /* : CString */;
char* var21 /* : CString */;
long var22 /* : Int */;
long var24 /* : Int */;
unsigned char var25 /* : Byte */;
unsigned char var27 /* : Byte */;
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var3 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var1 = var3;
RET_LABEL2:(void)0;
}
}
{
{ /* Inline kernel$Int$>= (var1,1l) on <var1:Int> */
/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
/* <1l:Int> isa OTHER */
var6 = 1; /* easy <1l:Int> isa OTHER*/
if (unlikely(!var6)) {
var_class_name = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726);
fatal_exit(1);
}
var7 = var1 >= 1l;
var4 = var7;
goto RET_LABEL5;
RET_LABEL5:(void)0;
}
}
if (unlikely(!var4)) {
if(catchStack.cursor >= 0){
longjmp(catchStack.envs[catchStack.cursor], 1);
}
PRINT_ERROR("Runtime error: %s", "Assert failed");
PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 424);
fatal_exit(1);
}
var_ = self;
{
{ /* Inline bytes$Bytes$length (var_) on <var_:Bytes> */
var10 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <var_:Bytes> */
var8 = var10;
RET_LABEL9:(void)0;
}
}
{
{ /* Inline kernel$Int$- (var8,1l) on <var8:Int> */
/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
/* <1l:Int> isa OTHER */
var13 = 1; /* easy <1l:Int> isa OTHER*/
if (unlikely(!var13)) {
var_class_name16 = type_core__Int.name;
PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name16);
PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
fatal_exit(1);
}
var17 = var8 - 1l;
var11 = var17;
goto RET_LABEL12;
RET_LABEL12:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length= (var_,var11) on <var_:Bytes> */
var_->attrs[COLOR_core__bytes__Bytes___length].l = var11; /* _length on <var_:Bytes> */
RET_LABEL18:(void)0;
}
}
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var21 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var19 = var21;
RET_LABEL20:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var24 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var22 = var24;
RET_LABEL23:(void)0;
}
}
{
{ /* Inline native$CString$[] (var19,var22) on <var19:CString> */
var27 = (unsigned char)((int)var19[var22]);
var25 = var27;
goto RET_LABEL26;
RET_LABEL26:(void)0;
}
}
var = var25;
goto RET_LABEL;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$pop for (self: Sequence[nullable Object]): nullable Object */
val* VIRTUAL_core___core__Bytes___core__abstract_collection__Sequence__pop(val* self) {
val* var /* : nullable Object */;
unsigned char var1 /* : Byte */;
val* var2 /* : nullable Object */;
var1 = core___core__Bytes___core__abstract_collection__Sequence__pop(self);
var2 = BOX_core__Byte(var1); /* autobox from Byte to nullable Object */
var = var2;
RET_LABEL:;
return var;
}
/* method bytes$Bytes$clear for (self: Bytes) */
void core___core__Bytes___core__abstract_collection__RemovableCollection__clear(val* self) {
{
{ /* Inline bytes$Bytes$length= (self,0l) on <self:Bytes> */
self->attrs[COLOR_core__bytes__Bytes___length].l = 0l; /* _length on <self:Bytes> */
RET_LABEL1:(void)0;
}
}
RET_LABEL:;
}
/* method bytes$Bytes$regen for (self: Bytes) */
void core___core__Bytes___regen(val* self) {
static char* varoncenew;
static int varoncenew_guard;
char* var /* : CString */;
char* var1 /* : CString */;
long var2 /* : Int */;
long var4 /* : Int */;
char* var5 /* : CString */;
char* var7 /* : CString */;
char* var_nns /* var nns: CString */;
char* var8 /* : CString */;
char* var10 /* : CString */;
long var11 /* : Int */;
long var13 /* : Int */;
if (likely(varoncenew_guard)) {
var = varoncenew;
} else {
var1 = NULL/*special!*/;
var = var1;
varoncenew = var;
varoncenew_guard = 1;
}
{
{ /* Inline bytes$Bytes$capacity (self) on <self:Bytes> */
var4 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on <self:Bytes> */
var2 = var4;
RET_LABEL3:(void)0;
}
}
{
{ /* Inline native$CString$new (var,var2) on <var:CString> */
var7 = (char*)nit_alloc(var2);
var5 = var7;
goto RET_LABEL6;
RET_LABEL6:(void)0;
}
}
var_nns = var5;
{
{ /* Inline bytes$Bytes$items (self) on <self:Bytes> */
var10 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on <self:Bytes> */
var8 = var10;
RET_LABEL9:(void)0;
}
}
{
{ /* Inline bytes$Bytes$length (self) on <self:Bytes> */
var13 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on <self:Bytes> */
var11 = var13;
RET_LABEL12:(void)0;
}
}
{
{ /* Inline native$CString$copy_to (var8,var_nns,var11,0l,0l) on <var8:CString> */
memmove(var_nns+0l,var8+0l,var11);