File: Error.c

package info (click to toggle)
oo2c32 1.5.4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,888 kB
  • ctags: 5,436
  • sloc: ansic: 95,310; sh: 473; makefile: 345; perl: 57; lisp: 20
file content (774 lines) | stat: -rw-r--r-- 21,902 bytes parent folder | download
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
/* file generated by oo2c -- do not edit */
#include "__oo2c.h"
#include "__libc.h"
#include "Error.d"

static _ModId _mid;

void Error__ReadErrorList_SkipWhitespace(BinaryRider__Reader *Error__ReadErrorList_r, unsigned char *Error__ReadErrorList_ch) {
  register int i0, i1, i2, i3, i4;
  i3 = (int)*Error__ReadErrorList_r;
  i0 = (int)*(void**)i3;
  i0 = i0 != 0;
  if (i0) goto l1;
  i4 = *Error__ReadErrorList_ch;
  i2 = i4 == 10;
  if (i2) goto l1;
  i1 = i4 > 32;
  if (i1) goto l1;
  i0 = *(int*)(i3-4);
  i4 = (int)((_Type)i0)->tbprocs[7];
l0:
  i0 = *Error__ReadErrorList_ch;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i4)((BinaryRider__Reader)i3, (unsigned char *)(int)Error__ReadErrorList_ch);
  i0 = (int)*(void**)i3;
  i0 = i0 != 0;
  if (i0) goto l1;
  i2 = *Error__ReadErrorList_ch;
  i0 = i2 == 10;
  if (i0) goto l1;
  i2 = i2 <= 32;
  if (i2) goto l0;
l1:
  ;
}

void Error__ReadErrorList_Err(unsigned char* Error__ReadErrorList_fileName, int Error__ReadErrorList_fileName_0d, short int *Error__ReadErrorList_line) {
  register int i0;
  unsigned char num[32];
  unsigned char str[256];
  (void)memcpy((void*) (int)str, (const void*) (int)_c0, 16);
  Strings__Append((const unsigned char*)(int)Error__ReadErrorList_fileName, Error__ReadErrorList_fileName_0d, (unsigned char*)(int)str, 256);
  Strings__Append((const unsigned char*)(int)_c1, 8, (unsigned char*)(int)str, 256);
  i0 = *Error__ReadErrorList_line;
  IntStr__IntToStr((int)i0, (unsigned char*)(int)num, 32);
  Strings__Append((const unsigned char*)(int)num, 32, (unsigned char*)(int)str, 256);
  Parameter__FatalError((const unsigned char*)(int)str, 256);
}

void Error__ReadErrorList(const unsigned char* fileName__ref, int fileName_0d) {
  register int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11;
  unsigned char ch;
  Parameter__Filename expFileName;
  short int line;
  BinaryRider__Reader r;
  Msg__Msg res;
  unsigned char str[256];
  unsigned char* fileName;
  char* _old_top_vs = _top_vs;
  _push_value(int, fileName, fileName__ref, fileName_0d);
  Error__errListRead = 1;
  Filenames__ExpandPath((unsigned char*)(int)expFileName, 256, (const unsigned char*)(int)fileName, fileName_0d);
  i10 = (int)Files__Old((const unsigned char*)(int)expFileName, 256, (unsigned int)0x1U, (Msg__Msg *)(int)&res);
  i0 = i10 == 0;
  if (i0) goto l21;
  i0 = (int)BinaryRider__ConnectReader((Channel__Channel)i10);
  i9 = *(int*)(i0-4);
  i9 = (int)((_Type)i9)->tbprocs[7];
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i9)((BinaryRider__Reader)i0, (unsigned char *)(int)&ch);
  i9 = (int)*(void**)i0;
  i9 = i9 != 0;
  if (i9) goto l20;
  i1 = (int)ch;
  i2 = 1;
l0:
  i9 = i1 == 42;
  if (i9) goto l1;
  i3 = i2;
  goto l16;
