int _C_DATA_SIZE = 8192;
#include "forth.h"
#include "forth2c.h"
Cells2 mybounds(Cell p0, Cell p1)
{
Cells2 _c_result;
Cell x0;
{
Cell n1, n2;
n2 = p0;
n1 = p1;
p1 = n1;
p0 = n2;
x0 = n1;
}
{
Cell n1, n2, n;
n1 = x0;
n2 = p0;
n = n2 + n1;
p0 = n;
}
{
Cell n1, n2;
n1 = p0;
n2 = p1;
p1 = n1;
p0 = n2;
}
{
_c_result.cell0 = p0;
_c_result.cell1 = p1;
return (_c_result);
}
}
Char seed[4];
void initiate_seed(void)
{
Cell x0;
Cell x1;
{
x0 = 74755;
}
{
x1 = (Cell) (&seed[0]);
}
{
Cell *a, n;
a = (Cell *) x1;
n = x0;
*a = n;
}
{
return;
}
}
Cell random(void)
{
Cell _c_result;
Cell x0;
Cell x1;
Cell x2;
{
x0 = (Cell) (&seed[0]);
}
{
Cell *a;
a = (Cell *) x0;
x0 = *a;
}
{
x1 = 1309;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 * n1;
x0 = n;
}
{
x1 = 13849;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 + n1;
x0 = n;
}
{
x1 = 65535;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 & n1;
x0 = n;
}
{
Cell n;
n = x0;
x0 = n;
x1 = n;
}
{
x2 = (Cell) (&seed[0]);
}
{
Cell *a, n;
a = (Cell *) x2;
n = x1;
*a = n;
}
{
_c_result = x0;
return (_c_result);
}
}
#define row_size 200
#define row_byte_size 800
#define mat_size 40000
#define mat_byte_size 160000
Char ima[160020];
Char imb[160020];
Char imr[160000];
void initiate_matrix(Cell p0)
{
Cell x0;
Cell x1;
Cell r0;
Cell r1;
{
x0 = (Cell) mat_byte_size;
}
{
Cells2 _C_locret;
_C_locret = mybounds(x0, p0);
p0 = _C_locret.cell1;
x0 = _C_locret.cell0;
}
{
Cell bound, index;
index = x0;
bound = p0;
r0 = bound;
r1 = index;
}
label0:
{
Cell _C_locret;
_C_locret = random();
p0 = _C_locret;
}
{
Cell n;
n = p0;
p0 = n;
x0 = n;
}
{
x1 = 120;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 / n1;
x0 = n;
}
{
x1 = 120;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 * n1;
x0 = n;
}
{
Cell n1, n2, n;
n1 = x0;
n2 = p0;
n = n2 - n1;
p0 = n;
}
{
x0 = 60;
}
{
Cell n1, n2, n;
n1 = x0;
n2 = p0;
n = n2 - n1;
p0 = n;
}
{
Cell n = r1;
x0 = n;
}
{
Cell *a, n;
a = (Cell *) x0;
n = p0;
*a = n;
}
{
p0 = sizeof(Cell);
}
{
Cell step, index, bound;
index = r1;
bound = r0;
step = p0;
index += step;
if ((step > 0 && index < bound) ||
(step <= 0 && index >= bound))
{
r0 = bound;
r1 = index;
goto label0;
}
}
{
}
{
return;
}
}
Cell innerproduct(Cell p0, Cell p1)
{
Cell _c_result;
Cell x0;
Cell x1;
Cell x2;
Cell r0;
Cell r1;
Cell r2;
{
x0 = 0;
}
{
x1 = (Cell) row_size;
}
{
x2 = 0;
}
{
Cell bound, index;
index = x2;
bound = x1;
r0 = bound;
r1 = index;
}
label0:
{
Cell n;
n = x0;
r2 = n;
}
{
Cell n1, n2;
n2 = p0;
n1 = p1;
p1 = n1;
p0 = n2;
x0 = n1;
}
{
Cell *a;
a = (Cell *) x0;
x0 = *a;
}
{
Cell n1, n2;
n2 = x0;
n1 = p0;
p0 = n1;
x0 = n2;
x1 = n1;
}
{
Cell *a;
a = (Cell *) x1;
x1 = *a;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 * n1;
x0 = n;
}
{
Cell n;
n = r2;
x1 = n;
}
{
Cell n1, n2, n;
n1 = x1;
n2 = x0;
n = n2 + n1;
x0 = n;
}
{
Cell n;
n = x0;
r2 = n;
}
{
Cell n1, n2;
n1 = p0;
n2 = p1;
p1 = n1;
p0 = n2;
}
{
Cell * a;
a = (Cell *) p0;
p0 = (Cell) (a + 1);
}
{
Cell n1, n2;
n1 = p0;
n2 = p1;
p1 = n1;
p0 = n2;
}
{
x0 = (Cell) row_byte_size;
}
{
Cell n1, n2, n;
n1 = x0;
n2 = p0;
n = n2 + n1;
p0 = n;
}
{
Cell n;
n = r2;
x0 = n;
}
{
Cell index, bound;
index = r1;
bound = r0;
index++;
if (index != bound)
{
r0 = bound;
r1 = index;
goto label0;
}
}
{
}
{
Cell n;
n = x0;
r0 = n;
}
{
}
{
Cell n;
n = r0;
p1 = n;
}
{
_c_result = p1;
return (_c_result);
}
}
void main(void)
{
Cell x0;
Cell x1;
Cell x2;
Cell r0;
Cell r1;
Cell r2;
Cell r3;
{
initiate_seed();
}
{
x0 = (Cell) (&ima[0]);
}
{
initiate_matrix(x0);
}
{
x0 = (Cell) (&imb[0]);
}
{
initiate_matrix(x0);
}
{
x0 = (Cell) (&imr[0]);
}
{
x1 = (Cell) (&ima[0]);
}
{
x2 = (Cell) mat_byte_size;
}
{
Cells2 _C_locret;
_C_locret = mybounds(x2, x1);
x1 = _C_locret.cell1;
x2 = _C_locret.cell0;
}
{
Cell bound, index;
index = x2;
bound = x1;
r0 = bound;
r1 = index;
}
label0:
{
x1 = (Cell) (&imb[0]);
}
{
x2 = (Cell) row_byte_size;
}
{
Cells2 _C_locret;
_C_locret = mybounds(x2, x1);
x1 = _C_locret.cell1;
x2 = _C_locret.cell0;
}
{
Cell bound, index;
index = x2;
bound = x1;
r2 = bound;
r3 = index;
}
label1:
{
Cell n = r1;
x1 = n;
}
{
Cell n = r3;
x2 = n;
}
{
Cell _C_locret;
_C_locret = innerproduct(x2, x1);
x1 = _C_locret;
}
{
Cell n1, n2;
n2 = x1;
n1 = x0;
x0 = n1;
x1 = n2;
x2 = n1;
}
{
Cell *a, n;
a = (Cell *) x2;
n = x1;
*a = n;
}
{
Cell * a;
a = (Cell *) x0;
x0 = (Cell) (a + 1);
}
{
x1 = sizeof(Cell);
}
{
Cell step, index, bound;
index = r3;
bound = r2;
step = x1;
index += step;
if ((step > 0 && index < bound) ||
(step <= 0 && index >= bound))
{
r2 = bound;
r3 = index;
goto label1;
}
}
{
}
{
x1 = (Cell) row_size;
}
{
Cell n;
n = x1;
x1 = n * sizeof(Cell);
}
{
Cell step, index, bound;
index = r1;
bound = r0;
step = x1;
index += step;
if ((step > 0 && index < bound) ||
(step <= 0 && index >= bound))
{
r0 = bound;
r1 = index;
goto label0;
}
}
{
}
{
}
{
return;
}
}