mathtex-portable-engine-generated 0.1.2

Machine generated portable TeX engine core for mathtex, translated from the TeX, eTeX and XeTeX sources
Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
//! shared TeX core candidates auto-patched from TeX source when compatible (group `p`).
//! Generated by `cargo run -p mathtex-web2c-import --bin patch_engine`.

#![allow(dead_code, non_camel_case_types, non_snake_case, unused_assignments, unused_must_use, unused_mut, unused_variables)]

use crate::runtime::*;

impl<'resources> PortableTexEngine<'resources> {

    pub(crate) unsafe fn passtext(&mut self) -> EngineFlow<()> {
        let eqtb = self.state.zeqtb.as_mut_ptr();
        let mut l_0: integer = 0;
        let mut savescannerstatus: smallnumber = 0;
        savescannerstatus = self.state.scannerstatus as smallnumber;
        self.state.scannerstatus = 1 as eightbits;
        l_0 = 0 as i32 as integer;
        self.state.skipline = self.state.line;
        loop {
            (&mut *(self as *mut PortableTexEngine<'_>)).getnext()?;
            if self.state.curcmd as i32 == 109 as i32 {
                if l_0 == 0 as i32 {
                    break;
                }
                if self.state.curchr == 2 as i32 {
                    l_0 -= 1;
                }
            } else if self.state.curcmd as i32 == 108 as i32 {
                l_0 += 1;
            }
        }
        self.state.scannerstatus = savescannerstatus as eightbits;
        Ok(
            if (*eqtb.offset(7892327 as i64 as isize)).u.CINT > 0 as i32 {
                (&mut *(self as *mut PortableTexEngine<'_>)).showcurcmdchr();
            },
        )
    }
    pub(crate) unsafe fn pauseforinstructions(&mut self) -> EngineFlow<()> {
        Ok(
            if self.state.OKtointerrupt != 0 {
                self.state.interaction = 3 as eightbits;
                if self.state.selector as i32 == 18 as i32
                    || self.state.selector as i32 == 16 as i32
                {
                    self.state.selector = self.state.selector.wrapping_add(1);
                }
                self.state.interaction as i32 == 3 as i32;
                if self.state.filelineerrorstylep != 0 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65544 as i64 as strnumber);
                }
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprint(65576 as i64 as integer);
                self.state.helpptr = 3 as eightbits;
                self.state.helpline[2 as i32 as usize] = 65577 as i64 as strnumber;
                self.state.helpline[1 as i32 as usize] = 65578 as i64 as strnumber;
                self.state.helpline[0 as i32 as usize] = 65579 as i64 as strnumber;
                self.state.deletionsallowed = false_0 as boolean;
                (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
                self.state.deletionsallowed = true_0 as boolean;
                self.state.interrupt = 0 as i32 as integer;
            },
        )
    }
    pub(crate) unsafe fn popalignment(&mut self) {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let mut p: halfword = 0;
        (*mem.offset(self.state.curhead as isize)).hh.v.RH = self.state.avail;
        self.state.avail = self.state.curhead;
        self.state.dynused -= 1;
        (*mem.offset(self.state.curprehead as isize)).hh.v.RH = self.state.avail;
        self.state.avail = self.state.curprehead;
        self.state.dynused -= 1;
        p = self.state.alignptr;
        self.state.curtail = (*mem.offset((p as i32 + 4 as i32) as isize)).hh.v.RH;
        self.state.curhead = (*mem.offset((p as i32 + 4 as i32) as isize)).hh.v.LH;
        self.state.curpretail = (*mem.offset((p as i32 + 5 as i32) as isize)).hh.v.RH;
        self.state.curprehead = (*mem.offset((p as i32 + 5 as i32) as isize)).hh.v.LH;
        self.state.alignstate = (*mem.offset((p as i32 + 3 as i32) as isize)).u.CINT;
        self.state.curloop = (*mem.offset((p as i32 + 2 as i32) as isize)).u.CINT
            as halfword;
        self.state.curspan = (*mem.offset((p as i32 + 1 as i32) as isize)).hh.v.RH;
        (*mem.offset((self.state.memtop as i32 - 8 as i32) as isize)).hh.v.RH = (*mem
            .offset((p as i32 + 1 as i32) as isize))
            .hh
            .v
            .LH;
        self.state.curalign = (*mem.offset(p as isize)).hh.v.LH;
        self.state.alignptr = (*mem.offset(p as isize)).hh.v.RH;
        (&mut *(self as *mut PortableTexEngine<'_>)).zfreenode(p, 6 as i32);
    }
    pub(crate) unsafe fn popnest(&mut self) {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        (*mem.offset(self.state.curlist.headfield as isize)).hh.v.RH = self.state.avail;
        self.state.avail = self.state.curlist.headfield;
        self.state.dynused -= 1;
        self.state.nestptr -= 1;
        self.state.curlist = *self.state.nest.offset(self.state.nestptr as isize);
    }
    pub(crate) unsafe fn popnode(&mut self) -> EngineFlow<halfword> {
        let mut Result: halfword = 0;
        self.state.hliststacklevel = (self.state.hliststacklevel as i32 - 1 as i32)
            as i16;
        if (self.state.hliststacklevel as i32) < 0 as i32 {
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zpdferror(66353 as i64 as strnumber, 66354 as i64 as strnumber)?;
        }
        Result = self.state.hliststack[self.state.hliststacklevel as usize];
        return Ok(Result);
    }
    pub(crate) unsafe fn prefixedcommand(&mut self) -> EngineFlow<()> {
        let mut current_block: u64;
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let eqtb = self.state.zeqtb.as_mut_ptr();
        let mut a: smallnumber = 0;
        let mut f: internalfontnumber = 0;
        let mut j: halfword = 0;
        let mut k: fontindex = 0;
        let mut p: halfword = 0;
        let mut q: halfword = 0;
        let mut n: integer = 0;
        let mut e: boolean = 0;
        a = 0 as smallnumber;
        while self.state.curcmd as i32 == 95 as i32 {
            if a as i32 / self.state.curchr as i32 & 1 as i32 == 0 {
                a = (a as halfword + self.state.curchr) as smallnumber;
            }
            loop {
                (&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
                if self.state.curcmd as i32 != 10 as i32
                    && self.state.curcmd as i32 != 0 as i32
                {
                    break;
                }
            }
            if self.state.curcmd as i32 <= 71 as i32 {
                self.state.interaction as i32 == 3 as i32;
                if self.state.filelineerrorstylep != 0 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintnl(65544 as i64 as strnumber);
                }
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprint(66617 as i64 as integer);
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprintcmdchr(self.state.curcmd as quarterword, self.state.curchr);
                (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(39 as i32);
                self.state.helpptr = 1 as eightbits;
                self.state.helpline[0 as i32 as usize] = 66618 as i64 as strnumber;
                if self.state.eTeXmode as i32 == 1 as i32 {
                    self.state.helpline[0 as i32 as usize] = 66619 as i64 as strnumber;
                }
                (&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
                return Ok(());
            }
            if (*eqtb.offset(7892300 as i64 as isize)).u.CINT > 2 as i32 {
                if self.state.eTeXmode as i32 == 1 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).showcurcmdchr();
                }
            }
        }
        if a as i32 >= 8 as i32 {
            j = 29360129 as i64 as halfword;
            a = (a as i32 - 8 as i32) as smallnumber;
        } else {
            j = 0 as i32 as halfword;
        }
        if self.state.curcmd as i32 != 99 as i32
            && (a as i32 % 4 as i32 != 0 as i32 || j != 0 as i32)
        {
            self.state.interaction as i32 == 3 as i32;
            if self.state.filelineerrorstylep != 0 {
                (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
            } else {
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprintnl(65544 as i64 as strnumber);
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66034 as i64 as integer);
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zprintesc(66609 as i64 as strnumber);
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66620 as i64 as integer);
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zprintesc(66610 as i64 as strnumber);
            self.state.helpptr = 1 as eightbits;
            self.state.helpline[0 as i32 as usize] = 66621 as i64 as strnumber;
            if self.state.eTeXmode as i32 == 1 as i32 {
                self.state.helpline[0 as i32 as usize] = 66622 as i64 as strnumber;
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprint(66620 as i64 as integer);
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprintesc(66623 as i64 as strnumber);
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66624 as i64 as integer);
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zprintcmdchr(self.state.curcmd as quarterword, self.state.curchr);
            (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(39 as i32);
            (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
        }
        if (*eqtb.offset(7892307 as i64 as isize)).u.CINT != 0 as i32 {
            if (*eqtb.offset(7892307 as i64 as isize)).u.CINT < 0 as i32 {
                if a as i32 >= 4 as i32 {
                    a = (a as i32 - 4 as i32) as smallnumber;
                }
            } else if !(a as i32 >= 4 as i32) {
                a = (a as i32 + 4 as i32) as smallnumber;
            }
        }
        match self.state.curcmd as i32 {
            89 => {
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(
                            1206823 as i64 as halfword,
                            123 as i32 as quarterword,
                            self.state.curchr,
                        )?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(
                            1206823 as i64 as halfword,
                            123 as i32 as quarterword,
                            self.state.curchr,
                        )?;
                }
            }
            99 => {
                if self.state.curchr as i32 & 1 as i32 != 0 && !(a as i32 >= 4 as i32)
                    && (*eqtb.offset(7892307 as i64 as isize)).u.CINT >= 0 as i32
                {
                    a = (a as i32 + 4 as i32) as smallnumber;
                }
                e = (self.state.curchr >= 2 as i32) as i32 as boolean;
                (&mut *(self as *mut PortableTexEngine<'_>)).getrtoken()?;
                p = self.state.curcs;
                q = (&mut *(self as *mut PortableTexEngine<'_>)).zscantoks(1 as i32, e)?;
                if j != 0 as i32 {
                    q = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
                    (*mem.offset(q as isize)).hh.v.LH = j;
                    (*mem.offset(q as isize)).hh.v.RH = (*mem
                        .offset(self.state.defref as isize))
                        .hh
                        .v
                        .RH;
                    (*mem.offset(self.state.defref as isize)).hh.v.RH = q;
                }
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(
                            p,
                            (114 as i32 + a as i32 % 4 as i32) as quarterword,
                            self.state.defref,
                        )?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(
                            p,
                            (114 as i32 + a as i32 % 4 as i32) as quarterword,
                            self.state.defref,
                        )?;
                }
            }
            96 => {
                n = self.state.curchr as integer;
                (&mut *(self as *mut PortableTexEngine<'_>)).getrtoken()?;
                p = self.state.curcs;
                if n == 0 as i32 {
                    loop {
                        (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                        if self.state.curcmd as i32 != 10 as i32 {
                            break;
                        }
                    }
                    if self.state.curtok as i64 == 25165885 as i64 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                        if self.state.curcmd as i32 == 10 as i32 {
                            (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                        }
                    }
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                    q = self.state.curtok;
                    let src_tok_a_saved = Self::src_capture_tok_span(
                        self as *mut PortableTexEngine<'_>,
                    );
                    (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
                    self.state.curtok = q;
                    Self::src_restore_tok_span(
                        self as *mut PortableTexEngine<'_>,
                        src_tok_a_saved,
                    );
                    (&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
                }
                if self.state.curcmd as i32 >= 114 as i32 {
                    let ref mut fresh67 = (*mem.offset(self.state.curchr as isize))
                        .hh
                        .v
                        .LH;
                    *fresh67 += 1;
                } else if self.state.curcmd as i32 == 91 as i32
                    || self.state.curcmd as i32 == 72 as i32
                {
                    if self.state.curchr < self.state.membot
                        || self.state.curchr > self.state.membot as i32 + 19 as i32
                    {
                        let ref mut fresh68 = (*mem
                            .offset((self.state.curchr as i32 + 1 as i32) as isize))
                            .hh
                            .v
                            .LH;
                        *fresh68 += 1;
                    }
                }
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(
                            p,
                            self.state.curcmd as quarterword,
                            self.state.curchr,
                        )?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(
                            p,
                            self.state.curcmd as quarterword,
                            self.state.curchr,
                        )?;
                }
            }
            97 => {
                if self.state.curchr == 7 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).scancharnum()?;
                    p = (6778152 as i64 + self.state.curval as i64) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scancharnum()?;
                    n = self.state.curval;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scancharnum()?;
                    if (*eqtb.offset(7892321 as i64 as isize)).u.CINT > 0 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprintnl(66646 as i64 as strnumber);
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint((p as i64 - 6778152 as i64) as integer);
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint(66647 as i64 as integer);
                        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(n);
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprintchar(32 as i32);
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint(self.state.curval);
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zenddiagnostic(0 as i32);
                    }
                    n = n * 256 as integer + self.state.curval;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(p, 123 as i32 as quarterword, n)?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(p, 123 as i32 as quarterword, n)?;
                    }
                    if (p as i64 - 6778152 as i64)
                        < (*eqtb.offset(7892319 as i64 as isize)).u.CINT as i64
                    {
                        if a as i32 >= 4 as i32 {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zgeqworddefine(
                                    7892319 as i64 as halfword,
                                    (p as i64 - 6778152 as i64) as integer,
                                );
                        } else {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zeqworddefine(
                                    7892319 as i64 as halfword,
                                    (p as i64 - 6778152 as i64) as integer,
                                )?;
                        }
                    }
                    if p as i64 - 6778152 as i64
                        > (*eqtb.offset(7892320 as i64 as isize)).u.CINT as i64
                    {
                        if a as i32 >= 4 as i32 {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zgeqworddefine(
                                    7892320 as i64 as halfword,
                                    (p as i64 - 6778152 as i64) as integer,
                                );
                        } else {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zeqworddefine(
                                    7892320 as i64 as halfword,
                                    (p as i64 - 6778152 as i64) as integer,
                                )?;
                        }
                    }
                } else {
                    n = self.state.curchr as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).getrtoken()?;
                    p = self.state.curcs;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(
                                p,
                                0 as i32 as quarterword,
                                1114112 as i64 as halfword,
                            )?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(
                                p,
                                0 as i32 as quarterword,
                                1114112 as i64 as halfword,
                            )?;
                    }
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    match n {
                        0 => {
                            (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                            if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        68 as i32 as quarterword,
                                        self.state.curval,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(p, 68 as i32 as quarterword, self.state.curval)?;
                            }
                        }
                        1 => {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scanfifteenbitint()?;
                            if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        69 as i32 as quarterword,
                                        self.state.curval,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(p, 69 as i32 as quarterword, self.state.curval)?;
                            }
                        }
                        8 => {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scanxetexmathcharint()?;
                            if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        70 as i32 as quarterword,
                                        self.state.curval,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(p, 70 as i32 as quarterword, self.state.curval)?;
                            }
                        }
                        9 => {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scanmathclassint()?;
                            n = ((self.state.curval as u32 & 0x7 as u32) << 21 as i32)
                                as integer;
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scanmathfamint()?;
                            n = (n as u32)
                                .wrapping_add(
                                    (self.state.curval as u32 & 0xff as u32) << 24 as i32,
                                ) as integer;
                            (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                            n = n + self.state.curval;
                            if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(p, 70 as i32 as quarterword, n)?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(p, 70 as i32 as quarterword, n)?;
                            }
                        }
                        _ => {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scanregisternum()?;
                            if self.state.curval > 255 as i32 {
                                j = (n as i32 - 2 as i32) as halfword;
                                if j > 3 as i32 {
                                    j = 5 as i32 as halfword;
                                }
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zfindsaelement(
                                        j as smallnumber,
                                        self.state.curval,
                                        1 as i32,
                                    )?;
                                let ref mut fresh69 = (*mem
                                    .offset((self.state.curptr as i32 + 1 as i32) as isize))
                                    .hh
                                    .v
                                    .LH;
                                *fresh69 += 1;
                                if j == 5 as i32 {
                                    j = 72 as i32 as halfword;
                                } else {
                                    j = 91 as i32 as halfword;
                                }
                                if a as i32 >= 4 as i32 {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zgeqdefine(p, j as quarterword, self.state.curptr)?;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zeqdefine(p, j as quarterword, self.state.curptr)?;
                                }
                            } else {
                                match n {
                                    2 => {
                                        if a as i32 >= 4 as i32 {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zgeqdefine(
                                                    p,
                                                    74 as i32 as quarterword,
                                                    (7892351 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        } else {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zeqdefine(
                                                    p,
                                                    74 as i32 as quarterword,
                                                    (7892351 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        }
                                    }
                                    3 => {
                                        if a as i32 >= 4 as i32 {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zgeqdefine(
                                                    p,
                                                    75 as i32 as quarterword,
                                                    (9006742 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        } else {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zeqdefine(
                                                    p,
                                                    75 as i32 as quarterword,
                                                    (9006742 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        }
                                    }
                                    4 => {
                                        if a as i32 >= 4 as i32 {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zgeqdefine(
                                                    p,
                                                    76 as i32 as quarterword,
                                                    (1205783 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        } else {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zeqdefine(
                                                    p,
                                                    76 as i32 as quarterword,
                                                    (1205783 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        }
                                    }
                                    5 => {
                                        if a as i32 >= 4 as i32 {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zgeqdefine(
                                                    p,
                                                    77 as i32 as quarterword,
                                                    (1206039 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        } else {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zeqdefine(
                                                    p,
                                                    77 as i32 as quarterword,
                                                    (1206039 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        }
                                    }
                                    6 => {
                                        if a as i32 >= 4 as i32 {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zgeqdefine(
                                                    p,
                                                    73 as i32 as quarterword,
                                                    (1206307 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        } else {
                                            (&mut *(self as *mut PortableTexEngine<'_>))
                                                .zeqdefine(
                                                    p,
                                                    73 as i32 as quarterword,
                                                    (1206307 as i64 + self.state.curval as i64) as halfword,
                                                )?;
                                        }
                                    }
                                    _ => {}
                                }
                            }
                        }
                    }
                }
            }
            98 => {
                j = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                n = self.state.curval;
                if (&mut *(self as *mut PortableTexEngine<'_>))
                    .zscankeyword(66251 as i64 as strnumber)? == 0
                {
                    self.state.interaction as i32 == 3 as i32;
                    if self.state.filelineerrorstylep != 0 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprintnl(65544 as i64 as strnumber);
                    }
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprint(66507 as i64 as integer);
                    self.state.helpptr = 2 as eightbits;
                    self.state.helpline[1 as i32 as usize] = 66648 as i64 as strnumber;
                    self.state.helpline[0 as i32 as usize] = 66649 as i64 as strnumber;
                    (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
                }
                (&mut *(self as *mut PortableTexEngine<'_>)).getrtoken()?;
                p = self.state.curcs;
                (&mut *(self as *mut PortableTexEngine<'_>)).zreadtoks(n, p, j)?;
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(p, 114 as i32 as quarterword, self.state.curval)?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(p, 114 as i32 as quarterword, self.state.curval)?;
                }
            }
            72 | 73 => {
                q = self.state.curcs;
                e = false_0 as boolean;
                if self.state.curcmd as i32 == 72 as i32 {
                    if self.state.curchr == self.state.membot {
                        (&mut *(self as *mut PortableTexEngine<'_>)).scanregisternum()?;
                        if self.state.curval > 255 as i32 {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zfindsaelement(
                                    5 as i32 as smallnumber,
                                    self.state.curval,
                                    1 as i32,
                                )?;
                            self.state.curchr = self.state.curptr;
                            e = true_0 as boolean;
                        } else {
                            self.state.curchr = (1206307 as i64
                                + self.state.curval as i64) as halfword;
                        }
                    } else {
                        e = true_0 as boolean;
                    }
                } else if self.state.curchr as i64 == 1206306 as i64 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .scancharclassnotignored()?;
                    self.state.curptr = self.state.curval as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .scancharclassnotignored()?;
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zfindsaelement(
                            6 as i32 as smallnumber,
                            self.state.curptr as integer * 4096 as integer
                                + self.state.curval,
                            1 as i32,
                        )?;
                    self.state.curchr = self.state.curptr;
                    e = true_0 as boolean;
                }
                p = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                loop {
                    (&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
                    if self.state.curcmd as i32 != 10 as i32
                        && self.state.curcmd as i32 != 0 as i32
                    {
                        break;
                    }
                }
                if self.state.curcmd as i32 != 1 as i32 {
                    if self.state.curcmd as i32 == 72 as i32
                        || self.state.curcmd as i32 == 73 as i32
                    {
                        if self.state.curcmd as i32 == 72 as i32 {
                            if self.state.curchr == self.state.membot {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .scanregisternum()?;
                                if self.state.curval < 256 as i32 {
                                    q = (*eqtb
                                        .offset(
                                            (1206307 as i64 + self.state.curval as i64) as isize,
                                        ))
                                        .hh
                                        .v
                                        .RH;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zfindsaelement(
                                            5 as i32 as smallnumber,
                                            self.state.curval,
                                            0 as i32,
                                        )?;
                                    if self.state.curptr as i64 == -(268435455 as i64) {
                                        q = -(268435455 as i64) as halfword;
                                    } else {
                                        q = (*mem
                                            .offset((self.state.curptr as i32 + 1 as i32) as isize))
                                            .hh
                                            .v
                                            .RH;
                                    }
                                }
                            } else {
                                q = (*mem
                                    .offset((self.state.curchr as i32 + 1 as i32) as isize))
                                    .hh
                                    .v
                                    .RH;
                            }
                        } else if self.state.curchr as i64 == 1206306 as i64 {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scancharclassnotignored()?;
                            self.state.curptr = self.state.curval as halfword;
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .scancharclassnotignored()?;
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zfindsaelement(
                                    6 as i32 as smallnumber,
                                    self.state.curptr as integer * 4096 as integer
                                        + self.state.curval,
                                    0 as i32,
                                )?;
                            if self.state.curptr as i64 == -(268435455 as i64) {
                                q = -(268435455 as i64) as halfword;
                            } else {
                                q = (*mem
                                    .offset((self.state.curptr as i32 + 1 as i32) as isize))
                                    .hh
                                    .v
                                    .RH;
                            }
                        } else {
                            q = (*eqtb.offset(self.state.curchr as isize)).hh.v.RH;
                        }
                        if q as i64 == -(268435455 as i64) {
                            if e != 0 {
                                if a as i32 >= 4 as i32 {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zgsadef(p, -(268435455 as i64) as halfword)?;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zsadef(p, -(268435455 as i64) as halfword)?;
                                }
                            } else if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        104 as i32 as quarterword,
                                        -(268435455 as i64) as halfword,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(
                                        p,
                                        104 as i32 as quarterword,
                                        -(268435455 as i64) as halfword,
                                    )?;
                            }
                        } else {
                            let ref mut fresh70 = (*mem.offset(q as isize)).hh.v.LH;
                            *fresh70 += 1;
                            if e != 0 {
                                if a as i32 >= 4 as i32 {
                                    (&mut *(self as *mut PortableTexEngine<'_>)).zgsadef(p, q)?;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>)).zsadef(p, q)?;
                                }
                            } else if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(p, 114 as i32 as quarterword, q)?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(p, 114 as i32 as quarterword, q)?;
                            }
                        }
                        current_block = 15433318699804557406;
                    } else {
                        current_block = 11573789974424595537;
                    }
                } else {
                    current_block = 11573789974424595537;
                }
                match current_block {
                    15433318699804557406 => {}
                    _ => {
                        (&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
                        self.state.curcs = q;
                        q = (&mut *(self as *mut PortableTexEngine<'_>))
                            .zscantoks(0 as i32, 0 as i32)?;
                        if (*mem.offset(self.state.defref as isize)).hh.v.RH as i64
                            == -(268435455 as i64)
                        {
                            if e != 0 {
                                if a as i32 >= 4 as i32 {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zgsadef(p, -(268435455 as i64) as halfword)?;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zsadef(p, -(268435455 as i64) as halfword)?;
                                }
                            } else if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        104 as i32 as quarterword,
                                        -(268435455 as i64) as halfword,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(
                                        p,
                                        104 as i32 as quarterword,
                                        -(268435455 as i64) as halfword,
                                    )?;
                            }
                            (*mem.offset(self.state.defref as isize)).hh.v.RH = self
                                .state
                                .avail;
                            self.state.avail = self.state.defref;
                            self.state.dynused -= 1;
                        } else {
                            if p as i64 == 1206296 as i64 && e == 0 {
                                (*mem.offset(q as isize)).hh.v.RH = (&mut *(self
                                    as *mut PortableTexEngine<'_>))
                                    .getavail()?;
                                q = (*mem.offset(q as isize)).hh.v.RH;
                                (*mem.offset(q as isize)).hh.v.LH = 4194429 as i64
                                    as halfword;
                                q = (&mut *(self as *mut PortableTexEngine<'_>))
                                    .getavail()?;
                                (*mem.offset(q as isize)).hh.v.LH = 2097275 as i64
                                    as halfword;
                                (*mem.offset(q as isize)).hh.v.RH = (*mem
                                    .offset(self.state.defref as isize))
                                    .hh
                                    .v
                                    .RH;
                                (*mem.offset(self.state.defref as isize)).hh.v.RH = q;
                            }
                            if e != 0 {
                                if a as i32 >= 4 as i32 {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zgsadef(p, self.state.defref)?;
                                } else {
                                    (&mut *(self as *mut PortableTexEngine<'_>))
                                        .zsadef(p, self.state.defref)?;
                                }
                            } else if a as i32 >= 4 as i32 {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zgeqdefine(
                                        p,
                                        114 as i32 as quarterword,
                                        self.state.defref,
                                    )?;
                            } else {
                                (&mut *(self as *mut PortableTexEngine<'_>))
                                    .zeqdefine(
                                        p,
                                        114 as i32 as quarterword,
                                        self.state.defref,
                                    )?;
                            }
                        }
                    }
                }
            }
            74 => {
                p = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqworddefine(p, self.state.curval);
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqworddefine(p, self.state.curval)?;
                }
            }
            75 => {
                p = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zscandimen(0 as i32, 0 as i32, 0 as i32)?;
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqworddefine(p, self.state.curval);
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqworddefine(p, self.state.curval)?;
                }
            }
            76 | 77 => {
                p = self.state.curchr;
                n = self.state.curcmd as integer;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                if n == 77 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zscanglue(3 as i32 as smallnumber)?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zscanglue(2 as i32 as smallnumber)?;
                }
                (&mut *(self as *mut PortableTexEngine<'_>)).trapzeroglue();
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(p, 120 as i32 as quarterword, self.state.curval)?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(p, 120 as i32 as quarterword, self.state.curval)?;
                }
            }
            87 => {
                if self.state.curchr as i64 == 4549928 as i64 {
                    p = self.state.curchr;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    p = (p as integer + self.state.curval) as halfword;
                    n = ((*eqtb
                        .offset((4549928 as i64 + self.state.curval as i64) as isize))
                        .hh
                        .v
                        .RH as i64 % 65536 as i64) as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scancharclass()?;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(
                                p,
                                123 as i32 as quarterword,
                                (self.state.curval as i64 * 65536 as i64 + n as i64)
                                    as halfword,
                            )?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(
                                p,
                                123 as i32 as quarterword,
                                (self.state.curval as i64 * 65536 as i64 + n as i64)
                                    as halfword,
                            )?;
                    }
                } else if self.state.curchr as i64 == 5664040 as i64 {
                    p = self.state.curchr;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    p = (p as integer + self.state.curval) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanxetexmathcharint()?;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(
                                p,
                                123 as i32 as quarterword,
                                self.state.curval,
                            )?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(p, 123 as i32 as quarterword, self.state.curval)?;
                    }
                } else if self.state.curchr as i64 == 5664041 as i64 {
                    p = (self.state.curchr as i32 - 1 as i32) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    p = (p as integer + self.state.curval) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanmathclassint()?;
                    n = ((self.state.curval as u32 & 0x7 as u32) << 21 as i32)
                        as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanmathfamint()?;
                    n = (n as u32)
                        .wrapping_add(
                            (self.state.curval as u32 & 0xff as u32) << 24 as i32,
                        ) as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    n = n + self.state.curval;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(p, 123 as i32 as quarterword, n)?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(p, 123 as i32 as quarterword, n)?;
                    }
                } else if self.state.curchr as i64 == 7892607 as i64 {
                    p = self.state.curchr;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    p = (p as integer + self.state.curval) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqworddefine(p, self.state.curval);
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqworddefine(p, self.state.curval)?;
                    }
                } else {
                    p = (self.state.curchr as i32 - 1 as i32) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    p = (p as integer + self.state.curval) as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    n = 1073741824 as i64 as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanmathfamint()?;
                    n = (n as i64 + self.state.curval as i64 * 2097152 as i64)
                        as integer;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                    n = n + self.state.curval;
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqworddefine(p, n);
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqworddefine(p, n)?;
                    }
                }
            }
            86 => {
                if self.state.curchr as i64 == 1207592 as i64 {
                    n = 15 as i32 as integer;
                } else if self.state.curchr as i64 == 5664040 as i64 {
                    n = 32768 as i64 as integer;
                } else if self.state.curchr as i64 == 4549928 as i64 {
                    n = 32767 as i32 as integer;
                } else if self.state.curchr as i64 == 7892607 as i64 {
                    n = 16777215 as i64 as integer;
                } else {
                    n = 1114111 as i64 as integer;
                }
                p = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanusvnum()?;
                p = (p as integer + self.state.curval) as halfword;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                if self.state.curval < 0 as i32 && (p as i64) < 7892607 as i64
                    || self.state.curval > n
                {
                    self.state.interaction as i32 == 3 as i32;
                    if self.state.filelineerrorstylep != 0 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprintnl(65544 as i64 as strnumber);
                    }
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprint(66127 as i64 as integer);
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintint(self.state.curval);
                    if (p as i64) < 7892607 as i64 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint(66659 as i64 as integer);
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint(66660 as i64 as integer);
                    }
                    (&mut *(self as *mut PortableTexEngine<'_>)).zprintint(n);
                    self.state.helpptr = 1 as eightbits;
                    self.state.helpline[0 as i32 as usize] = 66661 as i64 as strnumber;
                    (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
                    self.state.curval = 0 as i32 as integer;
                }
                if (p as i64) < 5664040 as i64 {
                    if p as i64 >= 4549928 as i64 {
                        n = ((*eqtb.offset(p as isize)).hh.v.RH as i64 / 65536 as i64)
                            as integer;
                        if a as i32 >= 4 as i32 {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zgeqdefine(
                                    p,
                                    123 as i32 as quarterword,
                                    (n as i64 * 65536 as i64 + self.state.curval as i64)
                                        as halfword,
                                )?;
                        } else {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zeqdefine(
                                    p,
                                    123 as i32 as quarterword,
                                    (n as i64 * 65536 as i64 + self.state.curval as i64)
                                        as halfword,
                                )?;
                        }
                    } else if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(
                                p,
                                123 as i32 as quarterword,
                                self.state.curval,
                            )?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(p, 123 as i32 as quarterword, self.state.curval)?;
                    }
                } else if (p as i64) < 7892607 as i64 {
                    if self.state.curval as i64 == 32768 as i64 {
                        self.state.curval = 2097151 as i64 as integer;
                    } else {
                        self.state.curval = (((self.state.curval as i32 / 4096 as i32)
                            as u32 & 0x7 as u32) << 21 as i32)
                            .wrapping_add(
                                ((self.state.curval as i32 % 4096 as i32 / 256 as i32)
                                    as u32 & 0xff as u32) << 24 as i32,
                            )
                            .wrapping_add((self.state.curval as i32 % 256 as i32) as u32)
                            as integer;
                    }
                    if a as i32 >= 4 as i32 {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zgeqdefine(
                                p,
                                123 as i32 as quarterword,
                                self.state.curval,
                            )?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zeqdefine(p, 123 as i32 as quarterword, self.state.curval)?;
                    }
                } else if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqworddefine(p, self.state.curval);
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqworddefine(p, self.state.curval)?;
                }
            }
            88 => {
                p = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanmathfamint()?;
                p = (p as integer + self.state.curval) as halfword;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanfontident()?;
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(p, 123 as i32 as quarterword, self.state.curval)?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(p, 123 as i32 as quarterword, self.state.curval)?;
                }
            }
            91 | 92 | 93 | 94 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).zdoregistercommand(a)?;
            }
            100 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).scanregisternum()?;
                if a as i32 >= 4 as i32 {
                    n = (1073774592 as i64 + self.state.curval as i64) as integer;
                } else {
                    n = (1073741824 as i64 + self.state.curval as i64) as integer;
                }
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                if self.state.setboxallowed != 0 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).zscanbox(n)?;
                } else {
                    self.state.interaction as i32 == 3 as i32;
                    if self.state.filelineerrorstylep != 0 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprintnl(65544 as i64 as strnumber);
                    }
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprint(66029 as i64 as integer);
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zprintesc(65860 as i64 as strnumber);
                    self.state.helpptr = 2 as eightbits;
                    self.state.helpline[1 as i32 as usize] = 66667 as i64 as strnumber;
                    self.state.helpline[0 as i32 as usize] = 66668 as i64 as strnumber;
                    (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
                }
            }
            80 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).alteraux()?;
            }
            81 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).alterprevgraf()?;
            }
            82 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).alterpagesofar()?;
            }
            83 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).alterinteger()?;
            }
            84 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).alterboxdimen()?;
            }
            85 => {
                q = self.state.curchr;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                n = self.state.curval;
                if n <= 0 as i32 {
                    p = -(268435455 as i64) as halfword;
                } else if q as i64 > 1206295 as i64 {
                    n = (self.state.curval as i32 / 2 as i32 + 1 as i32) as integer;
                    p = (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgetnode(2 as i32 * n as i32 + 1 as i32)?;
                    (*mem.offset(p as isize)).hh.v.LH = n as halfword;
                    n = self.state.curval;
                    (*mem.offset((p as i32 + 1 as i32) as isize)).u.CINT = n;
                    let mut for_end: integer = 0;
                    j = (p as i32 + 2 as i32) as halfword;
                    for_end = (p as i32 + n as i32 + 1 as i32) as integer;
                    if j <= for_end {
                        loop {
                            (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                            (*mem.offset(j as isize)).u.CINT = self.state.curval;
                            let fresh71 = j;
                            j = j + 1;
                            if !(fresh71 < for_end) {
                                break;
                            }
                        }
                    }
                    if n as i32 & 1 as i32 == 0 {
                        (*mem.offset((p as i32 + n as i32 + 2 as i32) as isize))
                            .u
                            .CINT = 0 as i32 as integer;
                    }
                } else {
                    p = (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgetnode(2 as i32 * n as i32 + 1 as i32)?;
                    (*mem.offset(p as isize)).hh.v.LH = n as halfword;
                    let mut for_end_0: integer = 0;
                    j = 1 as i32 as halfword;
                    for_end_0 = n;
                    if j <= for_end_0 {
                        loop {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zscandimen(0 as i32, 0 as i32, 0 as i32)?;
                            (*mem
                                .offset(
                                    (p as i32 + 2 as i32 * j as i32 - 1 as i32) as isize,
                                ))
                                .u
                                .CINT = self.state.curval;
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zscandimen(0 as i32, 0 as i32, 0 as i32)?;
                            (*mem.offset((p + 2 as halfword * j) as isize)).u.CINT = self
                                .state
                                .curval;
                            let fresh72 = j;
                            j = j + 1;
                            if !(fresh72 < for_end_0) {
                                break;
                            }
                        }
                    }
                }
                if a as i32 >= 4 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zgeqdefine(q, 121 as i32 as quarterword, p)?;
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>))
                        .zeqdefine(q, 121 as i32 as quarterword, p)?;
                }
            }
            101 => {
                if self.state.curchr == 1 as i32 {
                    if self.state.iniversion != 0 {
                        (&mut *(self as *mut PortableTexEngine<'_>)).newpatterns()?;
                    } else {
                        self.state.interaction as i32 == 3 as i32;
                        if self.state.filelineerrorstylep != 0 {
                            (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
                        } else {
                            (&mut *(self as *mut PortableTexEngine<'_>))
                                .zprintnl(65544 as i64 as strnumber);
                        }
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zprint(66672 as i64 as integer);
                        self.state.helpptr = 0 as eightbits;
                        (&mut *(self as *mut PortableTexEngine<'_>)).error()?;
                        loop {
                            (&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
                            if self.state.curcmd as i32 == 2 as i32 {
                                break;
                            }
                        }
                        return Ok(());
                    }
                } else {
                    (&mut *(self as *mut PortableTexEngine<'_>)).newhyphexceptions()?;
                }
            }
            78 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).zfindfontdimen(1 as i32)?;
                k = self.state.curval as fontindex;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zscandimen(0 as i32, 0 as i32, 0 as i32)?;
                (*self.state.fontinfo.offset(k as isize)).u.CINT = self.state.curval;
            }
            79 => {
                n = self.state.curchr as integer;
                (&mut *(self as *mut PortableTexEngine<'_>)).scanfontident()?;
                f = self.state.curval as internalfontnumber;
                if n < 2 as i32 {
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                    if n == 0 as i32 {
                        *self.state.hyphenchar.offset(f as isize) = self.state.curval;
                    } else {
                        *self.state.skewchar.offset(f as isize) = self.state.curval;
                    }
                } else {
                    if *self.state.fontarea.offset(f as isize) as i64 == 65535 as i64
                        || *self.state.fontarea.offset(f as isize) as i64 == 65534 as i64
                    {
                        (&mut *(self as *mut PortableTexEngine<'_>))
                            .zscanglyphnumber(f)?;
                    } else {
                        (&mut *(self as *mut PortableTexEngine<'_>)).scancharnum()?;
                    }
                    p = self.state.curval as halfword;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanoptionalequals()?;
                    (&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
                    match n {
                        2 => {
                            set_cp_code(
                                f as i32,
                                p as u32,
                                0 as i32,
                                self.state.curval as i32,
                            );
                        }
                        3 => {
                            set_cp_code(
                                f as i32,
                                p as u32,
                                1 as i32,
                                self.state.curval as i32,
                            );
                        }
                        _ => {}
                    }
                }
            }
            90 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).znewfont(a)?;
            }
            102 => {
                (&mut *(self as *mut PortableTexEngine<'_>)).newinteraction();
            }
            _ => {
                match (&mut *(self as *mut PortableTexEngine<'_>))
                    .zconfusion(66616 as i64 as strnumber)?
                {};
            }
        }
        Ok(
            if self.state.aftertoken != 0 as i32 {
                self.state.curtok = self.state.aftertoken;
                (&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
                self.state.aftertoken = 0 as i32 as halfword;
            },
        )
    }
    pub(crate) unsafe fn preparemag(&mut self) -> EngineFlow<()> {
        let eqtb = self.state.zeqtb.as_mut_ptr();
        if self.state.magset > 0 as i32
            && (*eqtb.offset(7892281 as i64 as isize)).u.CINT != self.state.magset
        {
            self.state.interaction as i32 == 3 as i32;
            if self.state.filelineerrorstylep != 0 {
                (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
            } else {
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprintnl(65544 as i64 as strnumber);
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65875 as i64 as integer);
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zprintint((*eqtb.offset(7892281 as i64 as isize)).u.CINT);
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65876 as i64 as integer);
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zprintnl(65877 as i64 as strnumber);
            self.state.helpptr = 2 as eightbits;
            self.state.helpline[1 as i32 as usize] = 65878 as i64 as strnumber;
            self.state.helpline[0 as i32 as usize] = 65879 as i64 as strnumber;
            (&mut *(self as *mut PortableTexEngine<'_>)).zinterror(self.state.magset)?;
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zgeqworddefine(7892281 as i64 as halfword, self.state.magset);
        }
        if (*eqtb.offset(7892281 as i64 as isize)).u.CINT <= 0 as i32
            || (*eqtb.offset(7892281 as i64 as isize)).u.CINT as i64 > 32768 as i64
        {
            self.state.interaction as i32 == 3 as i32;
            if self.state.filelineerrorstylep != 0 {
                (&mut *(self as *mut PortableTexEngine<'_>)).printfileline();
            } else {
                (&mut *(self as *mut PortableTexEngine<'_>))
                    .zprintnl(65544 as i64 as strnumber);
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65880 as i64 as integer);
            self.state.helpptr = 1 as eightbits;
            self.state.helpline[0 as i32 as usize] = 65881 as i64 as strnumber;
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zinterror((*eqtb.offset(7892281 as i64 as isize)).u.CINT)?;
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zgeqworddefine(7892281 as i64 as halfword, 1000 as i32);
        }
        self.state.magset = (*eqtb.offset(7892281 as i64 as isize)).u.CINT;
        Ok(())
    }
pub(crate) unsafe fn printcurrentstring(&mut self) {
    let mut j: poolpointer = 0;
    j = *self.state.strstart.offset((self.state.strptr as i64 - 65536 as i64) as isize);
    while j < self.state.poolptr {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(*self.state.strpool.offset(j as isize) as integer);
        j += 1;
    }
}

pub(crate) unsafe fn printfileline(&mut self) {
    let mut level: integer = 0;
    level = self.state.inopen;
    while level > 0 as i32
        && *self.state.fullsourcefilenamestack.offset(level as isize) == 0 as i32
    {
        level -= 1;
    }
    if level == 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintnl(65544 as i64 as strnumber);
    } else {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintnl(65626 as i64 as strnumber);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(*self.state.fullsourcefilenamestack.offset(level as isize));
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(58 as i32);
        if level == self.state.inopen {
            (&mut *(self as *mut PortableTexEngine<'_>)).zprintint(self.state.line);
        } else {
            (&mut *(self as *mut PortableTexEngine<'_>)).zprintint(
                *self.state.linestack.offset((level as i32 + 1 as i32) as isize),
            );
        }
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65593 as i64 as integer);
    };
}

    pub(crate) unsafe fn println(&mut self) {
        match self.state.selector as i32 {
            19 => {
                Self::boundary_write_byte(
                    self as *mut PortableTexEngine<'_>,
                    '\n' as i32,
                    self.state.terminal_output,
                );
                Self::boundary_write_byte(
                    self as *mut PortableTexEngine<'_>,
                    '\n' as i32,
                    self.state.logfile as NativeFileHandle,
                );
                self.state.termoffset = 0 as i32 as integer;
                self.state.fileoffset = 0 as i32 as integer;
            }
            18 => {
                Self::boundary_write_byte(
                    self as *mut PortableTexEngine<'_>,
                    '\n' as i32,
                    self.state.logfile as NativeFileHandle,
                );
                self.state.fileoffset = 0 as i32 as integer;
            }
            17 => {
                Self::boundary_write_byte(
                    self as *mut PortableTexEngine<'_>,
                    '\n' as i32,
                    self.state.terminal_output,
                );
                self.state.termoffset = 0 as i32 as integer;
            }
            16 | 20 | 21 => {}
            _ => {
                Self::boundary_write_byte(
                    self as *mut PortableTexEngine<'_>,
                    '\n' as i32,
                    self.state.writefile[self.state.selector as usize],
                );
            }
        };
    }
pub(crate) unsafe fn printmeaning(&mut self) {
    (&mut *(self as *mut PortableTexEngine<'_>)).zprintcmdchr(self.state.curcmd as quarterword, self.state.curchr);
    if self.state.curcmd as i32 >= 114 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(58 as i32);
        (&mut *(self as *mut PortableTexEngine<'_>)).println();
        (&mut *(self as *mut PortableTexEngine<'_>)).ztokenshow(self.state.curchr);
    } else if self.state.curcmd as i32 == 113 as i32
        && self.state.curchr < 5 as i32
    {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(58 as i32);
        (&mut *(self as *mut PortableTexEngine<'_>)).println();
        (&mut *(self as *mut PortableTexEngine<'_>)).ztokenshow(self.state.curmark[self.state.curchr as usize]);
    }
}

pub(crate) unsafe fn printtotals(&mut self) {
    (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[1 as i32 as usize]);
    if self.state.pagesofar[2 as i32 as usize] != 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65598 as i64 as integer);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[2 as i32 as usize]);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65626 as i64 as integer);
    }
    if self.state.pagesofar[3 as i32 as usize] != 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65598 as i64 as integer);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[3 as i32 as usize]);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65597 as i64 as integer);
    }
    if self.state.pagesofar[4 as i32 as usize] != 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65598 as i64 as integer);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[4 as i32 as usize]);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66414 as i64 as integer);
    }
    if self.state.pagesofar[5 as i32 as usize] != 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65598 as i64 as integer);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[5 as i32 as usize]);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66415 as i64 as integer);
    }
    if self.state.pagesofar[6 as i32 as usize] != 0 as i32 {
        (&mut *(self as *mut PortableTexEngine<'_>)).zprint(65599 as i64 as integer);
        (&mut *(self as *mut PortableTexEngine<'_>)).zprintscaled(self.state.pagesofar[6 as i32 as usize]);
    }
}

    pub(crate) unsafe fn privileged(&mut self) -> EngineFlow<boolean> {
        let mut Result: boolean = 0;
        if self.state.curlist.modefield as i32 > 0 as i32 {
            Result = true_0 as boolean;
        } else {
            (&mut *(self as *mut PortableTexEngine<'_>)).reportillegalcase()?;
            Result = false_0 as boolean;
        }
        return Ok(Result);
    }
    pub(crate) unsafe fn pseudoclose(&mut self) {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let mut p: halfword = 0;
        let mut q: halfword = 0;
        p = (*mem.offset(self.state.pseudofiles as isize)).hh.v.RH;
        q = (*mem.offset(self.state.pseudofiles as isize)).hh.v.LH;
        (*mem.offset(self.state.pseudofiles as isize)).hh.v.RH = self.state.avail;
        self.state.avail = self.state.pseudofiles;
        self.state.dynused -= 1;
        self.state.pseudofiles = p;
        while q as i64 != -(268435455 as i64) {
            p = q;
            q = (*mem.offset(p as isize)).hh.v.RH;
            (&mut *(self as *mut PortableTexEngine<'_>))
                .zfreenode(p, (*mem.offset(p as isize)).hh.v.LH);
        }
    }
    pub(crate) unsafe fn pseudoinput(&mut self) -> EngineFlow<boolean> {
        let mut Result: boolean = 0;
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let mut p: halfword = 0;
        let mut sz: integer = 0;
        let mut w: fourquarters = fourquarters {
            u: C2RustUnnamed_2 {
                B3: 0,
                B2: 0,
                B1: 0,
                B0: 0,
            },
        };
        let mut r: halfword = 0;
        self.state.last = self.state.first;
        p = (*mem.offset(self.state.pseudofiles as isize)).hh.v.LH;
        if p as i64 == -(268435455 as i64) {
            Result = false_0 as boolean;
        } else {
            (*mem.offset(self.state.pseudofiles as isize)).hh.v.LH = (*mem
                .offset(p as isize))
                .hh
                .v
                .RH;
            sz = (*mem.offset(p as isize)).hh.v.LH as integer;
            if 4 as i32 * sz as i32 - 3 as i32 >= self.state.bufsize - self.state.last {
                self.state.curinput.locfield = self.state.first as halfword;
                self.state.curinput.limitfield = (self.state.last as i32 - 1 as i32)
                    as halfword;
                match (&mut *(self as *mut PortableTexEngine<'_>))
                    .zoverflow(65538 as i64 as strnumber, self.state.bufsize)?
                {};
            }
            self.state.last = self.state.first;
            let mut for_end: integer = 0;
            r = (p as i32 + 1 as i32) as halfword;
            for_end = (p as i32 + sz as i32 - 1 as i32) as integer;
            if r <= for_end {
                loop {
                    w = (*mem.offset(r as isize)).v.QQQQ;
                    *self.state.buffer.offset(self.state.last as isize) = (w.u.B0) as i32
                        as UnicodeScalar;
                    *self
                        .state
                        .buffer
                        .offset((self.state.last as i32 + 1 as i32) as isize) = (w.u.B1)
                        as i32 as UnicodeScalar;
                    *self
                        .state
                        .buffer
                        .offset((self.state.last as i32 + 2 as i32) as isize) = (w.u.B2)
                        as i32 as UnicodeScalar;
                    *self
                        .state
                        .buffer
                        .offset((self.state.last as i32 + 3 as i32) as isize) = (w.u.B3)
                        as i32 as UnicodeScalar;
                    self.state.last = (self.state.last as i32 + 4 as i32) as integer;
                    let fresh33 = r;
                    r = r + 1;
                    if !(fresh33 < for_end) {
                        break;
                    }
                }
            }
            if self.state.last >= self.state.maxbufstack {
                self.state.maxbufstack = (self.state.last as i32 + 1 as i32) as integer;
            }
            while self.state.last > self.state.first
                && *self
                    .state
                    .buffer
                    .offset((self.state.last as i32 - 1 as i32) as isize) == 32 as i32
            {
                self.state.last -= 1;
            }
            (&mut *(self as *mut PortableTexEngine<'_>)).zfreenode(p, sz);
            Result = true_0 as boolean;
        }
        return Ok(Result);
    }
    pub(crate) unsafe fn pseudostart(&mut self) -> EngineFlow<()> {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let eqtb = self.state.zeqtb.as_mut_ptr();
        let mut oldsetting_0: eightbits = 0;
        let mut s: strnumber = 0;
        let mut l_0: poolpointer = 0;
        let mut m: poolpointer = 0;
        let mut p: halfword = 0;
        let mut q: halfword = 0;
        let mut r: halfword = 0;
        let mut w: fourquarters = fourquarters {
            u: C2RustUnnamed_2 {
                B3: 0,
                B2: 0,
                B1: 0,
                B0: 0,
            },
        };
        let mut nl: integer = 0;
        let mut sz: integer = 0;
        (&mut *(self as *mut PortableTexEngine<'_>)).scangeneraltext()?;
        oldsetting_0 = self.state.selector;
        self.state.selector = 21 as eightbits;
        (&mut *(self as *mut PortableTexEngine<'_>))
            .ztokenshow(self.state.memtop as i32 - 3 as i32);
        self.state.selector = oldsetting_0;
        (&mut *(self as *mut PortableTexEngine<'_>))
            .zflushlist(
                (*mem.offset((self.state.memtop as i32 - 3 as i32) as isize)).hh.v.RH,
            );
        if self.state.poolptr as i32 + 1 as i32 > self.state.poolsize {
            match (&mut *(self as *mut PortableTexEngine<'_>))
                .zoverflow(
                    65539 as i64 as strnumber,
                    self.state.poolsize as poolpointer - self.state.initpoolptr,
                )?
            {};
        }
        s = (&mut *(self as *mut PortableTexEngine<'_>)).makestring()?;
        *self.state.strpool.offset(self.state.poolptr as isize) = 32 as packedUTF16code;
        l_0 = *self.state.strstart.offset((s as i64 - 65536 as i64) as isize);
        nl = (*eqtb.offset(7892313 as i64 as isize)).u.CINT;
        p = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
        q = p;
        while l_0 < self.state.poolptr {
            m = l_0;
            while l_0 < self.state.poolptr
                && *self.state.strpool.offset(l_0 as isize) as i32 != nl
            {
                l_0 += 1;
            }
            sz = ((l_0 as i32 - m as i32 + 7 as i32) / 4 as i32) as integer;
            if sz == 1 as i32 {
                sz = 2 as i32 as integer;
            }
            r = (&mut *(self as *mut PortableTexEngine<'_>)).zgetnode(sz)?;
            (*mem.offset(q as isize)).hh.v.RH = r;
            q = r;
            (*mem.offset(q as isize)).hh.v.LH = sz as halfword;
            while sz > 2 as i32 {
                sz -= 1;
                r += 1;
                w.u.B0 = (*self.state.strpool.offset(m as isize) as quarterword) as u16;
                w.u.B1 = (*self.state.strpool.offset((m as i32 + 1 as i32) as isize)
                    as quarterword) as u16;
                w.u.B2 = (*self.state.strpool.offset((m as i32 + 2 as i32) as isize)
                    as quarterword) as u16;
                w.u.B3 = (*self.state.strpool.offset((m as i32 + 3 as i32) as isize)
                    as quarterword) as u16;
                (*mem.offset(r as isize)).v.QQQQ = w;
                m = (m as i32 + 4 as i32) as poolpointer;
            }
            w.u.B0 = (32 as quarterword) as u16;
            w.u.B1 = (32 as quarterword) as u16;
            w.u.B2 = (32 as quarterword) as u16;
            w.u.B3 = (32 as quarterword) as u16;
            if l_0 > m {
                w.u.B0 = (*self.state.strpool.offset(m as isize) as quarterword) as u16;
                if l_0 > m as i32 + 1 as i32 {
                    w.u.B1 = (*self.state.strpool.offset((m as i32 + 1 as i32) as isize)
                        as quarterword) as u16;
                    if l_0 > m as i32 + 2 as i32 {
                        w.u.B2 = (*self
                            .state
                            .strpool
                            .offset((m as i32 + 2 as i32) as isize) as quarterword)
                            as u16;
                        if l_0 > m as i32 + 3 as i32 {
                            w.u.B3 = (*self
                                .state
                                .strpool
                                .offset((m as i32 + 3 as i32) as isize) as quarterword)
                                as u16;
                        }
                    }
                }
            }
            (*mem.offset((r as i32 + 1 as i32) as isize)).v.QQQQ = w;
            if *self.state.strpool.offset(l_0 as isize) as i32 == nl {
                l_0 += 1;
            }
        }
        (*mem.offset(p as isize)).hh.v.LH = (*mem.offset(p as isize)).hh.v.RH;
        (*mem.offset(p as isize)).hh.v.RH = self.state.pseudofiles;
        self.state.pseudofiles = p;
        self.state.strptr -= 1;
        self.state.poolptr = *self
            .state
            .strstart
            .offset((self.state.strptr as i64 - 65536 as i64) as isize);
        (&mut *(self as *mut PortableTexEngine<'_>)).beginfilereading()?;
        self.state.line = 0 as i32 as integer;
        self.state.curinput.limitfield = self.state.curinput.startfield;
        self.state.curinput.locfield = (self.state.curinput.limitfield as i32 + 1 as i32)
            as halfword;
        if (*eqtb.offset(7892328 as i64 as isize)).u.CINT > 0 as i32 {
            if self.state.termoffset > self.state.maxprintline as i32 - 3 as i32 {
                (&mut *(self as *mut PortableTexEngine<'_>)).println();
            } else if self.state.termoffset > 0 as i32
                || self.state.fileoffset > 0 as i32
            {
                (&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(32 as i32);
            }
            self.state.curinput.namefield = 19 as i32 as halfword;
            (&mut *(self as *mut PortableTexEngine<'_>)).zprint(66934 as i64 as integer);
            self.state.openparens += 1;
            Self::boundary_flush_file(self.state.terminal_output);
        } else {
            self.state.curinput.namefield = 18 as i32 as halfword;
        };
        Ok(())
    }
    pub(crate) unsafe fn pushalignment(&mut self) -> EngineFlow<()> {
        let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
        let mut p: halfword = 0;
        p = (&mut *(self as *mut PortableTexEngine<'_>)).zgetnode(6 as i32)?;
        (*mem.offset(p as isize)).hh.v.RH = self.state.alignptr;
        (*mem.offset(p as isize)).hh.v.LH = self.state.curalign;
        (*mem.offset((p as i32 + 1 as i32) as isize)).hh.v.LH = (*mem
            .offset((self.state.memtop as i32 - 8 as i32) as isize))
            .hh
            .v
            .RH;
        (*mem.offset((p as i32 + 1 as i32) as isize)).hh.v.RH = self.state.curspan;
        (*mem.offset((p as i32 + 2 as i32) as isize)).u.CINT = self.state.curloop
            as integer;
        (*mem.offset((p as i32 + 3 as i32) as isize)).u.CINT = self.state.alignstate;
        (*mem.offset((p as i32 + 4 as i32) as isize)).hh.v.LH = self.state.curhead;
        (*mem.offset((p as i32 + 4 as i32) as isize)).hh.v.RH = self.state.curtail;
        (*mem.offset((p as i32 + 5 as i32) as isize)).hh.v.LH = self.state.curprehead;
        (*mem.offset((p as i32 + 5 as i32) as isize)).hh.v.RH = self.state.curpretail;
        self.state.alignptr = p;
        self.state.curhead = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
        self.state.curprehead = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
        Ok(())
    }
    pub(crate) unsafe fn pushnest(&mut self) -> EngineFlow<()> {
        if self.state.nestptr > self.state.maxneststack {
            self.state.maxneststack = self.state.nestptr;
            if self.state.nestptr == self.state.nestsize {
                match (&mut *(self as *mut PortableTexEngine<'_>))
                    .zoverflow(65660 as i64 as strnumber, self.state.nestsize)?
                {};
            }
        }
        *self.state.nest.offset(self.state.nestptr as isize) = self.state.curlist;
        self.state.nestptr += 1;
        self.state.curlist.headfield = (&mut *(self as *mut PortableTexEngine<'_>))
            .getavail()?;
        self.state.curlist.tailfield = self.state.curlist.headfield;
        self.state.curlist.pgfield = 0 as i32 as integer;
        self.state.curlist.mlfield = self.state.line;
        self.state.curlist.eTeXauxfield = -(268435455 as i64) as halfword;
        Ok(())
    }
}