l1:
  i3 = *(int*)(i0-4);
  i3 = (int)((_Type)i3)->tbprocs[7];
  ch = (unsigned char)42;
  ch = (unsigned char)42;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i3)((BinaryRider__Reader)i0, (unsigned char *)(int)&ch);
  r = (void*)i0;
  r = (void*)i0;
  Error__ReadErrorList_SkipWhitespace((BinaryRider__Reader *)&r, &ch);
  i3 = (int)*(void**)(int)r;
  i3 = i3 != 0;
  if (i3) goto l4;
  i5 = (int)ch < 48;
  if (i5) goto l4;
  i3 = (int)ch > 57;
  if (i3) goto l4;
  i5 = *(int*)((int)r-4);
  i5 = (int)((_Type)i5)->tbprocs[7];
  i11 = (int)ch;
  i9 = 0;
l2:
  ch = (unsigned char)i11;
  ch = (unsigned char)i11;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i5)((BinaryRider__Reader)(int)r, (unsigned char *)(int)&ch);
  i9 *= 10;
  i11 += i9;
  i9 = i11 - 48;
  i11 = (int)*(void**)(int)r;
  i11 = i11 != 0;
  if (i11) goto l3;
  i11 = (int)ch < 48;
  if (i11) goto l3;
  i11 = (int)ch > 57;
  if (i11) goto l3;
  i11 = (int)ch;
  goto l2;
l3:
  i3 = (int)ch;
  goto l5;
l4:
  i9 = 0;
  i3 = (int)ch;
l5:
  ch = (unsigned char)i3;
  ch = (unsigned char)i3;
  Error__ReadErrorList_SkipWhitespace((BinaryRider__Reader *)&r, &ch);
  i4 = (int)r;
  i3 = i9 == 0;
  if (i3) goto l14;
  i3 = (int)ch != 58;
  if (i3) goto l14;
  i11 = *(int*)(i4-4);
  i11 = (int)((_Type)i11)->tbprocs[7];
  ch = (unsigned char)58;
  ch = (unsigned char)58;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i11)((BinaryRider__Reader)i4, (unsigned char *)(int)&ch);
  r = (void*)i4;
  r = (void*)i4;
  Error__ReadErrorList_SkipWhitespace((BinaryRider__Reader *)&r, &ch);
  i11 = (int)*(void**)(int)r;
  i11 = i11 != 0;
  if (i11) goto l9;
  i1 = (int)ch < 32;
  if (i1) goto l9;
  i11 = *(int*)((int)r-4);
  i5 = (int)((_Type)i11)->tbprocs[7];
  i6 = (int)ch;
  i7 = 0;
l6:
  i11 = i7 < 255;
  if (!(i11)) goto l7;
  i11 = (int)str + i7;
  *(unsigned char*)i11 = i6;
  i11 = i7 + 1;
  i7 = i11;
l7:
  ch = (unsigned char)i6;
  ch = (unsigned char)i6;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i5)((BinaryRider__Reader)(int)r, (unsigned char *)(int)&ch);
  i11 = (int)*(void**)(int)r;
  i11 = i11 != 0;
  if (i11) goto l8;
  i11 = (int)ch < 32;
  if (i11) goto l8;
  i6 = (int)ch;
  goto l6;
l8:
  i1 = (int)ch;
  goto l10;
l9:
  i7 = 0;
  i1 = (int)ch;
l10:
  i11 = i7 > 0;
  if (!(i11)) goto l12;
  i6 = i7 - 1;
  i5 = (int)str + i6;
  i6 = *(unsigned char*)i5;
  i11 = i6 > 32;
  if (i11) goto l12;
  i8 = i7;
l11:
  i8--;
  i6 = i8 <= 0;
  if (i6) goto l13;
  i5 = i8 - 1;
  i6 = (int)str + i5;
  i6 = *(unsigned char*)i6;
  i6 = i6 <= 32;
  if (i6) goto l11;
  goto l13;
