#include <perms.h>
// Edinburgh IMP77 Compiler - Version 8.4
//
// 1 %begin
int main(int argc, char **argv) { /*%begin*/
_imp_enter(main);
_imp_initialise(argc, argv);
// 2 %owninteger nextsym=4
static int NEXTSYM = 4;
// 3 %integer opd
int OPD = 0xFEFEFEFE;
// 4 opd=23
OPD = 23;
// 5 %unless 20<=opd<=nextsym+20 %then printstring(" bug1
{
int tmp;
if ((20) > (tmp = OPD)) goto L_0001;
// Double-sided test on OPD (Part II)
if (tmp <= (NEXTSYM + 20)) goto L_0002;
}
L_0001:;
_imp_printf("%s", " bug1 \n");
L_0002:;
// 6+ ")
// 7 %if 20<=opd<=nextsym+20 %then opd=opd %else printstring(" bug2
{
int tmp;
if ((20) > (tmp = OPD)) goto L_0003;
// Double-sided test on OPD (Part II)
if (tmp > (NEXTSYM + 20)) goto L_0003;
}
OPD = OPD;
goto L_0004;
L_0003:;
_imp_printf("%s", " bug2 \n");
L_0004:;
// 8+ ")
// 9 %unless opd>=20 %and opd<=nextsym+20 %then printstring(" bug3
if ((OPD) < (20)) goto L_0005;
if ((OPD) <= (NEXTSYM + 20)) goto L_0006;
L_0005:;
_imp_printf("%s", " bug3 \n");
L_0006:;
// 10+ ")
// 11
// 12 %endofprogram
_imp_stop(0);
end_0:;
_imp_begin_backtrace(main);
_imp_diagf("\n\nArguments:\n\n");
_imp_diagf("ARGC = %d\n", argc);
_imp_diagf("ARGV @[%p]\n", argv);
for (int i = 0; i < argc; i++) {
_imp_diagf(" ARGV(%d) = \"%s\"\n", i, argv[i]);
}
if (argv[argc] == 0) {
_imp_diagf(" ARGV(%d) = NULL\n", argc);
} else {
_imp_diagf(" ARGV(%d) = \"%s\"\n", argc, argv[argc]);
}
_imp_diagf("\nLocal Variables:\n\n");
_imp_bt_int(NEXTSYM);
_imp_bt_int(OPD);
_imp_end_backtrace();
_imp_stop(0);
}