#![allow(dead_code, non_camel_case_types, non_snake_case, unused_assignments, 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);
}
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 {
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)
{
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
{
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
{
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 {
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 {
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 => {
Self::set_character_protrusion(
self as *mut PortableTexEngine<'_>,
f as i32,
p as u32,
0 as i32,
self.state.curval as i32,
);
}
3 => {
Self::set_character_protrusion(
self as *mut PortableTexEngine<'_>,
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
{
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
{
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);
Self::begin_file_line_error_message(self);
};
}
pub(crate) unsafe fn println(&mut self) {
match self.state.selector as i32 {
19 => {
Self::boundary_write_terminal_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_terminal_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(())
}
}