l12:
  i8 = i7;
l13:
  {
    char *_mem, *_var;
    _mem = GC_malloc(_not_zero(24)+8);
    if (!_mem) _new_failed(_P(5467));
    _var = _mem+8;
    ((_Type*)_var)[-1] = &Error__ErrMsgDesc_td.td;
    i11 = (int)_var;
  }
  i5 = (int)Error__errDescrList;
  *(void**)i11 = (void*)i5;
  i5 = i11 + 4;
  i7 = i11 + 20;
  i6 = i11 + 12;
  *(short int*)i5 = i9;
  i9 = i8 + 1;
  *(int*)i6 = 0;
  {
    char *_mem, *_var;
    int* _dim_ptr;
    if(i9 < 0) _invalid_length(i9, _P(5601));
    _mem = GC_malloc_atomic(_not_zero(i9*1)+8);
    if (!_mem) _new_failed(_P(5585));
    _var = _mem+8;
    _dim_ptr = (void*)(_var-4);
    *(--_dim_ptr) = i9;
    i9 = (int)_var;
  }
  *(void**)i7 = (void*)i9;
  i5 = (int)*(void**)i7;
  i9 = (int)str + i8;
  *(unsigned char*)i9 = 0;
  i9 = *(int*)(i5-8);
  _string_copy(i5, (int)str, i9);
  Error__errDescrList = (void*)i11;
  i4 = (int)r;
  i3 = i2;
  goto l15;
l14:
  line = (short int)i2;
  line = (short int)i2;
  Error__ReadErrorList_Err(fileName, fileName_0d, &line);
  i1 = (int)ch;
  i3 = line;
l15:
  i0 = i4;
l16:
  i9 = *(int*)(i0-4);
  i8 = (int)((_Type)i9)->tbprocs[7];
  i9 = (int)*(void**)i0;
  i9 = i9 != 0;
  if (i9) goto l19;
  i9 = i1 == 10;
  if (i9) goto l19;
  i7 = i1;
l17:
  ch = (unsigned char)i7;
  ch = (unsigned char)i7;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i8)((BinaryRider__Reader)i0, (unsigned char *)(int)&ch);
  i7 = (int)*(void**)i0;
  i7 = i7 != 0;
  if (i7) goto l18;
  i7 = (int)ch == 10;
  if (i7) goto l18;
  i7 = (int)ch;
  goto l17;
l18:
  i1 = (int)ch;
l19:
  ch = (unsigned char)i1;
  ch = (unsigned char)i1;
  ((_TBP_BinaryRider__ReaderDesc_ReadChar)i8)((BinaryRider__Reader)i0, (unsigned char *)(int)&ch);
  i9 = (int)*(void**)i0;
  i9 = i9 != 0;
  i2 = i3 + 1;
  if (i9) goto l20;
  i1 = (int)ch;
  goto l0;
l20:
  i9 = *(int*)(i10-4);
  i9 = (int)((_Type)i9)->tbprocs[5];
  ((_TBP_Files__FileDesc_Close)i9)((Files__File)i10);
  goto l22;
l21:
  (void)memcpy((void*) (int)str, (const void*) (int)_c2, 40);
  Strings__Append((const unsigned char*)(int)expFileName, 256, (unsigned char*)(int)str, 256);
  Parameter__Warning((const unsigned char*)(int)str, 256);
l22:
  _top_vs = _old_top_vs;
}

