#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 %integer h, i, j, k
int H = 0xFEFEFEFE;
int I = 0xFEFEFEFE;
int J = 0xFEFEFEFE;
int K = 0xFEFEFEFE;
// 3 i = 1; j = 2; k = 3
I = 1;
J = 2;
K = 3;
// 4 %cycle h = i,j,k
// %for H = I, J, K %cycle
{
int _initial = I, _increment = J, _final = K;
if (invalid_for_loop(_initial, _increment, _final)) _imp_signal(5, 1, 0, "Illegal cycle H = I, J, K");
H = _initial - _increment;
L_0001:
if (H == _final) goto L_0002;
H += _increment;
// 5 %repeat
goto L_0001;
}
L_0002:;
// 6 %cycle h = i,1,k
// %for H = I, 1, K %cycle
{
int _initial = I, _final = K;
if (invalid_for_loop(_initial, 1, _final)) _imp_signal(5, 1, 0, "Illegal cycle H = I, 1, K");
H = _initial - (1);
L_0004:
if (H == _final) goto L_0005;
H += 1;
// 7 %repeat
goto L_0004;
}
L_0005:;
// 8 %cycle h = i,-1,k
// %for H = I, -1, K %cycle
{
int _initial = I, _final = K;
if (invalid_for_loop(_initial, -1, _final)) _imp_signal(5, 1, 0, "Illegal cycle H = I, -1, K");
H = _initial - (-1);
L_0006:
if (H == _final) goto L_0007;
H -= 1;
// 9 %repeat
goto L_0006;
}
L_0007:;
// 10 %cycle h = 1,1,3
// %for H = 1, 1, 3 %cycle
{
H = 0;
L_0008:
if (H == 3) goto L_0009;
H += 1;
// 11 %repeat
goto L_0008;
}
L_0009:;
// 12 %cycle h = 3,-1,1
// %for H = 3, -1, 1 %cycle
{
H = 4;
L_000A:
if (H == 1) goto L_000B;
H -= 1;
// 13 %repeat
goto L_000A;
}
L_000B:;
// 14 %cycle h = 1,1,k
// %for H = 1, 1, K %cycle
{
int _final = K;
if (invalid_for_loop(1, 1, _final)) _imp_signal(5, 1, 0, "Illegal cycle H = 1, 1, K");
H = 0;
L_000C:
if (H == _final) goto L_000D;
H += 1;
// 15 %repeat
goto L_000C;
}
L_000D:;
// 16 %cycle h = k,-1,1
// %for H = K, -1, 1 %cycle
{
int _initial = K;
if (invalid_for_loop(_initial, -1, 1)) _imp_signal(5, 1, 0, "Illegal cycle H = K, -1, 1");
H = _initial - (-1);
L_000E:
if (H == 1) goto L_000F;
H -= 1;
// 17 %repeat
goto L_000E;
}
L_000F:;
// 18 %cycle h = i,1,3
// %for H = I, 1, 3 %cycle
{
int _initial = I;
if (invalid_for_loop(_initial, 1, 3)) _imp_signal(5, 1, 0, "Illegal cycle H = I, 1, 3");
H = _initial - (1);
L_0010:
if (H == 3) goto L_0011;
H += 1;
// 19 %repeat
goto L_0010;
}
L_0011:;
// 20 %cycle h = i,-1,1
// %for H = I, -1, 1 %cycle
{
int _initial = I;
if (invalid_for_loop(_initial, -1, 1)) _imp_signal(5, 1, 0, "Illegal cycle H = I, -1, 1");
H = _initial - (-1);
L_0012:
if (H == 1) goto L_0013;
H -= 1;
// 21 %repeat
goto L_0012;
}
L_0013:;
// 22 %cycle h = 1,i,3
// %for H = 1, I, 3 %cycle
{
int _increment = I;
if (invalid_for_loop(1, _increment, 3)) _imp_signal(5, 1, 0, "Illegal cycle H = 1, I, 3");
H = 1 - _increment;
L_0014:
if (H == 3) goto L_0015;
H += _increment;
// 23 %repeat
goto L_0014;
}
L_0015:;
// 24 %cycle h = 1,i,k
// %for H = 1, I, K %cycle
{
int _increment = I, _final = K;
if (invalid_for_loop(1, _increment, _final)) _imp_signal(5, 1, 0, "Illegal cycle H = 1, I, K");
H = 1 - _increment;
L_0016:
if (H == _final) goto L_0017;
H += _increment;
// 25 %repeat
goto L_0016;
}
L_0017:;
// 26 %cycle h = i,j,3
// %for H = I, J, 3 %cycle
{
int _initial = I, _increment = J;
if (invalid_for_loop(_initial, _increment, 3)) _imp_signal(5, 1, 0, "Illegal cycle H = I, J, 3");
H = _initial - _increment;
L_0018:
if (H == 3) goto L_0019;
H += _increment;
// 27 %repeat
goto L_0018;
}
L_0019:;
// 28 %cycle h = i,-1,1
// %for H = I, -1, 1 %cycle
{
int _initial = I;
if (invalid_for_loop(_initial, -1, 1)) _imp_signal(5, 1, 0, "Illegal cycle H = I, -1, 1");
H = _initial - (-1);
L_001A:
if (H == 1) goto L_001B;
H -= 1;
// 29 %repeat
goto L_001A;
}
L_001B:;
// 30 %cycle h = 1,i,3
// %for H = 1, I, 3 %cycle
{
int _increment = I;
if (invalid_for_loop(1, _increment, 3)) _imp_signal(5, 1, 0, "Illegal cycle H = 1, I, 3");
H = 1 - _increment;
L_001C:
if (H == 3) goto L_001D;
H += _increment;
// 31 %repeat
goto L_001C;
}
L_001D:;
// 32 i = -1
I = -1;
// 33 %cycle h = 3,i,1
// %for H = 3, I, 1 %cycle
{
int _increment = I;
if (invalid_for_loop(3, _increment, 1)) _imp_signal(5, 1, 0, "Illegal cycle H = 3, I, 1");
H = 3 - _increment;
L_001E:
if (H == 1) goto L_001F;
H += _increment;
// 34 %repeat
goto L_001E;
}
L_001F:;
// 35 %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(H);
_imp_bt_int(I);
_imp_bt_int(J);
_imp_bt_int(K);
_imp_end_backtrace();
_imp_stop(0);
}