#![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 sarestore(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut p: halfword = 0;
Ok(
loop {
p = (*mem.offset((self.state.sachain as i32 + 1 as i32) as isize))
.hh
.v
.LH;
if (*mem.offset(p as isize)).hh.u.B1 as i32 == 1 as i32 {
if (*mem.offset(p as isize)).hh.u.B0 as i32 >= 128 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zsadestroy(self.state.sachain)?;
}
if (*eqtb.offset(7892301 as i64 as isize)).u.CINT > 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowsa(p, 65872 as i64 as strnumber);
}
} else {
if ((*mem.offset(p as isize)).hh.u.B0 as i32) < 128 as i32 {
if ((*mem.offset(self.state.sachain as isize)).hh.u.B0 as i32)
< 128 as i32
{
(*mem.offset((p as i32 + 2 as i32) as isize)).u.CINT = (*mem
.offset((self.state.sachain as i32 + 2 as i32) as isize))
.u
.CINT;
} else {
(*mem.offset((p as i32 + 2 as i32) as isize)).u.CINT = 0
as i32 as integer;
}
} else {
(&mut *(self as *mut PortableTexEngine<'_>)).zsadestroy(p)?;
(*mem.offset((p as i32 + 1 as i32) as isize)).hh.v.RH = (*mem
.offset((self.state.sachain as i32 + 1 as i32) as isize))
.hh
.v
.RH;
}
(*mem.offset(p as isize)).hh.u.B1 = (*mem
.offset(self.state.sachain as isize))
.hh
.u
.B1;
if (*eqtb.offset(7892301 as i64 as isize)).u.CINT > 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowsa(p, 65873 as i64 as strnumber);
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).zdeletesaref(p);
p = self.state.sachain;
self.state.sachain = (*mem.offset(p as isize)).hh.v.RH;
if ((*mem.offset(p as isize)).hh.u.B0 as i32) < 128 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).zfreenode(p, 3 as i32);
} else {
(&mut *(self as *mut PortableTexEngine<'_>)).zfreenode(p, 2 as i32);
}
if self.state.sachain as i64 == -(268435455 as i64) {
break;
}
},
)
}
pub(crate) unsafe fn scanandpackname(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanfilename()?;
(&mut *(self as *mut PortableTexEngine<'_>))
.zpackfilename(self.state.curname, self.state.curarea, self.state.curext);
Ok(())
}
pub(crate) unsafe fn scancharclass(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 4096 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(66036 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66037 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scancharclassnotignored(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 4096 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(66036 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66038 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scancharnum(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval as i64 > 65535 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(66041 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66043 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scandelimiterint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32
|| self.state.curval as i64 > 134217727 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(66057 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66058 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scaneightbitint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 255 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(66039 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66040 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanexpr(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut a: boolean = 0;
let mut b: boolean = 0;
let mut l_0: smallnumber = 0;
let mut r: smallnumber = 0;
let mut s: smallnumber = 0;
let mut o: smallnumber = 0;
let mut e: integer = 0;
let mut t: integer = 0;
let mut f_0: integer = 0;
let mut n: integer = 0;
let mut p: halfword = 0;
let mut q: halfword = 0;
l_0 = self.state.curvallevel as smallnumber;
a = self.state.aritherror;
b = false_0 as boolean;
p = -(268435455 as i64) as halfword;
self.state.expanddepthcount += 1;
if self.state.expanddepthcount >= self.state.expanddepth {
match (&mut *(self as *mut PortableTexEngine<'_>))
.zoverflow(65951 as i64 as strnumber, self.state.expanddepth)?
{};
}
'_lab20: loop {
r = 0 as smallnumber;
e = 0 as i32 as integer;
s = 0 as smallnumber;
t = 0 as i32 as integer;
n = 0 as i32 as integer;
loop {
if s as i32 == 0 as i32 {
o = l_0;
} else {
o = 0 as smallnumber;
}
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
if self.state.curtok as i64 == 25165864 as i64 {
break;
}
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
if o as i32 == 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
} else if o as i32 == 1 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zscandimen(0 as i32, 0 as i32, 0 as i32)?;
} else if o as i32 == 2 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).scannormalglue()?;
} else {
(&mut *(self as *mut PortableTexEngine<'_>)).scanmuglue()?;
}
f_0 = self.state.curval;
loop {
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
if self.state.curtok as i64 == 25165867 as i64 {
o = 1 as smallnumber;
} else if self.state.curtok as i64 == 25165869 as i64 {
o = 2 as smallnumber;
} else if self.state.curtok as i64 == 25165866 as i64 {
o = 3 as smallnumber;
} else if self.state.curtok as i64 == 25165871 as i64 {
o = 4 as smallnumber;
} else {
o = 0 as smallnumber;
if p as i64 == -(268435455 as i64) {
if self.state.curcmd as i32 != 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
}
} else if self.state.curtok as i64 != 25165865 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(66950 as i64 as integer);
self.state.helpptr = 1 as eightbits;
self.state.helpline[0 as i32 as usize] = 66951 as i64
as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
}
}
self.state.aritherror = b;
if l_0 as i32 == 0 as i32 || s as i32 > 2 as i32 {
if f_0 as i64 > 2147483647 as i64
|| (f_0 as i64) < -(2147483647 as i64)
{
self.state.aritherror = true_0 as boolean;
f_0 = 0 as i32 as integer;
}
} else if l_0 as i32 == 1 as i32 {
if (if f_0 >= 0 as i32 { f_0 } else { -f_0 }) as i64
> 1073741823 as i64
{
self.state.aritherror = true_0 as boolean;
f_0 = 0 as i32 as integer;
}
} else if (if (*mem.offset((f_0 as i32 + 1 as i32) as isize)).u.CINT
>= 0 as i32
{
(*mem.offset((f_0 as i32 + 1 as i32) as isize)).u.CINT
} else {
-(*mem.offset((f_0 as i32 + 1 as i32) as isize)).u.CINT
}) as i64 > 1073741823 as i64
|| (if (*mem.offset((f_0 as i32 + 2 as i32) as isize)).u.CINT
>= 0 as i32
{
(*mem.offset((f_0 as i32 + 2 as i32) as isize)).u.CINT
} else {
-(*mem.offset((f_0 as i32 + 2 as i32) as isize)).u.CINT
}) as i64 > 1073741823 as i64
|| (if (*mem.offset((f_0 as i32 + 3 as i32) as isize)).u.CINT
>= 0 as i32
{
(*mem.offset((f_0 as i32 + 3 as i32) as isize)).u.CINT
} else {
-(*mem.offset((f_0 as i32 + 3 as i32) as isize)).u.CINT
}) as i64 > 1073741823 as i64
{
self.state.aritherror = true_0 as boolean;
(&mut *(self as *mut PortableTexEngine<'_>)).zdeleteglueref(f_0);
f_0 = (&mut *(self as *mut PortableTexEngine<'_>))
.znewspec(self.state.membot)? as integer;
}
match s as i32 {
0 => {
if l_0 as i32 >= 2 as i32 && o as i32 != 0 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.znewspec(f_0)? as integer;
(&mut *(self as *mut PortableTexEngine<'_>))
.zdeleteglueref(f_0);
if (*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT
== 0 as i32
{
(*mem.offset(t as isize)).hh.u.B0 = 0 as i16;
}
if (*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT
== 0 as i32
{
(*mem.offset(t as isize)).hh.u.B1 = 0 as i16;
}
} else {
t = f_0;
}
}
3 => {
if o as i32 == 4 as i32 {
n = f_0;
o = 5 as smallnumber;
} else if l_0 as i32 == 0 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zmultandadd(t, f_0, 0 as i32, 2147483647 as i64 as scaled)
as integer;
} else if l_0 as i32 == 1 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zmultandadd(t, f_0, 0 as i32, 1073741823 as i64 as scaled)
as integer;
} else {
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zmultandadd(
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT,
f_0,
0 as i32,
1073741823 as i64 as scaled,
) as integer;
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zmultandadd(
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT,
f_0,
0 as i32,
1073741823 as i64 as scaled,
) as integer;
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zmultandadd(
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT,
f_0,
0 as i32,
1073741823 as i64 as scaled,
) as integer;
}
}
4 => {
if (l_0 as i32) < 2 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zquotient(t, f_0);
} else {
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zquotient(
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT,
f_0,
);
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zquotient(
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT,
f_0,
);
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zquotient(
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT,
f_0,
);
}
}
5 => {
if l_0 as i32 == 0 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zfract(t, n, f_0, 2147483647 as i64 as integer);
} else if l_0 as i32 == 1 as i32 {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zfract(t, n, f_0, 1073741823 as i64 as integer);
} else {
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zfract(
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT,
n,
f_0,
1073741823 as i64 as integer,
);
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zfract(
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT,
n,
f_0,
1073741823 as i64 as integer,
);
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zfract(
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT,
n,
f_0,
1073741823 as i64 as integer,
);
}
}
_ => {}
}
if o as i32 > 2 as i32 {
s = o;
} else {
s = 0 as smallnumber;
if r as i32 == 0 as i32 {
e = t;
} else if l_0 as i32 == 0 as i32 {
e = (&mut *(self as *mut PortableTexEngine<'_>))
.zaddorsub(
e,
t,
2147483647 as i64 as integer,
(r as i32 == 2 as i32) as i32,
);
} else if l_0 as i32 == 1 as i32 {
e = (&mut *(self as *mut PortableTexEngine<'_>))
.zaddorsub(
e,
t,
1073741823 as i64 as integer,
(r as i32 == 2 as i32) as i32,
);
} else {
(*mem.offset((e as i32 + 1 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zaddorsub(
(*mem.offset((e as i32 + 1 as i32) as isize)).u.CINT,
(*mem.offset((t as i32 + 1 as i32) as isize)).u.CINT,
1073741823 as i64 as integer,
(r as i32 == 2 as i32) as i32,
);
if (*mem.offset(e as isize)).hh.u.B0 as i32
== (*mem.offset(t as isize)).hh.u.B0 as i32
{
(*mem.offset((e as i32 + 2 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zaddorsub(
(*mem.offset((e as i32 + 2 as i32) as isize)).u.CINT,
(*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT,
1073741823 as i64 as integer,
(r as i32 == 2 as i32) as i32,
);
} else if ((*mem.offset(e as isize)).hh.u.B0 as i32)
< (*mem.offset(t as isize)).hh.u.B0 as i32
&& (*mem.offset((t as i32 + 2 as i32) as isize)).u.CINT
!= 0 as i32
{
(*mem.offset((e as i32 + 2 as i32) as isize)).u.CINT = (*mem
.offset((t as i32 + 2 as i32) as isize))
.u
.CINT;
(*mem.offset(e as isize)).hh.u.B0 = (*mem
.offset(t as isize))
.hh
.u
.B0;
}
if (*mem.offset(e as isize)).hh.u.B1 as i32
== (*mem.offset(t as isize)).hh.u.B1 as i32
{
(*mem.offset((e as i32 + 3 as i32) as isize)).u.CINT = (&mut *(self
as *mut PortableTexEngine<'_>))
.zaddorsub(
(*mem.offset((e as i32 + 3 as i32) as isize)).u.CINT,
(*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT,
1073741823 as i64 as integer,
(r as i32 == 2 as i32) as i32,
);
} else if ((*mem.offset(e as isize)).hh.u.B1 as i32)
< (*mem.offset(t as isize)).hh.u.B1 as i32
&& (*mem.offset((t as i32 + 3 as i32) as isize)).u.CINT
!= 0 as i32
{
(*mem.offset((e as i32 + 3 as i32) as isize)).u.CINT = (*mem
.offset((t as i32 + 3 as i32) as isize))
.u
.CINT;
(*mem.offset(e as isize)).hh.u.B1 = (*mem
.offset(t as isize))
.hh
.u
.B1;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zdeleteglueref(t);
if (*mem.offset((e as i32 + 2 as i32) as isize)).u.CINT
== 0 as i32
{
(*mem.offset(e as isize)).hh.u.B0 = 0 as i16;
}
if (*mem.offset((e as i32 + 3 as i32) as isize)).u.CINT
== 0 as i32
{
(*mem.offset(e as isize)).hh.u.B1 = 0 as i16;
}
}
r = o;
}
b = self.state.aritherror;
if o as i32 != 0 as i32 {
break;
}
if !(p as i64 != -(268435455 as i64)) {
break '_lab20;
}
f_0 = e;
q = p;
e = (*mem.offset((q as i32 + 1 as i32) as isize)).u.CINT;
t = (*mem.offset((q as i32 + 2 as i32) as isize)).u.CINT;
n = (*mem.offset((q as i32 + 3 as i32) as isize)).u.CINT;
s = ((*mem.offset(q as isize)).hh.u.B1 as i32 / 4 as i32)
as smallnumber;
r = ((*mem.offset(q as isize)).hh.u.B1 as i32 % 4 as i32)
as smallnumber;
l_0 = (*mem.offset(q as isize)).hh.u.B0 as smallnumber;
p = (*mem.offset(q as isize)).hh.v.RH;
(&mut *(self as *mut PortableTexEngine<'_>)).zfreenode(q, 4 as i32);
}
}
q = (&mut *(self as *mut PortableTexEngine<'_>)).zgetnode(4 as i32)?;
(*mem.offset(q as isize)).hh.v.RH = p;
(*mem.offset(q as isize)).hh.u.B0 = l_0 as i16;
(*mem.offset(q as isize)).hh.u.B1 = (4 as i32 * s as i32 + r as i32) as i16;
(*mem.offset((q as i32 + 1 as i32) as isize)).u.CINT = e;
(*mem.offset((q as i32 + 2 as i32) as isize)).u.CINT = t;
(*mem.offset((q as i32 + 3 as i32) as isize)).u.CINT = n;
p = q;
l_0 = o;
}
self.state.expanddepthcount -= 1;
if b != 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(66663 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66949 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66665 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).error()?;
if l_0 as i32 >= 2 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).zdeleteglueref(e);
e = self.state.membot;
let ref mut fresh77 = (*mem.offset(e as isize)).hh.v.RH;
*fresh77 += 1;
} else {
e = 0 as i32 as integer;
}
}
self.state.aritherror = a;
self.state.curval = e;
self.state.curvallevel = l_0 as eightbits;
Ok(())
}
pub(crate) unsafe fn scanfifteenbitint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 32767 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(66055 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66056 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanfilename(&mut self) -> EngineFlow<()> {
let mut savewarningindex: halfword = 0;
self.state.nameinprogress = true_0 as boolean;
savewarningindex = self.state.warningindex;
self.state.warningindex = self.state.curcs;
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
if self.state.curcmd as i32 == 1 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).scanfilenamebraced()?;
self.state.nameinprogress = false_0 as boolean;
} else {
self.state.nameinprogress = true_0 as boolean;
(&mut *(self as *mut PortableTexEngine<'_>)).beginname();
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
loop {
if self.state.curcmd as i32 > 12 as i32
|| self.state.curchr as i64 > 1114111 as i64
{
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
break;
} else {
if (&mut *(self as *mut PortableTexEngine<'_>))
.zmorename(self.state.curchr)? == 0
{
break;
}
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
}
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).endname()?;
self.state.nameinprogress = false_0 as boolean;
self.state.warningindex = savewarningindex;
Ok(())
}
pub(crate) unsafe fn scanfilenamebraced(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut savescannerstatus: smallnumber = 0;
let mut savedefref: halfword = 0;
let mut savecurcs: halfword = 0;
let mut s: strnumber = 0;
let mut p: halfword = 0;
let mut i: integer = 0;
let mut savestopatspace: boolean = 0;
let mut dummy: boolean = 0;
savescannerstatus = self.state.scannerstatus as smallnumber;
savedefref = self.state.defref;
savecurcs = self.state.curcs;
self.state.curcs = self.state.warningindex;
(&mut *(self as *mut PortableTexEngine<'_>)).zscantoks(0 as i32, 1 as i32)?;
self.state.oldsetting = self.state.selector;
self.state.selector = 21 as eightbits;
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowtokenlist(
(*mem.offset(self.state.defref as isize)).hh.v.RH,
-(268435455 as i64) as integer,
self.state.poolsize as poolpointer - self.state.poolptr,
);
self.state.selector = self.state.oldsetting;
s = (&mut *(self as *mut PortableTexEngine<'_>)).makestring()?;
(&mut *(self as *mut PortableTexEngine<'_>)).zdeletetokenref(self.state.defref);
self.state.defref = savedefref;
self.state.curcs = savecurcs;
self.state.scannerstatus = savescannerstatus as eightbits;
savestopatspace = self.state.stopatspace;
self.state.stopatspace = false_0 as boolean;
(&mut *(self as *mut PortableTexEngine<'_>)).beginname();
let mut for_end: integer = 0;
i = *self.state.strstart.offset((s as i64 - 65536 as i64) as isize) as integer;
for_end = (*self
.state
.strstart
.offset(((s as i32 + 1 as i32) as i64 - 65536 as i64) as isize) as i32
- 1 as i32) as integer;
if i <= for_end {
loop {
dummy = (&mut *(self as *mut PortableTexEngine<'_>))
.zmorename(*self.state.strpool.offset(i as isize) as UnicodeScalar)?;
let fresh74 = i;
i = i + 1;
if !(fresh74 < for_end) {
break;
}
}
}
self.state.stopatspace = savestopatspace;
Ok(())
}
pub(crate) unsafe fn scanfontident(&mut self) -> EngineFlow<()> {
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut f_0: internalfontnumber = 0;
let mut m: halfword = 0;
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
if self.state.curcmd as i32 == 90 as i32 {
f_0 = (*eqtb.offset(1206823 as i64 as isize)).hh.v.RH as internalfontnumber;
} else if self.state.curcmd as i32 == 89 as i32 {
f_0 = self.state.curchr as internalfontnumber;
} else if self.state.curcmd as i32 == 88 as i32 {
m = self.state.curchr;
(&mut *(self as *mut PortableTexEngine<'_>)).scanmathfamint()?;
f_0 = (*eqtb.offset((m as integer + self.state.curval) as isize)).hh.v.RH
as internalfontnumber;
} 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(66215 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66216 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66217 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
f_0 = 0 as i32 as internalfontnumber;
}
self.state.curval = f_0 as integer;
Ok(())
}
pub(crate) unsafe fn scanfourbitint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 15 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(66053 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66054 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanfourbitintor18(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32
|| self.state.curval > 15 as i32 && self.state.curval != 18 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(66053 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66054 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scangeneraltext(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut s: eightbits = 0;
let mut w: halfword = 0;
let mut d: halfword = 0;
let mut p: halfword = 0;
let mut q: halfword = 0;
let mut unbalance: halfword = 0;
s = self.state.scannerstatus;
w = self.state.warningindex;
d = self.state.defref;
self.state.scannerstatus = 5 as eightbits;
self.state.warningindex = self.state.curcs;
self.state.defref = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
(*mem.offset(self.state.defref as isize)).hh.v.LH = -(268435455 as i64)
as halfword;
p = self.state.defref;
(&mut *(self as *mut PortableTexEngine<'_>)).scanleftbrace()?;
unbalance = 1 as i32 as halfword;
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
if (self.state.curtok as i64) < 6291456 as i64 {
if (self.state.curcmd as i32) < 2 as i32 {
unbalance += 1;
} else {
unbalance -= 1;
if unbalance == 0 as i32 {
break;
}
}
}
q = (&mut *(self as *mut PortableTexEngine<'_>)).getavail()?;
(*mem.offset(p as isize)).hh.v.RH = q;
(*mem.offset(q as isize)).hh.v.LH = self.state.curtok;
p = q;
}
q = (*mem.offset(self.state.defref as isize)).hh.v.RH;
(*mem.offset(self.state.defref as isize)).hh.v.RH = self.state.avail;
self.state.avail = self.state.defref;
self.state.dynused -= 1;
if q as i64 == -(268435455 as i64) {
self.state.curval = (self.state.memtop as i32 - 3 as i32) as integer;
} else {
self.state.curval = p as integer;
}
(*mem.offset((self.state.memtop as i32 - 3 as i32) as isize)).hh.v.RH = q;
self.state.scannerstatus = s;
self.state.warningindex = w;
self.state.defref = d;
Ok(())
}
pub(crate) unsafe fn scanint(&mut self) -> EngineFlow<()> {
let mut current_block: u64;
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut negative: boolean = 0;
let mut m: integer = 0;
let mut d: smallnumber = 0;
let mut vacuous: boolean = 0;
let mut OKsofar: boolean = 0;
self.state.radix = 0 as smallnumber;
OKsofar = true_0 as boolean;
negative = false_0 as boolean;
loop {
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
if self.state.curtok as i64 == 25165869 as i64 {
negative = (negative == 0) as i32 as boolean;
self.state.curtok = 25165867 as i64 as halfword;
}
if self.state.curtok as i64 != 25165867 as i64 {
break;
}
}
loop {
if self.state.curtok as i64 == 25165920 as i64 {
(&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
if (self.state.curtok as i64) < 33554431 as i64 {
self.state.curval = self.state.curchr as integer;
if self.state.curcmd as i32 <= 2 as i32 {
if self.state.curcmd as i32 == 2 as i32 {
self.state.alignstate += 1;
} else {
self.state.alignstate -= 1;
}
}
} else if (self.state.curtok as i64) < 34668544 as i64 {
self.state.curval = (self.state.curtok as i64 - 33554432 as i64)
as integer;
} else if (self.state.curtok as i64) < 34734080 as i64 {
self.state.curval = (self.state.curtok as i64 - 34668544 as i64)
as integer;
} else {
m = (*self
.state
.hash
.offset((self.state.curtok as i64 - 33554431 as i64) as isize))
.v
.RH as integer;
if *self
.state
.strstart
.offset(((m as i32 + 1 as i32) as i64 - 65536 as i64) as isize)
== 2 as poolpointer
+ *self
.state
.strstart
.offset((m as i64 - 65536 as i64) as isize)
{
m = *self
.state
.strstart
.offset((m as i64 - 65536 as i64) as isize) as integer;
if *self.state.strpool.offset(m as isize) as i64 >= 55296 as i64
&& *self.state.strpool.offset(m as isize) as i64
<= 56319 as i64
&& *self.state.strpool.offset((m as i32 + 1 as i32) as isize)
as i64 >= 56320 as i64
&& *self.state.strpool.offset((m as i32 + 1 as i32) as isize)
as i64 <= 57343 as i64
{
self.state.curval = (65536 as i64
+ (*self.state.strpool.offset(m as isize) as i64
- 55296 as i64) * 1024 as i64
+ *self.state.strpool.offset((m as i32 + 1 as i32) as isize)
as i64 - 56320 as i64) as integer;
} else {
self.state.curval = 1114112 as i64 as integer;
}
} else {
self.state.curval = 1114112 as i64 as integer;
}
}
if self.state.curval as i64 > 1114111 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(66059 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66060 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66061 as i64 as strnumber;
self.state.curval = 48 as i32 as integer;
(&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
} else {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
}
}
current_block = 14483658890531361756;
break;
} else if self.state.curtok as i64 == 34749092 as i64 {
(&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
if (self.state.curcs as i64) < 1179650 as i64 {
self.state.curcs = (&mut *(self as *mut PortableTexEngine<'_>))
.zprimlookup(
(self.state.curcs as i64 - 1114113 as i64) as strnumber,
)?;
} else {
self.state.curcs = (&mut *(self as *mut PortableTexEngine<'_>))
.zprimlookup(
(*self.state.hash.offset(self.state.curcs as isize)).v.RH,
)?;
}
if self.state.curcs != 0 as i32 {
self.state.curcmd = (*eqtb
.offset((1194662 as i64 + self.state.curcs as i64) as isize))
.hh
.u
.B0 as eightbits;
self.state.curchr = (*eqtb
.offset((1194662 as i64 + self.state.curcs as i64) as isize))
.hh
.v
.RH;
self.state.curcs = (1194662 as i64 + self.state.curcs as i64)
as halfword;
self.state.curtok = (33554431 as i64 + self.state.curcs as i64)
as halfword;
} else {
self.state.curcmd = 0 as eightbits;
self.state.curchr = 0 as i32 as halfword;
self.state.curtok = 34749088 as i64 as halfword;
self.state.curcs = 1194657 as i64 as halfword;
}
} else if self.state.curcmd as i32 >= 68 as i32
&& self.state.curcmd as i32 <= 91 as i32
{
current_block = 5235537862154438448;
break;
} else {
current_block = 6560072651652764009;
break;
}
}
match current_block {
6560072651652764009 => {
self.state.radix = 10 as smallnumber;
m = 214748364 as i64 as integer;
if self.state.curtok as i64 == 25165863 as i64 {
self.state.radix = 8 as smallnumber;
m = 268435456 as i64 as integer;
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
} else if self.state.curtok as i64 == 25165858 as i64 {
self.state.radix = 16 as smallnumber;
m = 134217728 as i64 as integer;
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
}
vacuous = true_0 as boolean;
self.state.curval = 0 as i32 as integer;
loop {
if (self.state.curtok as i64)
< 25165872 as i64 + self.state.radix as i64
&& self.state.curtok as i64 >= 25165872 as i64
&& self.state.curtok as i64 <= 25165881 as i64
{
d = (self.state.curtok as i64 - 25165872 as i64) as smallnumber;
} else {
if !(self.state.radix as i32 == 16 as i32) {
break;
}
if self.state.curtok as i64 <= 23068742 as i64
&& self.state.curtok as i64 >= 23068737 as i64
{
d = (self.state.curtok as i64 - 23068727 as i64)
as smallnumber;
} else {
if !(self.state.curtok as i64 <= 25165894 as i64
&& self.state.curtok as i64 >= 25165889 as i64)
{
break;
}
d = (self.state.curtok as i64 - 25165879 as i64)
as smallnumber;
}
}
vacuous = false_0 as boolean;
if self.state.curval >= m
&& (self.state.curval > m || d as i32 > 7 as i32
|| self.state.radix as i32 != 10 as i32)
{
if OKsofar != 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(66062 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66063 as i64
as strnumber;
self.state.helpline[0 as i32 as usize] = 66064 as i64
as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).error()?;
self.state.curval = 2147483647 as i64 as integer;
OKsofar = false_0 as boolean;
}
} else {
self.state.curval = (self.state.curval as i32
* self.state.radix as i32 + d as i32) as integer;
}
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
}
if vacuous != 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(66008 as i64 as integer);
self.state.helpptr = 3 as eightbits;
self.state.helpline[2 as i32 as usize] = 66009 as i64 as strnumber;
self.state.helpline[1 as i32 as usize] = 66010 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66011 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
} else if self.state.curcmd as i32 != 10 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
}
}
5235537862154438448 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zscansomethinginternal(0 as i32 as smallnumber, 0 as i32)?;
}
_ => {}
}
Ok(
if negative != 0 {
self.state.curval = -self.state.curval;
},
)
}
pub(crate) unsafe fn scanleftbrace(&mut self) -> EngineFlow<()> {
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;
}
}
Ok(
if self.state.curcmd as i32 != 1 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(65990 as i64 as integer);
self.state.helpptr = 4 as eightbits;
self.state.helpline[3 as i32 as usize] = 65991 as i64 as strnumber;
self.state.helpline[2 as i32 as usize] = 65992 as i64 as strnumber;
self.state.helpline[1 as i32 as usize] = 65993 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 65994 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>)).backerror()?;
self.state.curtok = 2097275 as i64 as halfword;
self.state.curcmd = 1 as eightbits;
self.state.curchr = 123 as i32 as halfword;
self.state.alignstate += 1;
},
)
}
pub(crate) unsafe fn scanmathclassint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 7 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(66049 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66050 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanmathfamint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > 255 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(66051 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66052 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanmuglue(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).zscanglue(3 as i32 as smallnumber)?;
Ok(())
}
pub(crate) unsafe fn scannormalglue(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).zscanglue(2 as i32 as smallnumber)?;
Ok(())
}
pub(crate) unsafe fn scanoptionalequals(&mut self) -> EngineFlow<()> {
loop {
(&mut *(self as *mut PortableTexEngine<'_>)).getxtoken()?;
if self.state.curcmd as i32 != 10 as i32 {
break;
}
}
Ok(
if self.state.curtok as i64 != 25165885 as i64 {
(&mut *(self as *mut PortableTexEngine<'_>)).backinput()?;
},
)
}
pub(crate) unsafe fn scanpdfexttoks(&mut self) -> EngineFlow<()> {
Self::record_stripped_pdf_extension(self as *mut PortableTexEngine<'_>);
let _ = (&mut *(self as *mut PortableTexEngine<'_>))
.zscantoks(0 as i32, 1 as i32)? != 0 as i32;
Ok(())
}
pub(crate) unsafe fn scanregisternum(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval > self.state.maxregnum {
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(66039 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = self.state.maxreghelpline;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanrulespec(&mut self) -> EngineFlow<halfword> {
let mut Result: halfword = 0;
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut q: halfword = 0;
q = (&mut *(self as *mut PortableTexEngine<'_>)).newrule()?;
if self.state.curcmd as i32 == 35 as i32 {
(*mem.offset((q as i32 + 1 as i32) as isize)).u.CINT = 26214 as i32
as integer;
} else {
(*mem.offset((q as i32 + 3 as i32) as isize)).u.CINT = 26214 as i32
as integer;
(*mem.offset((q as i32 + 2 as i32) as isize)).u.CINT = 0 as i32 as integer;
}
loop {
if (&mut *(self as *mut PortableTexEngine<'_>))
.zscankeyword(66093 as i64 as strnumber)? != 0
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zscandimen(0 as i32, 0 as i32, 0 as i32)?;
(*mem.offset((q as i32 + 1 as i32) as isize)).u.CINT = self.state.curval;
} else if (&mut *(self as *mut PortableTexEngine<'_>))
.zscankeyword(66094 as i64 as strnumber)? != 0
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zscandimen(0 as i32, 0 as i32, 0 as i32)?;
(*mem.offset((q as i32 + 3 as i32) as isize)).u.CINT = self.state.curval;
} else {
if !((&mut *(self as *mut PortableTexEngine<'_>))
.zscankeyword(66095 as i64 as strnumber)? != 0)
{
break;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zscandimen(0 as i32, 0 as i32, 0 as i32)?;
(*mem.offset((q as i32 + 2 as i32) as isize)).u.CINT = self.state.curval;
}
}
Result = q;
return Ok(Result);
}
pub(crate) unsafe fn scanusvnum(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if self.state.curval < 0 as i32 || self.state.curval as i64 > 1114111 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(66041 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66042 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn scanxetexmathcharint(&mut self) -> EngineFlow<()> {
(&mut *(self as *mut PortableTexEngine<'_>)).scanint()?;
Ok(
if (self.state.curval as u32 & 0x1fffff as i32 as u32) as i64
== 2097151 as i64
{
if self.state.curval as i64 != 2097151 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(66044 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66045 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66046 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 2097151 as i64 as integer;
}
} else if (self.state.curval as u32 & 0x1fffff as i32 as u32) as i64
> 1114111 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(66047 as i64 as integer);
self.state.helpptr = 2 as eightbits;
self.state.helpline[1 as i32 as usize] = 66048 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66005 as i64 as strnumber;
(&mut *(self as *mut PortableTexEngine<'_>))
.zinterror(self.state.curval)?;
self.state.curval = 0 as i32 as integer;
},
)
}
pub(crate) unsafe fn shiftcase(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut b: halfword = 0;
let mut p: halfword = 0;
let mut t: halfword = 0;
let mut c_0: integer = 0;
b = self.state.curchr;
p = (&mut *(self as *mut PortableTexEngine<'_>)).zscantoks(0 as i32, 0 as i32)?;
p = (*mem.offset(self.state.defref as isize)).hh.v.RH;
while p as i64 != -(268435455 as i64) {
t = (*mem.offset(p as isize)).hh.v.LH;
if (t as i64) < 34668544 as i64 {
c_0 = (t as i64 % 2097152 as i64) as integer;
if (*eqtb.offset((b as integer + c_0) as isize)).hh.v.RH != 0 as i32 {
(*mem.offset(p as isize)).hh.v.LH = t - c_0 as halfword
+ (*eqtb.offset((b as integer + c_0) as isize)).hh.v.RH;
}
}
p = (*mem.offset(p as isize)).hh.v.RH;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zbegintokenlist(
(*mem.offset(self.state.defref as isize)).hh.v.RH,
3 as i32 as quarterword,
)?;
(*mem.offset(self.state.defref as isize)).hh.v.RH = self.state.avail;
self.state.avail = self.state.defref;
self.state.dynused -= 1;
Ok(())
}
pub(crate) unsafe fn showactivities(&mut self) {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut p: integer = 0;
let mut m: i16 = 0;
let mut a: memoryword = memoryword { gr: 0. };
let mut q: halfword = 0;
let mut r: halfword = 0;
let mut t: integer = 0;
*self.state.nest.offset(self.state.nestptr as isize) = self.state.curlist;
(&mut *(self as *mut PortableTexEngine<'_>)).zprintnl(65626 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).println();
let mut for_end: integer = 0;
p = self.state.nestptr;
for_end = 0 as i32 as integer;
if p >= for_end {
loop {
m = (*self.state.nest.offset(p as isize)).modefield;
a = (*self.state.nest.offset(p as isize)).auxfield;
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65661 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintmode(m as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65662 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
if (*self.state.nest.offset(p as isize)).mlfield >= 0 as i32 {
(*self.state.nest.offset(p as isize)).mlfield
} else {
-(*self.state.nest.offset(p as isize)).mlfield
},
);
if m as i32 == 105 as i32 {
if (*self.state.nest.offset(p as isize)).pgfield as i64
!= 8585216 as i64
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65663 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
((*self.state.nest.offset(p as isize)).pgfield as i64
% 65536 as i64) as integer,
);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65664 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
((*self.state.nest.offset(p as isize)).pgfield as i64
/ 4194304 as i64) as integer,
);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(44 as i32);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
((*self.state.nest.offset(p as isize)).pgfield as i64
/ 65536 as i64 % 64 as i64) as integer,
);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(41 as i32);
}
}
if (*self.state.nest.offset(p as isize)).mlfield < 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65665 as i64 as integer);
}
if p == 0 as i32 {
if self.state.memtop as i32 - 2 as i32 != self.state.pagetail {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66416 as i64 as strnumber);
if self.state.outputactive != 0 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66417 as i64 as integer);
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowbox(
(*mem
.offset((self.state.memtop as i32 - 2 as i32) as isize))
.hh
.v
.RH,
);
if self.state.pagecontents as i32 > 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66418 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).printtotals();
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66419 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintscaled(self.state.pagesofar[0 as i32 as usize]);
r = (*mem.offset(self.state.memtop as isize)).hh.v.RH;
while r != self.state.memtop {
(&mut *(self as *mut PortableTexEngine<'_>)).println();
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65618 as i64 as strnumber);
t = (*mem.offset(r as isize)).hh.u.B1 as integer;
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(t);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66420 as i64 as integer);
if (*eqtb.offset((7892351 as i64 + t as i64) as isize))
.u
.CINT == 1000 as i32
{
t = (*mem.offset((r as i32 + 3 as i32) as isize)).u.CINT;
} else {
t = (&mut *(self as *mut PortableTexEngine<'_>))
.zxovern(
(*mem.offset((r as i32 + 3 as i32) as isize)).u.CINT,
1000 as i32,
) as integer
* (*eqtb.offset((7892351 as i64 + t as i64) as isize))
.u
.CINT;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintscaled(t);
if (*mem.offset(r as isize)).hh.u.B0 as i32 == 1 as i32 {
q = (self.state.memtop as i32 - 2 as i32) as halfword;
t = 0 as i32 as integer;
loop {
q = (*mem.offset(q as isize)).hh.v.RH;
if (*mem.offset(q as isize)).hh.u.B0 as i32 == 3 as i32
&& (*mem.offset(q as isize)).hh.u.B1 as i32
== (*mem.offset(r as isize)).hh.u.B1 as i32
{
t += 1;
}
if q
== (*mem.offset((r as i32 + 1 as i32) as isize)).hh.v.LH
{
break;
}
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66421 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(t);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66422 as i64 as integer);
}
r = (*mem.offset(r as isize)).hh.v.RH;
}
}
}
if (*mem.offset((self.state.memtop as i32 - 1 as i32) as isize))
.hh
.v
.RH as i64 != -(268435455 as i64)
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65666 as i64 as strnumber);
}
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowbox(
(*mem
.offset(
(*self.state.nest.offset(p as isize)).headfield as isize,
))
.hh
.v
.RH,
);
match (if m as integer >= 0 as i32 { m as i32 } else { -(m as i32) })
/ 104 as i32
{
0 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65667 as i64 as strnumber);
if a.u.CINT as i64 <= -(65536000 as i64) {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65668 as i64 as integer);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintscaled(a.u.CINT);
}
if (*self.state.nest.offset(p as isize)).pgfield != 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65669 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint((*self.state.nest.offset(p as isize)).pgfield);
if (*self.state.nest.offset(p as isize)).pgfield != 1 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65670 as i64 as integer);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65671 as i64 as integer);
}
}
}
1 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65672 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(a.hh.v.LH);
if m as i32 > 0 as i32 {
if a.hh.v.RH > 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65673 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(a.hh.v.RH);
}
}
}
2 => {
if a.u.CINT as i64 != -(268435455 as i64) {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65674 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowbox(a.u.CINT);
}
}
_ => {}
}
let fresh56 = p;
p = p - 1;
if !(fresh56 > for_end) {
break;
}
}
}
}
pub(crate) unsafe fn showcontext(&mut self) {
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 nn: integer = 0;
let mut bottomline: boolean = 0;
let mut i: integer = 0;
let mut j: integer = 0;
let mut l_0: integer = 0;
let mut m: integer = 0;
let mut n: integer = 0;
let mut p: integer = 0;
let mut q: integer = 0;
self.state.baseptr = self.state.inputptr;
*self.state.inputstack.offset(self.state.baseptr as isize) = self.state.curinput;
nn = -(1 as i32) as integer;
bottomline = false_0 as boolean;
loop {
self.state.curinput = *self
.state
.inputstack
.offset(self.state.baseptr as isize);
if self.state.curinput.statefield as i32 != 0 as i32 {
if self.state.curinput.namefield > 19 as i32
|| self.state.baseptr == 0 as i32
{
bottomline = true_0 as boolean;
}
}
if self.state.baseptr == self.state.inputptr || bottomline != 0
|| nn < (*eqtb.offset(7892318 as i64 as isize)).u.CINT
{
if self.state.baseptr == self.state.inputptr
|| self.state.curinput.statefield as i32 != 0 as i32
|| self.state.curinput.indexfield as i32 != 3 as i32
|| self.state.curinput.locfield as i64 != -(268435455 as i64)
{
self.state.tally = 0 as i32 as integer;
oldsetting_0 = self.state.selector;
if self.state.curinput.statefield as i32 != 0 as i32 {
if self.state.curinput.namefield <= 17 as i32 {
if self.state.curinput.namefield == 0 as i32 {
if self.state.baseptr == 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65900 as i64 as strnumber);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65901 as i64 as strnumber);
}
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65902 as i64 as strnumber);
if self.state.curinput.namefield == 17 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(42 as i32);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(self.state.curinput.namefield as i32 - 1 as i32);
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(62 as i32);
}
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65903 as i64 as strnumber);
if self.state.curinput.indexfield as i32 == self.state.inopen
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(self.state.line);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
*self
.state
.linestack
.offset(
(self.state.curinput.indexfield as i32 + 1 as i32) as isize,
),
);
}
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(32 as i32);
l_0 = self.state.tally;
self.state.tally = 0 as i32 as integer;
self.state.selector = 20 as eightbits;
self.state.trickcount = 1000000 as i64 as integer;
if *self
.state
.buffer
.offset(self.state.curinput.limitfield as isize)
== (*eqtb.offset(7892312 as i64 as isize)).u.CINT
{
j = self.state.curinput.limitfield as integer;
} else {
j = (self.state.curinput.limitfield as i32 + 1 as i32)
as integer;
}
if j > 0 as i32 {
let mut for_end: integer = 0;
i = self.state.curinput.startfield as integer;
for_end = (j as i32 - 1 as i32) as integer;
if i <= for_end {
loop {
if i == self.state.curinput.locfield {
self.state.firstcount = self.state.tally;
self.state.trickcount = self.state.tally + 1 as integer
+ self.state.errorline - self.state.halferrorline;
if self.state.trickcount < self.state.errorline {
self.state.trickcount = self.state.errorline;
}
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(*self.state.buffer.offset(i as isize));
let fresh18 = i;
i = i + 1;
if !(fresh18 < for_end) {
break;
}
}
}
}
} else {
match self.state.curinput.indexfield as i32 {
0 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65904 as i64 as strnumber);
}
1 | 2 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65905 as i64 as strnumber);
}
3 | 4 => {
if self.state.curinput.locfield as i64
== -(268435455 as i64)
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65906 as i64 as strnumber);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65907 as i64 as strnumber);
}
}
5 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65908 as i64 as strnumber);
}
6 => {
(&mut *(self as *mut PortableTexEngine<'_>)).println();
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcs(self.state.curinput.namefield);
}
7 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65909 as i64 as strnumber);
}
8 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65910 as i64 as strnumber);
}
9 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65911 as i64 as strnumber);
}
10 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65912 as i64 as strnumber);
}
11 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65913 as i64 as strnumber);
}
12 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65914 as i64 as strnumber);
}
13 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65915 as i64 as strnumber);
}
14 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65916 as i64 as strnumber);
}
15 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65917 as i64 as strnumber);
}
16 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65918 as i64 as strnumber);
}
17 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65919 as i64 as strnumber);
}
18 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65920 as i64 as strnumber);
}
_ => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(63 as i32);
}
}
l_0 = self.state.tally;
self.state.tally = 0 as i32 as integer;
self.state.selector = 20 as eightbits;
self.state.trickcount = 1000000 as i64 as integer;
if (self.state.curinput.indexfield as i32) < 6 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowtokenlist(
self.state.curinput.startfield,
self.state.curinput.locfield,
100000 as i64 as integer,
);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zshowtokenlist(
(*mem.offset(self.state.curinput.startfield as isize))
.hh
.v
.RH,
self.state.curinput.locfield,
100000 as i64 as integer,
);
}
}
self.state.selector = oldsetting_0;
if self.state.trickcount as i64 == 1000000 as i64 {
self.state.firstcount = self.state.tally;
self.state.trickcount = self.state.tally + 1 as integer
+ self.state.errorline - self.state.halferrorline;
if self.state.trickcount < self.state.errorline {
self.state.trickcount = self.state.errorline;
}
}
if self.state.tally < self.state.trickcount {
m = self.state.tally - self.state.firstcount;
} else {
m = self.state.trickcount - self.state.firstcount;
}
if l_0 + self.state.firstcount <= self.state.halferrorline {
p = 0 as i32 as integer;
n = l_0 + self.state.firstcount;
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65557 as i64 as integer);
p = (l_0 as i32 + self.state.firstcount as i32
- self.state.halferrorline as i32 + 3 as i32) as integer;
n = self.state.halferrorline;
}
let mut for_end_0: integer = 0;
q = p;
for_end_0 = (self.state.firstcount as i32 - 1 as i32) as integer;
if q <= for_end_0 {
loop {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(
self.state.trickbuf[(q % self.state.errorline) as usize],
);
let fresh19 = q;
q = q + 1;
if !(fresh19 < for_end_0) {
break;
}
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).println();
let mut for_end_1: integer = 0;
q = 1 as i32 as integer;
for_end_1 = n;
if q <= for_end_1 {
loop {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintrawchar(32 as i32, 1 as i32);
let fresh20 = q;
q = q + 1;
if !(fresh20 < for_end_1) {
break;
}
}
}
if m + n <= self.state.errorline {
p = self.state.firstcount + m;
} else {
p = (self.state.firstcount as i32
+ (self.state.errorline as i32 - n as i32 - 3 as i32))
as integer;
}
let mut for_end_2: integer = 0;
q = self.state.firstcount;
for_end_2 = (p as i32 - 1 as i32) as integer;
if q <= for_end_2 {
loop {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(
self.state.trickbuf[(q % self.state.errorline) as usize],
);
let fresh21 = q;
q = q + 1;
if !(fresh21 < for_end_2) {
break;
}
}
}
if m + n > self.state.errorline {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65557 as i64 as integer);
}
nn += 1;
}
} else if nn == (*eqtb.offset(7892318 as i64 as isize)).u.CINT {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65557 as i64 as strnumber);
nn += 1;
}
if bottomline != 0 {
break;
}
self.state.baseptr -= 1;
}
self.state.curinput = *self
.state
.inputstack
.offset(self.state.inputptr as isize);
}
pub(crate) unsafe fn showcurcmdchr(&mut self) {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let eqtb = self.state.zeqtb.as_mut_ptr();
let mut n: integer = 0;
let mut l_0: integer = 0;
let mut p: halfword = 0;
(&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
(&mut *(self as *mut PortableTexEngine<'_>)).zprintnl(123 as i32);
if self.state.curlist.modefield as i32 != self.state.shownmode as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintmode(self.state.curlist.modefield as integer);
(&mut *(self as *mut PortableTexEngine<'_>)).zprint(65593 as i64 as integer);
self.state.shownmode = self.state.curlist.modefield;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(self.state.curcmd as quarterword, self.state.curchr);
if (*eqtb.offset(7892327 as i64 as isize)).u.CINT > 0 as i32 {
if self.state.curcmd as i32 >= 108 as i32 {
if self.state.curcmd as i32 <= 109 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65593 as i64 as integer);
if self.state.curcmd as i32 == 109 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(
108 as i32 as quarterword,
self.state.curif as halfword,
);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(32 as i32);
n = 0 as i32 as integer;
l_0 = self.state.ifline;
} else {
n = 1 as i32 as integer;
l_0 = self.state.line;
}
p = self.state.condptr;
while p as i64 != -(268435455 as i64) {
n += 1;
p = (*mem.offset(p as isize)).hh.v.RH;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65895 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(n);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(41 as i32);
if l_0 != 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66903 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(l_0);
}
}
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(125 as i32);
(&mut *(self as *mut PortableTexEngine<'_>)).zenddiagnostic(0 as i32);
}
pub(crate) unsafe fn showinfo(&mut self) {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
(&mut *(self as *mut PortableTexEngine<'_>))
.zshownodelist((*mem.offset(self.state.tempptr as isize)).hh.v.LH);
}
pub(crate) unsafe fn showsavegroups(&mut self) {
let mut current_block: u64;
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut p: integer = 0;
let mut m: i16 = 0;
let mut v: savepointer = 0;
let mut l_0: quarterword = 0;
let mut c_0: groupcode = 0;
let mut a: schar = 0;
let mut i: integer = 0;
let mut j: quarterword = 0;
let mut s: strnumber = 0;
p = self.state.nestptr;
*self.state.nest.offset(p as isize) = self.state.curlist;
v = self.state.saveptr as savepointer;
l_0 = self.state.curlevel;
c_0 = self.state.curgroup;
self.state.saveptr = self.state.curboundary;
self.state.curlevel = self.state.curlevel.wrapping_sub(1);
a = 1 as schar;
(&mut *(self as *mut PortableTexEngine<'_>)).zprintnl(65626 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).println();
loop {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65661 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintgroup(1 as i32);
if self.state.curgroup as i32 == 0 as i32 {
break;
}
loop {
m = (*self.state.nest.offset(p as isize)).modefield;
if p > 0 as i32 {
p -= 1;
} else {
m = 1 as i16;
}
if m as i32 != 105 as i32 {
break;
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).zprint(65566 as i64 as integer);
match self.state.curgroup as i32 {
1 => {
p += 1;
current_block = 1401548034602982222;
}
2 | 3 => {
s = 66494 as i64 as strnumber;
current_block = 777662472977924419;
}
4 => {
s = 66403 as i64 as strnumber;
current_block = 777662472977924419;
}
5 => {
s = 66493 as i64 as strnumber;
current_block = 777662472977924419;
}
6 => {
if a as i32 == 0 as i32 {
if m as i32 == -(1 as i32) {
s = 65835 as i64 as strnumber;
} else {
s = 65862 as i64 as strnumber;
}
a = 1 as schar;
current_block = 18335036170494021261;
} else {
if a as i32 == 1 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66898 as i64 as integer);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(66327 as i64 as strnumber);
}
if p >= a as i32 {
p = (p as i32 - a as i32) as integer;
}
a = 0 as schar;
current_block = 845888875897272344;
}
}
7 => {
p += 1;
a = -(1 as i32) as schar;
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65848 as i64 as strnumber);
current_block = 1401548034602982222;
}
8 => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65698 as i64 as strnumber);
current_block = 845888875897272344;
}
9 => {
current_block = 1401548034602982222;
}
10 | 13 => {
if self.state.curgroup as i32 == 10 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65639 as i64 as strnumber);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65846 as i64 as strnumber);
}
let mut for_end: integer = 0;
i = 1 as i32 as integer;
for_end = 3 as i32 as integer;
if i <= for_end {
loop {
if i
<= (*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66270 as i64 as integer);
}
let fresh154 = i;
i = i + 1;
if !(fresh154 < for_end) {
break;
}
}
}
current_block = 1401548034602982222;
}
11 => {
if (*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT == 255 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65642 as i64 as strnumber);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65618 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(
(*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT,
);
}
current_block = 1401548034602982222;
}
12 => {
s = 65863 as i64 as strnumber;
current_block = 18335036170494021261;
}
14 => {
p += 1;
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65825 as i64 as strnumber);
current_block = 845888875897272344;
}
15 => {
if m as i32 == 209 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(36 as i32);
current_block = 5372832139739605200;
} else if (*self.state.nest.offset(p as isize)).modefield as i32
== 209 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(
48 as i32 as quarterword,
(*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT,
);
current_block = 845888875897272344;
} else {
current_block = 5372832139739605200;
}
match current_block {
845888875897272344 => {}
_ => {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(36 as i32);
current_block = 845888875897272344;
}
}
}
16 => {
if (*mem
.offset(
(*self.state.nest.offset((p as i32 + 1 as i32) as isize))
.eTeXauxfield as isize,
))
.hh
.u
.B0 as i32 == 30 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(66286 as i64 as strnumber);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(66288 as i64 as strnumber);
}
current_block = 845888875897272344;
}
_ => {
current_block = 777662472977924419;
}
}
match current_block {
777662472977924419 => {
i = (*self
.state
.savestack
.offset((self.state.saveptr as i32 - 4 as i32) as isize))
.u
.CINT;
if i != 0 as i32 {
if (i as i64) < 1073741824 as i64 {
if (if (*self.state.nest.offset(p as isize)).modefield
as integer >= 0 as i32
{
(*self.state.nest.offset(p as isize)).modefield as integer
} else {
-((*self.state.nest.offset(p as isize)).modefield as i32)
}) == 1 as i32
{
j = 21 as quarterword;
} else {
j = 22 as quarterword;
}
if i > 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(j, 0 as i32);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(j, 1 as i32);
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintscaled(if i >= 0 as i32 { i } else { -i });
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65697 as i64 as integer);
} else if (i as i64) < 1073807360 as i64 {
if i as i64 >= 1073774592 as i64 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(66611 as i64 as strnumber);
i = (i as i64 - 32768 as i64) as integer;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(65860 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint((i as i64 - 1073741824 as i64) as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(61 as i32);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(
31 as i32 as quarterword,
(i as i64 - 1073807261 as i64) as halfword,
);
}
}
current_block = 18335036170494021261;
}
_ => {}
}
match current_block {
18335036170494021261 => {
(&mut *(self as *mut PortableTexEngine<'_>)).zprintesc(s);
if (*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT != 0 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintchar(32 as i32);
if (*self
.state
.savestack
.offset((self.state.saveptr as i32 - 3 as i32) as isize))
.u
.CINT == 0 as i32
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66251 as i64 as integer);
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66252 as i64 as integer);
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintscaled(
(*self
.state
.savestack
.offset((self.state.saveptr as i32 - 2 as i32) as isize))
.u
.CINT,
);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65697 as i64 as integer);
}
current_block = 1401548034602982222;
}
_ => {}
}
match current_block {
1401548034602982222 => {
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(123 as i32);
}
_ => {}
}
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(41 as i32);
self.state.curlevel = self.state.curlevel.wrapping_sub(1);
self.state.curgroup = (*self
.state
.savestack
.offset(self.state.saveptr as isize))
.hh
.u
.B1 as groupcode;
self.state.saveptr = (*self
.state
.savestack
.offset(self.state.saveptr as isize))
.hh
.v
.RH as integer;
}
self.state.saveptr = v as integer;
self.state.curlevel = l_0;
self.state.curgroup = c_0;
}
pub(crate) unsafe fn showwhatever(&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 p: halfword = 0;
let mut t: smallnumber = 0;
let mut m: eightbits = 0;
let mut l_0: integer = 0;
let mut n: integer = 0;
match self.state.curchr {
3 => {
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
(&mut *(self as *mut PortableTexEngine<'_>)).showactivities();
current_block = 7858101417678297991;
}
1 => {
(&mut *(self as *mut PortableTexEngine<'_>)).scanregisternum()?;
if self.state.curval < 256 as i32 {
p = (*eqtb
.offset((1206567 as i64 + self.state.curval as i64) as isize))
.hh
.v
.RH;
} else {
(&mut *(self as *mut PortableTexEngine<'_>))
.zfindsaelement(
4 as i32 as smallnumber,
self.state.curval,
0 as i32,
)?;
if self.state.curptr as i64 == -(268435455 as i64) {
p = -(268435455 as i64) as halfword;
} else {
p = (*mem.offset((self.state.curptr as i32 + 1 as i32) as isize))
.hh
.v
.RH;
}
}
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66710 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintint(self.state.curval);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(61 as i32);
if p as i64 == -(268435455 as i64) {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65710 as i64 as integer);
} else {
(&mut *(self as *mut PortableTexEngine<'_>)).zshowbox(p);
}
current_block = 7858101417678297991;
}
0 => {
(&mut *(self as *mut PortableTexEngine<'_>)).gettoken()?;
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66706 as i64 as strnumber);
if self.state.curcs != 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zsprintcs(self.state.curcs);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintchar(61 as i32);
}
(&mut *(self as *mut PortableTexEngine<'_>)).printmeaning();
current_block = 12832942640950642081;
}
4 => {
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
(&mut *(self as *mut PortableTexEngine<'_>)).showsavegroups();
current_block = 7858101417678297991;
}
6 => {
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>)).begindiagnostic();
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65626 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).println();
if self.state.condptr as i64 == -(268435455 as i64) {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(65661 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66904 as i64 as integer);
} else {
p = self.state.condptr;
n = 0 as i32 as integer;
loop {
n += 1;
p = (*mem.offset(p as isize)).hh.v.RH;
if p as i64 == -(268435455 as i64) {
break;
}
}
p = self.state.condptr;
t = self.state.curif;
l_0 = self.state.ifline;
m = self.state.iflimit;
loop {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66905 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(n);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(65593 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintcmdchr(108 as i32 as quarterword, t as halfword);
if m as i32 == 2 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintesc(66167 as i64 as strnumber);
}
if l_0 != 0 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66903 as i64 as integer);
(&mut *(self as *mut PortableTexEngine<'_>)).zprintint(l_0);
}
n -= 1;
t = (*mem.offset(p as isize)).hh.u.B1 as smallnumber;
l_0 = (*mem.offset((p as i32 + 1 as i32) as isize)).u.CINT;
m = (*mem.offset(p as isize)).hh.u.B0 as eightbits;
p = (*mem.offset(p as isize)).hh.v.RH;
if p as i64 == -(268435455 as i64) {
break;
}
}
}
current_block = 7858101417678297991;
}
_ => {
p = (&mut *(self as *mut PortableTexEngine<'_>)).thetoks()?;
if (*eqtb.offset(7892324 as i64 as isize)).u.CINT >= 0 as i32
&& (*eqtb.offset(7892324 as i64 as isize)).u.CINT < 16 as i32
&& self
.state
.writeopen[(*eqtb.offset(7892324 as i64 as isize)).u.CINT
as usize] != 0
{
self.state.selector = (*eqtb.offset(7892324 as i64 as isize)).u.CINT
as eightbits;
}
(&mut *(self as *mut PortableTexEngine<'_>))
.zprintnl(66706 as i64 as strnumber);
(&mut *(self as *mut PortableTexEngine<'_>))
.ztokenshow(self.state.memtop as i32 - 3 as i32);
(&mut *(self as *mut PortableTexEngine<'_>))
.zflushlist(
(*mem.offset((self.state.memtop as i32 - 3 as i32) as isize))
.hh
.v
.RH,
);
current_block = 12832942640950642081;
}
}
match current_block {
7858101417678297991 => {
(&mut *(self as *mut PortableTexEngine<'_>)).zenddiagnostic(1 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(66711 as i64 as integer);
if self.state.selector as i32 == 19 as i32 {
if (*eqtb.offset(7892293 as i64 as isize)).u.CINT <= 0 as i32 {
self.state.selector = 17 as eightbits;
(&mut *(self as *mut PortableTexEngine<'_>))
.zprint(66712 as i64 as integer);
self.state.selector = 19 as eightbits;
}
}
}
_ => {}
}
if (self.state.selector as i32) < 16 as i32 {
(&mut *(self as *mut PortableTexEngine<'_>)).println();
if self.state.interaction as i32 == 0 as i32 {
self.state.selector = 16 as eightbits;
} else {
self.state.selector = 17 as eightbits;
}
if self.state.logopened != 0 {
self.state.selector = (self.state.selector as i32 + 2 as i32)
as eightbits;
}
} else {
if (self.state.interaction as i32) < 3 as i32 {
self.state.helpptr = 0 as eightbits;
self.state.errorcount -= 1;
} else if (*eqtb.offset(7892293 as i64 as isize)).u.CINT > 0 as i32 {
self.state.helpptr = 3 as eightbits;
self.state.helpline[2 as i32 as usize] = 66701 as i64 as strnumber;
self.state.helpline[1 as i32 as usize] = 66702 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66703 as i64 as strnumber;
} else {
self.state.helpptr = 5 as eightbits;
self.state.helpline[4 as i32 as usize] = 66701 as i64 as strnumber;
self.state.helpline[3 as i32 as usize] = 66702 as i64 as strnumber;
self.state.helpline[2 as i32 as usize] = 66703 as i64 as strnumber;
self.state.helpline[1 as i32 as usize] = 66704 as i64 as strnumber;
self.state.helpline[0 as i32 as usize] = 66705 as i64 as strnumber;
}
(&mut *(self as *mut PortableTexEngine<'_>)).error()?;
};
Ok(())
}
pub(crate) unsafe fn slowmakestring(&mut self) -> EngineFlow<strnumber> {
let mut Result: strnumber = 0;
let mut s: strnumber = 0;
let mut t: strnumber = 0;
t = (&mut *(self as *mut PortableTexEngine<'_>)).makestring()?;
s = (&mut *(self as *mut PortableTexEngine<'_>)).zsearchstring(t);
if s > 0 as i32 {
self.state.strptr -= 1;
self.state.poolptr = *self
.state
.strstart
.offset((self.state.strptr as i64 - 65536 as i64) as isize);
Result = s;
return Ok(Result);
}
Result = t;
return Ok(Result);
}
pub(crate) unsafe fn starteqno(&mut self) -> EngineFlow<()> {
let eqtb = self.state.zeqtb.as_mut_ptr();
(*self.state.savestack.offset((self.state.saveptr as i32 + 0 as i32) as isize))
.u
.CINT = self.state.curchr as integer;
self.state.saveptr += 1;
(&mut *(self as *mut PortableTexEngine<'_>)).zpushmath(15 as i32 as groupcode)?;
(&mut *(self as *mut PortableTexEngine<'_>))
.zeqworddefine(7892308 as i64 as halfword, -(1 as i32))?;
if self.state.insertsrcspecialeverymath != 0 {
(&mut *(self as *mut PortableTexEngine<'_>)).insertsrcspecial()?;
}
Ok(
if (*eqtb.offset(1206298 as i64 as isize)).hh.v.RH as i64
!= -(268435455 as i64)
{
(&mut *(self as *mut PortableTexEngine<'_>))
.zbegintokenlist(
(*eqtb.offset(1206298 as i64 as isize)).hh.v.RH,
9 as i32 as quarterword,
)?;
},
)
}
pub(crate) unsafe fn startinput(&mut self) -> EngineFlow<()> {
Self::sandbox_reject(
self as *mut PortableTexEngine<'_>,
"\\input is not allowed inside a math expression",
)?;
let eqtb = self.state.zeqtb.as_mut_ptr();
(&mut *(self as *mut PortableTexEngine<'_>)).scanfilename()?;
(&mut *(self as *mut PortableTexEngine<'_>))
.zpackfilename(self.state.curname, self.state.curarea, self.state.curext);
(&mut *(self as *mut PortableTexEngine<'_>)).beginfilereading()?;
if Self::boundary_open_input(
self as *mut PortableTexEngine<'_>,
self.state.inputfile.offset(self.state.curinput.indexfield as isize)
as *mut unicodefile,
resource_format_tex_input,
FOPEN_RBIN_MODE.as_ptr(),
) == 0
{
(&mut *(self as *mut PortableTexEngine<'_>)).endfilereading();
return Ok(());
}
self.state.curinput.namefield = self.state.curname as halfword;
*self.state.sourcefilenamestack.offset(self.state.inopen as isize) = self
.state
.curname;
*self.state.fullsourcefilenamestack.offset(self.state.inopen as isize) = self
.state
.curname;
self.state.curinput.statefield = NEW_LINE_STATE;
self.state.line = 1 as integer;
let _ = Self::boundary_input_line(
self as *mut PortableTexEngine<'_>,
*self.state.inputfile.offset(self.state.curinput.indexfield as isize)
as NativeFileHandle,
)? != 0;
(&mut *(self as *mut PortableTexEngine<'_>)).firmuptheline()?;
let endline_char = (*eqtb.offset(EQTB_END_LINE_CHAR_LOC as isize)).u.CINT;
if !(0..=255).contains(&endline_char) {
self.state.curinput.limitfield -= 1;
} else {
*self.state.buffer.offset(self.state.curinput.limitfield as isize) = endline_char
as UnicodeScalar;
}
self.state.first = (self.state.curinput.limitfield as i32 + 1) as integer;
self.state.curinput.locfield = self.state.curinput.startfield;
Ok(())
}
pub(crate) unsafe fn subsup(&mut self) -> EngineFlow<()> {
let mut mem: *mut memoryword = self.state.zmem.as_mut_ptr();
let mut t: smallnumber = 0;
let mut p: halfword = 0;
t = 0 as smallnumber;
p = -(268435455 as i64) as halfword;
if self.state.curlist.tailfield != self.state.curlist.headfield {
if (*mem.offset(self.state.curlist.tailfield as isize)).hh.u.B0 as i32
>= 16 as i32
&& ((*mem.offset(self.state.curlist.tailfield as isize)).hh.u.B0 as i32)
< 30 as i32
{
p = (self.state.curlist.tailfield as i32 + 2 as i32
+ self.state.curcmd as i32 - 7 as i32) as halfword;
t = (*mem.offset(p as isize)).hh.v.RH as smallnumber;
}
}
if p as i64 == -(268435455 as i64) || t as i32 != 0 as i32 {
(*mem.offset(self.state.curlist.tailfield as isize)).hh.v.RH = (&mut *(self
as *mut PortableTexEngine<'_>))
.newnoad()?;
self.state.curlist.tailfield = (*mem
.offset(self.state.curlist.tailfield as isize))
.hh
.v
.RH;
p = (self.state.curlist.tailfield as i32 + 2 as i32
+ self.state.curcmd as i32 - 7 as i32) as halfword;
if t as i32 != 0 as i32 {
if self.state.curcmd as i32 == 7 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(66580 as i64 as integer);
self.state.helpptr = 1 as eightbits;
self.state.helpline[0 as i32 as usize] = 66581 as i64 as strnumber;
} 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(66582 as i64 as integer);
self.state.helpptr = 1 as eightbits;
self.state.helpline[0 as i32 as usize] = 66583 as i64 as strnumber;
}
(&mut *(self as *mut PortableTexEngine<'_>)).error()?;
}
}
(&mut *(self as *mut PortableTexEngine<'_>)).zscanmath(p)?;
Ok(())
}
}