void Error__GetErrMsg(short int num, unsigned char* str, int str_0d) {
  register int i0, i1, i2, i3;
  i0 = Error__errListRead;
  if (i0) goto l0;
  i0 = (int)Error__errorMsgs;
  i0 += 8;
  i1 = (int)*(void**)i0;
  i0 = *(int*)(i1-8);
  Error__errListRead = (unsigned char)0;
  Error__ReadErrorList((const unsigned char*)i1, i0);
l0:
  i2 = (int)Error__errDescrList;
  i0 = i2 == 0;
  if (i0) goto l2;
  i1 = i2 + 4;
  i1 = *(short int*)i1;
  i0 = num == i1;
  if (i0) goto l2;
  i3 = i2;
l1:
  i3 = (int)*(void**)i3;
  i1 = i3 == 0;
  if (i1) goto l3;
  i1 = i3 + 4;
  i1 = *(short int*)i1;
  i1 = num != i1;
  if (i1) goto l1;
  goto l3;
l2:
  i3 = i2;
l3:
  i0 = i3 != 0;
  if (i0) goto l4;
  _string_copy((int)str, (int)_c3, str_0d);
  goto l5;
l4:
  i3 += 20;
  i3 = (int)*(void**)i3;
  _string_copy((int)str, i3, str_0d);
l5:
  ;
}

void Error__Replace(unsigned char* string, int string_0d, unsigned char* insert, int insert_0d) {
  register int i0, i1, i2, i3, i4, i5, i6;
  i2 = *(unsigned char*)(int)string;
  i0 = i2 == 37;
  if (i0) goto l1;
  i3 = i2 == 0;
  if (i3) goto l1;
  i0 = 0;
l0:
  i0++;
  i1 = (int)string + i0;
  i2 = *(unsigned char*)i1;
  i1 = i2 == 37;
  if (i1) goto l2;
  i2 = i2 != 0;
  if (i2) goto l0;
  goto l2;
l1:
  i0 = 0;
l2:
  i1 = (int)string + i0;
  i2 = *(unsigned char*)i1;
  i1 = i2 != 0;
  if (i1) goto l3;
  i5 = i0;
  goto l5;
l3:
  i5 = i0;
l4:
  i5++;
  i1 = (int)string + i5;
  i1 = *(unsigned char*)i1;
  i1 = i1 != 0;
  if (i1) goto l4;
l5:
  i1 = i2 == 37;
  if (!(i1)) goto l12;
  i4 = *(unsigned char*)(int)insert;
  i4 = i4 != 0;
  if (i4) goto l6;
  i1 = 0;
  goto l8;
l6:
  i1 = 0;
l7:
  i1++;
  i4 = (int)insert + i1;
  i4 = *(unsigned char*)i4;
  i4 = i4 != 0;
  if (i4) goto l7;
l8:
  i4 = i5 > i0;
  if (!(i4)) goto l10;
l9:
  i4 = i5 + i1;
  i4--;
  i3 = (int)string + i5;
  i6 = i5 - 1;
  i2 = (int)string + i4;
  i3 = *(unsigned char*)i3;
  *(unsigned char*)i2 = i3;
  i4 = i0 >= i6;
  if (i4) goto l10;
  i5 = i6;
  goto l9;
l10:
  i5 = i1 > 0;
  if (!(i5)) goto l12;
  i2 = 0;
l11:
  i5 = i0 + i2;
  i4 = (int)insert + i2;
  i3 = i2 + 1;
  i6 = (int)string + i5;
  i4 = *(unsigned char*)i4;
  *(unsigned char*)i6 = i4;
  i5 = i1 <= i3;
  if (i5) goto l12;
  i2 = i3;
  goto l11;
l12:
  ;
}

