/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation. All rights reserved. */
/* time: July 28, 1993 10:27:54 am PDT */
/* C2C version: April 20, 1993 (sun4) */
/* ref-counting: off */
/* file: SFImpl, module: SFImpl */
/* switches: bcfhklnouw */
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [3322475147,2659602298] SFImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef struct {word f0, f1;} W2;
typedef struct {word f0, f1, f2, f3;} W4;
typedef W2 *W2Pt;
#define SOURCE(p, l) /* source p, l */
#define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i )
#define INEG(x) ( (word) ( - ((int) (word) (x)) ) )
#define MIN(cast, x, y) ( ( cast x) < ( cast y) ? (x) : (y) )
#define MAX(cast, x, y) ( ( cast x) > ( cast y) ? (x) : (y) )
static void NoName←Q2736();
static void SFImpl←P0();
static void NonNegative←P60();
static void Neg←P120();
static void Add←P180();
static void Sub←P240();
static void Min←P300();
static void Min3←P360();
static void Max←P420();
static void Max3←P480();
static word Eq←P540();
static word Nonempty←P600();
static word Empty←P660();
static void Intersect←P720();
static word Disjoint←P780();
static word SizeF←P840();
static word SizeS←P900();
static void Size←P960();
static word Inside←P1020();
static void Displace←P1080();
static word In←P1140();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\306\010\362\213\300\236\206\117\172\100\164\000\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\243\162\130\311\300\344\000\142\023\100\150\000\000"};
static struct {
word f0[4]; word f4; word f5; word f6;
word f7; word f8; word f9; word f10;
word f11; word f12; word f13; word f14;
word f15; word f16; word f17; word f18;
word f19; word f20; word f21; word f22;
word f23; word f24; word f25; word f26;
word f27; word f28; word f29; word f30;
word f31; word f32; word f33; word f34;
word f35; word f36; word f37; word f38;
word f39; word f40; word f41; word f42;
word f43[2];
} globalframe = {
{0}, (word) In←P1140, 0, (word) Displace←P1080,
0, (word) Inside←P1020, 0, (word) Size←P960,
0, (word) SizeS←P900, 0, (word) SizeF←P840,
0, (word) Disjoint←P780, 0, (word) Intersect←P720,
0, (word) Empty←P660, 0, (word) Nonempty←P600,
0, (word) Eq←P540, 0, (word) Max3←P480,
0, (word) Max←P420, 0, (word) Min3←P360,
0, (word) Min←P300, 0, (word) Sub←P240,
0, (word) Add←P180, 0, (word) Neg←P120,
0, (word) NonNegative←P60, 0, (word) SFImpl←P0,
{0}
};
static void NoName←Q2736()
{
register ptr gf←c092 = (ptr) &globalframe;
word var←c13744;
(void) XR←DeclareGlobalFrame((word) "SFImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) (( (bPt) gf←c092)+168)
/* var←c13200 */ );
var←c13744 = (word) XR←ExportInterface((word) "SF", (word) XR←GetTypeIndexS((word) (&string2)), 19);
(* (( (ptr) gf←c092)+44)/* var←c13712 */ ) = var←c13744;
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+160)/* var←c13168 */ , 134742017, (word) "NonNegative");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+152)/* var←c13136 */ , 134742273, (word) "Neg");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+144)/* var←c13104 */ , 135266818, (word) "Add");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+136)/* var←c13072 */ , 135267074, (word) "Sub");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+128)/* var←c13040 */ , 135267330, (word) "Min");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+120)/* var←c13008 */ , 135791875, (word) "Min3");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+112)/* var←c12976 */ , 135267842, (word) "Max");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+104)/* var←c12944 */ , 135792387, (word) "Max3");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+96)/* var←c12912 */ , 68159490, (word) "Eq");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+88)/* var←c12880 */ , 68159745, (word) "Nonempty");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+80)/* var←c12848 */ , 68160001, (word) "Empty");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+72)/* var←c12816 */ , 270535426, (word) "Intersect");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+64)/* var←c12784 */ , 69209090, (word) "Disjoint");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+56)/* var←c12752 */ , 68160769, (word) "SizeF");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+48)/* var←c12720 */ , 68161025, (word) "SizeS");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+40)/* var←c12688 */ , 135270145, (word) "Size");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+24)/* var←c12624 */ , 270012418, (word) "Displace");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+32)/* var←c12656 */ , 69210370, (word) "Inside");
(void) XR←ExportProcS(var←c13744, (word) (( (bPt) gf←c092)+16)/* var←c12592 */ , 68686338, (word) "In");
}
static void SFImpl←P0(formal←c024, formal←c023)
word formal←c024;
word formal←c023;
{
/* SFImpl: */
}
static void NonNegative←P60(formal←c027, v←v3136)
word formal←c027;
W2 v←v3136;
{
word var←c093;
word var←c094;
/* NonNegative: */
SOURCE(151, 85)
/* Return var split */
SOURCE(203, 33)
{
word idx3;
var←c093 = (
idx3 = (word) v←v3136.f0,
SGNCK(idx3)
);
};
{
word idx4;
var←c094 = (
idx4 = (word) v←v3136.f1,
SGNCK(idx4)
);
};
/* removed tail goto */
(* (( (ptr) formal←c027)+1) ) = var←c094;
(* (ptr) formal←c027 ) = var←c093;
return;
}
static void Neg←P120(formal←c030, v←v3240)
word formal←c030;
W2 v←v3240;
{
word var←c095;
word var←c096;
/* Neg: */
SOURCE(240, 69)
/* Return var split */
SOURCE(284, 25)
var←c095 = INEG(v←v3240.f0);
var←c096 = INEG(v←v3240.f1);
/* removed tail goto */
(* (( (ptr) formal←c030)+1) ) = var←c096;
(* (ptr) formal←c030 ) = var←c095;
return;
}
static void Add←P180(formal←c034, v1←v3344, v2←v3372)
word formal←c034;
W2 v1←v3344;
W2 v2←v3372;
{
word var←c097;
word var←c098;
/* Add: */
SOURCE(313, 79)
/* Return var split */
SOURCE(362, 30)
var←c097 = (v1←v3344.f0 + v2←v3372.f0);
var←c098 = (v1←v3344.f1 + v2←v3372.f1);
/* removed tail goto */
(* (( (ptr) formal←c034)+1) ) = var←c098;
(* (ptr) formal←c034 ) = var←c097;
return;
}
static void Sub←P240(formal←c038, v1←v3476, v2←v3504)
word formal←c038;
W2 v1←v3476;
W2 v2←v3504;
{
word var←c099;
word var←c0100;
/* Sub: */
SOURCE(396, 79)
/* Return var split */
SOURCE(445, 30)
var←c099 = (v1←v3476.f0 - v2←v3504.f0);
var←c0100 = (v1←v3476.f1 - v2←v3504.f1);
/* removed tail goto */
(* (( (ptr) formal←c038)+1) ) = var←c0100;
(* (ptr) formal←c038 ) = var←c099;
return;
}
static void Min←P300(formal←c042, v1←v3608, v2←v3636)
word formal←c042;
W2 v1←v3608;
W2 v2←v3636;
{
word var←c0101;
word var←c0102;
/* Min: */
SOURCE(479, 79)
/* Return var split */
SOURCE(528, 30)
if (( (int)v1←v3608.f0 <= (int)v2←v3636.f0)) {
var←c0101 = v1←v3608.f0;
}
else {
var←c0101 = v2←v3636.f0;
};
if (( (int)v1←v3608.f1 <= (int)v2←v3636.f1)) {
var←c0102 = v1←v3608.f1;
}
else {
var←c0102 = v2←v3636.f1;
};
/* removed tail goto */
(* (( (ptr) formal←c042)+1) ) = var←c0102;
(* (ptr) formal←c042 ) = var←c0101;
return;
}
static void Min3←P360(formal←c047, v1←v3740, v2←v3768, v3←v3796)
word formal←c047;
W2 v1←v3740;
W2 v2←v3768;
W2 v3←v3796;
{
word var←c0103;
word var←c0104;
/* Min3: */
SOURCE(562, 89)
/* Return var split */
SOURCE(616, 35)
{
word x5;
word x6;
word x7;
word x8;
var←c0103 = (x5 = v1←v3740.f0,
x6 = v2←v3768.f0,
x7 = MIN((int)(word), x5, x6),
x8 = v3←v3796.f0,
MIN((int)(word), x7, x8));
};
{
word x9;
word x10;
word x11;
word x12;
var←c0104 = (x9 = v1←v3740.f1,
x10 = v2←v3768.f1,
x11 = MIN((int)(word), x9, x10),
x12 = v3←v3796.f1,
MIN((int)(word), x11, x12));
};
/* removed tail goto */
(* (( (ptr) formal←c047)+1) ) = var←c0104;
(* (ptr) formal←c047 ) = var←c0103;
return;
}
static void Max←P420(formal←c051, v1←v3900, v2←v3928)
word formal←c051;
W2 v1←v3900;
W2 v2←v3928;
{
word var←c0105;
word var←c0106;
/* Max: */
SOURCE(655, 79)
/* Return var split */
SOURCE(704, 30)
if (( (int)v2←v3928.f0 >= (int)v1←v3900.f0)) {
var←c0105 = v2←v3928.f0;
}
else {
var←c0105 = v1←v3900.f0;
};
if (( (int)v2←v3928.f1 >= (int)v1←v3900.f1)) {
var←c0106 = v2←v3928.f1;
}
else {
var←c0106 = v1←v3900.f1;
};
/* removed tail goto */
(* (( (ptr) formal←c051)+1) ) = var←c0106;
(* (ptr) formal←c051 ) = var←c0105;
return;
}
static void Max3←P480(formal←c056, v1←v4032, v2←v4060, v3←v4088)
word formal←c056;
W2 v1←v4032;
W2 v2←v4060;
W2 v3←v4088;
{
word var←c0107;
word var←c0108;
/* Max3: */
SOURCE(738, 89)
/* Return var split */
SOURCE(792, 35)
{
word x13;
word x14;
word x15;
word x16;
var←c0107 = (x13 = v1←v4032.f0,
x14 = v2←v4060.f0,
x15 = MAX((int)(word), x13, x14),
x16 = v3←v4088.f0,
MAX((int)(word), x15, x16));
};
{
word x17;
word x18;
word x19;
word x20;
var←c0108 = (x17 = v1←v4032.f1,
x18 = v2←v4060.f1,
x19 = MAX((int)(word), x17, x18),
x20 = v3←v4088.f1,
MAX((int)(word), x19, x20));
};
/* removed tail goto */
(* (( (ptr) formal←c056)+1) ) = var←c0108;
(* (ptr) formal←c056 ) = var←c0107;
return;
}
static word Eq←P540(v1←v4192, v2←v4220)
W2 v1←v4192;
W2 v2←v4220;
{
word var←c4264;
/* Eq: */
SOURCE(831, 78)
SOURCE(880, 29)
return( (unsigned) XR←EqualWords(&v1←v4192, &v2←v4220, 2));
}
static word Nonempty←P600(box←v4324)
W4 box←v4324;
{
word var←c4368;
/* Nonempty: */
SOURCE(912, 84)
SOURCE(964, 32)
{
word tc21;
if (( (int)box←v4324.f0 < (int)box←v4324.f2)) {
tc21 = (word) (unsigned) ( (int)box←v4324.f1 < (int)box←v4324.f3);
}
else {
tc21 = (word) (unsigned) 0;
};
return(tc21);
};
}
static word Empty←P660(box←v4428)
W4 box←v4428;
{
word var←c4472;
/* Empty: */
SOURCE(1000, 78)
SOURCE(1049, 29)
{
word tc22;
if (( (int)box←v4428.f0 >= (int)box←v4428.f2)) {
tc22 = (word) (unsigned) 1;
}
else {
tc22 = (word) (unsigned) ( (int)box←v4428.f1 >= (int)box←v4428.f3);
};
return(tc22);
};
}
static void Intersect←P720(formal←c071, box1←v4532, box2←v4560)
word formal←c071;
W4 box1←v4532;
W4 box2←v4560;
{
word var←c0109;
word var←c0110;
word var←c0111;
word var←c0112;
/* Intersect: */
SOURCE(1082, 99)
/* Return var split */
SOURCE(1141, 40)
{
W2 v1←v10048;
W2 v2←v10080;
v1←v10048 = (* (W2Pt) &box2←v4560 );
v2←v10080 = (* (W2Pt) &box1←v4532 );
if (( (int)v2←v10080.f0 >= (int)v1←v10048.f0)) {
var←c0109 = v2←v10080.f0;
}
else {
var←c0109 = v1←v10048.f0;
};
if (( (int)v2←v10080.f1 >= (int)v1←v10048.f1)) {
var←c0110 = v2←v10080.f1;
}
else {
var←c0110 = v1←v10048.f1;
};
};
{
W2 v1←v10340;
W2 v2←v10372;
v1←v10340 = (* (W2Pt) (( (ptr) &box1←v4532)+2) );
v2←v10372 = (* (W2Pt) (( (ptr) &box2←v4560)+2) );
if (( (int)v1←v10340.f0 <= (int)v2←v10372.f0)) {
var←c0111 = v1←v10340.f0;
}
else {
var←c0111 = v2←v10372.f0;
};
if (( (int)v1←v10340.f1 <= (int)v2←v10372.f1)) {
var←c0112 = v1←v10340.f1;
}
else {
var←c0112 = v2←v10372.f1;
};
};
/* removed tail goto */
(* (( (ptr) formal←c071)+3) ) = var←c0112;
(* (( (ptr) formal←c071)+2) ) = var←c0111;
(* (( (ptr) formal←c071)+1) ) = var←c0110;
(* (ptr) formal←c071 ) = var←c0109;
return;
}
static word Disjoint←P780(box1←v4664, box2←v4692)
W4 box1←v4664;
W4 box2←v4692;
{
word var←c4736;
/* Disjoint: */
SOURCE(1185, 98)
SOURCE(1244, 39)
{
word tc23;
if ((( (int)box1←v4664.f2 <= (int)box2←v4692.f0) || ( (int)box2←v4692.f2 <= (int)box1←v4664.f0)) || ( (int)box1←v4664.f3 <= (int)box2←v4692.f1)) {
tc23 = (word) (unsigned) 1;
}
else {
tc23 = (word) (unsigned) ( (int)box2←v4692.f3 <= (int)box1←v4664.f1);
};
return(tc23);
};
}
static word SizeF←P840(box←v4796)
W4 box←v4796;
{
word var←c4840;
/* SizeF: */
SOURCE(1287, 82)
SOURCE(1340, 29)
if (( (int)box←v4796.f1 < (int)box←v4796.f3)) {
return((box←v4796.f3 - box←v4796.f1));
}
else {
return(0);
};
}
static word SizeS←P900(box←v4900)
W4 box←v4900;
{
word var←c4944;
/* SizeS: */
SOURCE(1373, 82)
SOURCE(1426, 29)
if (( (int)box←v4900.f0 < (int)box←v4900.f2)) {
return((box←v4900.f2 - box←v4900.f0));
}
else {
return(0);
};
}
static void Size←P960(formal←c081, box←v5004)
word formal←c081;
W4 box←v5004;
{
word var←c0113;
word var←c0114;
/* Size: */
SOURCE(1459, 75)
/* Return var split */
SOURCE(1506, 28)
{
word x24;
var←c0113 = (x24 = (box←v5004.f2 - box←v5004.f0),
MAX((int)(word), x24, 0));
};
{
word x25;
var←c0114 = (x25 = (box←v5004.f3 - box←v5004.f1),
MAX((int)(word), x25, 0));
};
/* removed tail goto */
(* (( (ptr) formal←c081)+1) ) = var←c0114;
(* (ptr) formal←c081 ) = var←c0113;
return;
}
static word Inside←P1020(inner←v5108, outer←v5136)
W4 inner←v5108;
W4 outer←v5136;
{
word var←c5180;
/* Inside: */
SOURCE(1538, 98)
SOURCE(1597, 39)
{
word tc26;
if ( ( ( ( (int)inner←v5108.f0 >= (int)outer←v5136.f0) ? ( (int)inner←v5108.f1 >= (int)outer←v5136.f1) : 0 ) ? ( (int)inner←v5108.f2 <= (int)outer←v5136.f2) : 0 ) ) {
tc26 = (word) (unsigned) ( (int)inner←v5108.f3 <= (int)outer←v5136.f3);
}
else {
tc26 = (word) (unsigned) 0;
};
return(tc26);
};
}
static void Displace←P1080(formal←c088, box←v5240, t←v5268)
word formal←c088;
W4 box←v5240;
W2 t←v5268;
{
word var←c0115;
word var←c0116;
word var←c0117;
word var←c0118;
/* Displace: */
SOURCE(1640, 94)
/* Return var split */
SOURCE(1699, 35)
var←c0115 = (box←v5240.f0 + t←v5268.f0);
var←c0116 = (box←v5240.f1 + t←v5268.f1);
var←c0117 = (box←v5240.f2 + t←v5268.f0);
var←c0118 = (box←v5240.f3 + t←v5268.f1);
/* removed tail goto */
(* (( (ptr) formal←c088)+3) ) = var←c0118;
(* (( (ptr) formal←c088)+2) ) = var←c0117;
(* (( (ptr) formal←c088)+1) ) = var←c0116;
(* (ptr) formal←c088 ) = var←c0115;
return;
}
static word In←P1140(vec←v5372, box←v5400)
W2 vec←v5372;
W4 box←v5400;
{
word var←c5444;
/* In: */
SOURCE(1738, 87)
SOURCE(1794, 31)
{
word tc27;
if ( ( ( (int)vec←v5372.f0 >= (int)box←v5400.f0) ? ( (int)vec←v5372.f0 < (int)box←v5400.f2) : 0 ) ) {
if (( (int)vec←v5372.f1 >= (int)box←v5400.f1)) {
tc27 = (word) (unsigned) ( (int)vec←v5372.f1 < (int)box←v5400.f3);
}
else {
tc27 = (word) (unsigned) 0;
};
}
else {
tc27 = (word) (unsigned) 0;
};
return(tc27);
};
}
/* file: SFImpl, module: SFImpl, compiled at: July 28, 1993 10:27:54 am PDT */
extern void XR←install←SFImpl() {
NoName←Q2736();
}
extern void XR←run←SFImpl() { XR←Start(&globalframe); }