Error__ErrMsg Error__StoreError_NewErrMsg(Error__ErrMsg next, short int *Error__StoreError_num, Parameter__String *Error__StoreError_source, int *Error__StoreError_pos, unsigned char* Error__StoreError_msg, int Error__StoreError_msg_0d) {
  register int i0, i1, i2, i3;
  {
    char *_mem, *_var;
    _mem = GC_malloc(_not_zero(24)+8);
    if (!_mem) _new_failed(_P(8068));
    _var = _mem+8;
    ((_Type*)_var)[-1] = &Error__ErrMsgDesc_td.td;
    i0 = (int)_var;
  }
  i3 = i0 + 4;
  *(void**)i0 = (void*)(int)next;
  i1 = i0 + 8;
  i2 = *Error__StoreError_num;
  *(short int*)i3 = i2;
  i3 = i0 + 12;
  i2 = (int)*Error__StoreError_source;
  *(void**)i1 = (void*)i2;
  i1 = *Error__StoreError_pos;
  *(int*)i3 = i1;
  i2 = i0 + 16;
  *(int*)i2 = i1;
  i2 = Strings__Length((const unsigned char*)(int)Error__StoreError_msg, Error__StoreError_msg_0d);
  i1 = i0 + 20;
  i2++;
  {
    char *_mem, *_var;
    int* _dim_ptr;
    if(i2 < 0) _invalid_length(i2, _P(8271));
    _mem = GC_malloc_atomic(_not_zero(i2*1)+8);
    if (!_mem) _new_failed(_P(8233));
    _var = _mem+8;
    _dim_ptr = (void*)(_var-4);
    *(--_dim_ptr) = i2;
    i2 = (int)_var;
  }
  *(void**)i1 = (void*)i2;
  i1 = (int)*(void**)i1;
  i2 = *(int*)(i1-8);
  _string_copy(i1, (int)Error__StoreError_msg, i2);
  return (void*)i0;
}

void Error__StoreError_Insert(Error__ErrMsg *list, Error__ErrMsg lastErr, short int *Error__StoreError_num, Parameter__String *Error__StoreError_source, int *Error__StoreError_pos, unsigned char* Error__StoreError_msg, int Error__StoreError_msg_0d) {
  register int i0, i1, i2, i3, i4, i5, i6, i7, i8;
  i7 = (int)*list;
  i0 = i7 == 0;
  if (i0) goto l8;
  i1 = (int)*Error__StoreError_source;
  i6 = i7 + 8;
  i6 = (int)*(void**)i6;
  i6 = strcmp((const char*) i6, (const char*) i1) != 0;
  if (i6) goto l7;
  i5 = *Error__StoreError_pos;
  i0 = i7 + 12;
  i8 = *(int*)i0;
  i0 = i8 > i5;
  if (i0) goto l6;
  i0 = (int)*(void**)i7;
  i4 = i0 == 0;
  if (i4) goto l1;
  i3 = i0 + 8;
  i3 = (int)*(void**)i3;
  i3 = strcmp((const char*) i3, (const char*) i1) != 0;
  if (i3) goto l1;
  i4 = i0 + 12;
  i4 = *(int*)i4;
  i4 = i4 > i5;
  if (i4) goto l1;
  i3 = i7 + 4;
  i3 = *(short int*)i3;
  i3 = i3 > 0;
  if (i3) goto l0;
  Error__StoreError_Insert((Error__ErrMsg *)i7, (Error__ErrMsg)(int)lastErr, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  goto l9;
l0:
  Error__StoreError_Insert((Error__ErrMsg *)i7, (Error__ErrMsg)i7, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  goto l9;
l1:
  i2 = i7 + 4;
  i8 = i8 != i5;
  i2 = *(short int*)i2;
  i6 = i2 > 0;
  if (i6) goto l2;
  i3 = (int)lastErr;
  goto l3;
l2:
  i3 = i7;
l3:
  if (i8) goto l4;
  i8 = *Error__StoreError_num;
  i2 = i2 != i8;
  if (i2) goto l4;
  i2 = i7 + 20;
  i2 = (int)*(void**)i2;
  i2 = strcmp((const char*) i2, (const char*) (int)Error__StoreError_msg) == 0;
  if (i2) goto l9;
l4:
  i8 = *Error__StoreError_num;
  i6 = i8 < 0;
  if (i6) goto l5;
  i2 = i3 == 0;
  if (i2) goto l5;
  i4 = i3 + 16;
  i6 = *(int*)i4;
  i2 = i6 + 12;
  i2 = i5 >= i2;
  if (i2) goto l5;
  i6 = i6 >= i5;
  if (i6) goto l9;
  *(int*)i4 = i5;
  goto l9;
l5:
  i8 = (int)Error__StoreError_NewErrMsg((Error__ErrMsg)i0, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  *(void**)i7 = (void*)i8;
  goto l9;
l6:
  i5 = (int)Error__StoreError_NewErrMsg((Error__ErrMsg)i7, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  *list = (void*)i5;
  goto l9;
l7:
  i6 = (int)*(void**)i7;
  Error__StoreError_Insert((Error__ErrMsg *)i7, (Error__ErrMsg)0, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  goto l9;
l8:
  i0 = (int)Error__StoreError_NewErrMsg((Error__ErrMsg)0, &*Error__StoreError_num, (Parameter__String *)&*Error__StoreError_source, &*Error__StoreError_pos, Error__StoreError_msg, Error__StoreError_msg_0d);
  *list = (void*)i0;
l9:
  ;
}

void Error__StoreError(Parameter__String source, int pos, short int num, const unsigned char* msg__ref, int msg_0d) {
  register int i0;
  unsigned char* msg;
  char* _old_top_vs = _top_vs;
  _push_value(int, msg, msg__ref, msg_0d);
  i0 = num > 0;
  if (i0) goto l0;
  i0 = (int)StdPragmas__warnings;
  i0 += 8;
  i0 = *(unsigned char*)i0;
  if (!(i0)) goto l1;
l0:
  i0 = (int)Error__errList;
  Error__StoreError_Insert((Error__ErrMsg *)(int)(int)&Error__errList, (Error__ErrMsg)0, &num, (Parameter__String *)&source, &pos, msg, msg_0d);
l1:
  _top_vs = _old_top_vs;
}

void Error__EmitErrors_WriteError(Parameter__String source, int pos, short int num, const unsigned char* msg__ref, int msg_0d, Parameter__String *Error__EmitErrors_lastSource) {
  register int i0, i1;
  unsigned char* msg;
  char* _old_top_vs = _top_vs;
  _push_value(int, msg, msg__ref, msg_0d);
  i1 = (int)*Error__EmitErrors_lastSource;
  i0 = i1 == 0;
  if (i0) goto l0;
  i1 = (int)source == i1;
  if (i1) goto l1;
l0:
  Out__String((const unsigned char*)(int)_c4, 9);
  i0 = *(int*)((int)source-8);
  Out__String((const unsigned char*)(int)source, i0);
  Out__String((const unsigned char*)(int)_c5, 3);
  Out__Ln();
  *Error__EmitErrors_lastSource = (void*)(int)source;
l1:
  i0 = (int)source != 0;
  if (!(i0)) goto l2;
  Out__LongInt((int)pos, (int)0);
  Out__String((const unsigned char*)(int)_c6, 2);
l2:
  i0 = _abs(num);
  Out__Int((short int)i0, (int)3);
  Out__Char((unsigned char)32);
  Out__String((const unsigned char*)(int)msg, msg_0d);
  Out__Ln();
  _top_vs = _old_top_vs;
}

void Error__EmitErrors(unsigned char includeWarnings) {
  register int i0, i1, i2, i3, i4, i5, i6;
  Parameter__String lastSource;
  i5 = (int)Error__errList;
  i0 = i5 == 0;
  if (i0) goto l3;
  i4 = 0;
l0:
  if (includeWarnings) goto l1;
  i0 = i5 + 4;
  i0 = *(short int*)i0;
  i0 = i0 <= 0;
  if (i0) goto l2;
l1:
  i6 = i5 + 20;
  i6 = (int)*(void**)i6;
  i1 = i5 + 8;
  i0 = i5 + 12;
  i3 = i5 + 4;
  i2 = *(int*)(i6-8);
  i1 = (int)*(void**)i1;
  i0 = *(int*)i0;
  i3 = *(short int*)i3;
  lastSource = (void*)i4;
  lastSource = (void*)i4;
  Error__EmitErrors_WriteError((Parameter__String)i1, (int)i0, (short int)i3, (const unsigned char*)i6, i2, (Parameter__String *)&lastSource);
  i4 = (int)lastSource;
l2:
  i5 = (int)*(void**)i5;
  i0 = i5 != 0;
  if (i0) goto l0;
l3:
  Error__errList = (void*)0;
}

void Error__ErrIns2(int pos, short int num, const unsigned char* ins1__ref, int ins1_0d, const unsigned char* ins2__ref, int ins2_0d) {
  register int i0, i1;
  unsigned char str[256];
  unsigned char* ins1;
  unsigned char* ins2;
  char* _old_top_vs = _top_vs;
  _push_value(int, ins1, ins1__ref, ins1_0d);
  _push_value(int, ins2, ins2__ref, ins2_0d);
  i0 = pos < 0;
  if (i0) goto l6;
  i0 = num <= 0;
  if (i0) goto l0;
  i0 = Error__errCount;
  i0++;
  Error__errCount = i0;
l0:
  i1 = strcmp((const char*) (int)ins1, (const char*) (int)_c7) == 0;
  i0 = _abs(num);
  Error__GetErrMsg((short int)i0, (unsigned char*)(int)str, 256);
  if (i1) goto l1;
  Error__Replace((unsigned char*)(int)str, 256, (unsigned char*)(int)ins1, ins1_0d);
l1:
  i1 = Error__noerr;
  i0 = strcmp((const char*) (int)ins2, (const char*) (int)_c7) == 0;
  if (!(i1)) goto l2;
  i1 = num < 0;
  if (i1) goto l3;
l2:
  i1 = 0;
  goto l4;
l3:
  i1 = 1;
l4:
  if (i0) goto l5;
  Error__Replace((unsigned char*)(int)str, 256, (unsigned char*)(int)ins2, ins2_0d);
l5:
  i0 = (int)Error__sourceFile;
  Error__noerr = i1;
  Error__StoreError((Parameter__String)i0, (int)pos, (short int)num, (const unsigned char*)(int)str, 256);
l6:
  _top_vs = _old_top_vs;
}

void Error__ErrIns(int pos, short int num, const unsigned char* ins__ref, int ins_0d) {
  unsigned char* ins;
  char* _old_top_vs = _top_vs;
  _push_value(int, ins, ins__ref, ins_0d);
  Error__ErrIns2((int)pos, (short int)num, (const unsigned char*)(int)ins, ins_0d, (const unsigned char*)(int)_c7, 1);
  _top_vs = _old_top_vs;
}

void Error__Err(int pos, short int num) {
  Error__ErrIns2((int)pos, (short int)num, (const unsigned char*)(int)_c7, 1, (const unsigned char*)(int)_c7, 1);
}

void Error__ErrOoR(int pos, short int num, int min, int maxPlusOne) {
  register int i0;
  unsigned char range[64];
  unsigned char upper[64];
  IntStr__IntToStr((int)min, (unsigned char*)(int)range, 64);
  Strings__Append((const unsigned char*)(int)_c8, 9, (unsigned char*)(int)range, 64);
  i0 = maxPlusOne <= 0;
  if (i0) goto l0;
  IntStr__IntToStr((int)maxPlusOne, (unsigned char*)(int)upper, 64);
  Strings__Append((const unsigned char*)(int)upper, 64, (unsigned char*)(int)range, 64);
  goto l1;
l0:
  Strings__Append((const unsigned char*)(int)_c9, 2, (unsigned char*)(int)range, 64);
l1:
  Error__ErrIns((int)pos, (short int)num, (const unsigned char*)(int)range, 64);
}

void Error__FileError(const unsigned char* msg__ref, int msg_0d, const unsigned char* fileName__ref, int fileName_0d, const unsigned char* error__ref, int error_0d) {
  unsigned char found;
  short int pos;
  unsigned char str[1024];
  unsigned char* msg;
  unsigned char* fileName;
  unsigned char* error;
  char* _old_top_vs = _top_vs;
  _push_value(int, msg, msg__ref, msg_0d);
  _push_value(int, fileName, fileName__ref, fileName_0d);
  _push_value(int, error, error__ref, error_0d);
  _string_copy((int)str, (int)msg, 1024);
  Strings__FindNext((const unsigned char*)(int)_c10, 2, (const unsigned char*)(int)str, 1024, (short int)0, (unsigned char *)(int)&found, (short int *)(int)&pos);
  if (!(found)) goto l0;
  Strings__Delete((unsigned char*)(int)str, 1024, (short int)pos, (short int)1);
  Strings__Insert((const unsigned char*)(int)fileName, fileName_0d, (short int)pos, (unsigned char*)(int)str, 1024);
l0:
  Out__String((const unsigned char*)(int)_c11, 8);
  Out__String((const unsigned char*)(int)str, 1024);
  Out__Ln();
  Out__String((const unsigned char*)(int)_c12, 8);
  Out__String((const unsigned char*)(int)error, error_0d);
  Out__Ln();
  _halt(1);
  _top_vs = _old_top_vs;
}

void Error__VerboseMsg(const unsigned char* msg__ref, int msg_0d) {
  register int i0;
  unsigned char* msg;
  char* _old_top_vs = _top_vs;
  _push_value(int, msg, msg__ref, msg_0d);
  i0 = (int)Error__verbose;
  i0 += 8;
  i0 = *(unsigned char*)i0;
  if (!(i0)) goto l0;
  Out__String((const unsigned char*)(int)msg, msg_0d);
  Out__Ln();
  Out__Flush();
l0:
  _top_vs = _old_top_vs;
}

void Error__Init(void) {
  Error__noerr = 1;
  Error__errCount = 0;
}

void Error_init(void) {
  register int i0, i1, i2;
  _mid = _register_module(&Error_md.md, &Error__ErrMsgDesc_td.td);
  Error__errList = (void*)0;
  Error__errDescrList = (void*)0;
  Error__errListRead = 0;
  Error__sourceFile = (void*)0;
  i0 = (int)ParamOptions__CreateBoolean((const unsigned char*)(int)_c13, 8, (unsigned char)0);
  Error__verbose = (void*)i0;
  i2 = (int)ParamOptions__options;
  i0 = (int)Error__verbose;
  i1 = *(int*)(i2-4);
  i1 = (int)((_Type)i1)->tbprocs[4];
  ((_TBP_ParamOptions__OptionsSectionDesc_Add)i1)((ParamOptions__OptionsSection)i2, (ParamOptions__Option)i0);
  i0 = (int)ParamOptions__options;
  i1 = *(int*)(i0-4);
  i1 = (int)((_Type)i1)->tbprocs[2];
  ((_TBP_Parameter__SectionDesc_CmdLineOption)i1)((Parameter__Section)i0, (const unsigned char*)(int)_c14, 13, (const unsigned char*)(int)_c15, 14);
  i0 = (int)ParamPragmas__pragmas;
  i1 = *(int*)(i0-4);
  i1 = (int)((_Type)i1)->tbprocs[2];
  ((_TBP_Parameter__SectionDesc_CmdLineOption)i1)((Parameter__Section)i0, (const unsigned char*)(int)_c16, 14, (const unsigned char*)(int)_c17, 15);
  i0 = (int)ParamOptions__CreateString((const unsigned char*)(int)_c18, 14, (const unsigned char*)(int)_c19, 32);
  Error__errorMsgs = (void*)i0;
  i0 = (int)ParamOptions__options;
  i2 = (int)Error__errorMsgs;
  i1 = *(int*)(i0-4);
  i1 = (int)((_Type)i1)->tbprocs[4];
  ((_TBP_ParamOptions__OptionsSectionDesc_Add)i1)((ParamOptions__OptionsSection)i0, (ParamOptions__Option)i2);
}