/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */
/* time: February 21, 1992 9:04:27 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: RealImpl, module: RealImpl */
/* switches: bcfhklnouw */
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [1771183207,2133754398] RealImpl";
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;} W3;
typedef struct {word f0, f1, f2, f3;} W4;
#define SOURCE(p, l) /* source p, l */
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static float fc7 = 0.0;
static float fc10 = 256.0;
#define INEG(x) ( (word) ( - ((int) (word) (x)) ) )
static float fc17 = 2.0;
static float fc30 = 1e1;
static float fc31 = 1e2;
static float fc32 = 1e3;
static float fc33 = 1e4;
static float fc34 = 1e5;
static float fc35 = 1e6;
static float fc36 = 1e7;
static float fc37 = 1e8;
static float fc38 = 1e9;
static float fc39 = 1e10;
static float fc40 = 1e11;
static float fc41 = 1e12;
static float fc42 = 1e13;
static float fc43 = 1e14;
static float fc44 = 1e15;
static float fc45 = 1e16;
static float fc46 = 1e17;
static float fc47 = 1e18;
static float fc48 = 1e19;
static float fc49 = 1e20;
static float fc55 = 10.0;
static void NoName←Q1008();
static void RealImpl←P0();
static word FScale←P60();
static word RangeError←P120();
static word Fix←P180();
static word Round←P240();
static word Ceiling←P300();
static word Floor←P360();
static word PairToReal←P420();
static word PowersOfTen←P480();
static void RealToPair←P540();
static void CVExtended←P600();
static word Pack←P660();
static word UsualPack←P720();
static void Unpack←P780();
static struct {unsigned f; char r[8];} string1 = {393224, "\205\210\242\000\024\256\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\151\222\034\147\300\177\056\202\036\100\164\000\000"};
static struct {unsigned f; char r[4];} string3 = {131074, "\003\004\000"};
static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\246\205\220\035\300\344\000\142\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\144\134\241\012\300\120\263\151\115\100\164\000\000"};
static struct {
word f0[9]; 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[2];
} globalframe = {
{0}, (word) Unpack←P780, 0, (word) UsualPack←P720,
0, (word) Pack←P660, 0, (word) CVExtended←P600,
0, (word) RealToPair←P540, 0, (word) PowersOfTen←P480,
0, (word) PairToReal←P420, 0, (word) Floor←P360,
0, (word) Ceiling←P300, 0, (word) Round←P240,
0, (word) Fix←P180, 0, (word) RangeError←P120,
0, (word) FScale←P60, 0, (word) RealImpl←P0,
{0}
};
static void NoName←Q1008()
{
register ptr gf←c067 = (ptr) &globalframe;
word var←c7780;
(* (( (ptr) gf←c067)+6) ) = (word) XR←GetTypeIndexS((word) (&string1));
(void) XR←DeclareGlobalFrame((word) "RealImpl", &globalframe, (word) XR←GetTypeIndex((word) &string2, 0, (word) &string3)
, (word) (( (bPt) gf←c067)+140)/* var←c7524 */ );
var←c7780 = (word) XR←ExportInterface((word) "Real", (word) XR←GetTypeIndexS((word) (&string4)), 11);
(* (( (ptr) gf←c067)+37)/* var←c7748 */ ) = var←c7780;
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+132)/* var←c7492 */ , 67633154);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+116)/* var←c7428 */ , 67371265);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+108)/* var←c7396 */ , 67371521);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+100)/* var←c7364 */ , 67371777);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+92)/* var←c7332 */ , 67372033);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+84)/* var←c7300 */ , 67634434);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+68)/* var←c7236 */ , 201852418);
(void) XR←ExportVar(var←c7780, 7, (word) (( (bPt) gf←c067)+28));
(void) XR←ExportVar(var←c7780, 8, (word) (( (bPt) gf←c067)+32));
var←c7780 = (word) XR←ExportInterface((word) "Ieee", (word) XR←GetTypeIndexS((word) (&string5)), 31);
(* (( (ptr) gf←c067)+37)/* var←c7748 */ ) = var←c7780;
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+36)/* var←c7108 */ , 201590529);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+52)/* var←c7172 */ , 67373057);
(void) XR←ExportProcS(var←c7780, (word) (( (bPt) gf←c067)+60)/* var←c7204 */ , 269228545);
}
static void RealImpl←P0(formal←c021, formal←c020)
word formal←c021;
word formal←c020;
{
register ptr gf←c7812 = (ptr) &globalframe;
/* RealImpl: */
SOURCE(36, 3095)
SOURCE(1936, 43)
(* (( (ptr) gf←c7812)+4)/* tenToThe←v2748 */ ) = (word) PowersOfTen←P480();
}
static word FScale←P60(a←v3212, scale←v3240)
word a←v3212;
word scale←v3240;
{
word var←c3284;
word r←v4700;
word exp←v4728;
/* FScale: */
SOURCE(259, 499)
SOURCE(324, 32)
r←v4700 = a←v3212;
SOURCE(358, 28)
exp←v4728 = ((((unsigned)r←v4700 << 1) >> 24) + scale←v3240);
SOURCE(388, 370)
if ( ( ( ( (int)exp←v4728 > (int)0) ? ( (int)exp←v4728 < (int)255) : 0 ) ? (((((unsigned)r←v4700 << 1) >> 24) - 1) <= 253) : 0 ) ) {
SOURCE(438, 11)
r←v4700 = (r←v4700 & 2155872255) | (((BCK(exp←v4728, 256))) << 23);
SOURCE(451, 21)
return(r←v4700);
}
else {
SOURCE(481, 26)
{
word x6;
word x8;
if (((
x6 = a←v3212, *(float*)&x6
) == (
x8 = (* (ptr) &fc7 ), *(float*)&x8
))) {
SOURCE(497, 10)
return(a←v3212);
};
};
SOURCE(509, 60)
lab←L100002: ;
if (( (int)scale←v3240 >= (int)8)) {
}
else {
goto lab←L100000;
};
SOURCE(529, 17)
scale←v3240 = (scale←v3240 - 8);
SOURCE(548, 21)
{
word x9;
word x11;
*(float*)&a←v3212 = (
x9 = a←v3212, *(float*)&x9
) * (
x11 = (* (ptr) &fc10 ), *(float*)&x11
);
};
goto lab←L100002;
lab←L100000: ;
SOURCE(571, 53)
lab←L100005: ;
if (( (int)scale←v3240 > (int)0)) {
}
else {
goto lab←L100003;
};
SOURCE(590, 17)
scale←v3240 = (scale←v3240 - 1);
SOURCE(609, 15)
{
word x12;
word x13;
*(float*)&a←v3212 = (
x12 = a←v3212, *(float*)&x12
) + (
x13 = a←v3212, *(float*)&x13
);
};
goto lab←L100005;
lab←L100003: ;
SOURCE(626, 61)
lab←L100008: ;
if (( (int)INEG(scale←v3240) >= (int)8)) {
}
else {
goto lab←L100006;
};
SOURCE(647, 17)
scale←v3240 = (scale←v3240 + 8);
SOURCE(666, 21)
{
word x14;
word x15;
*(float*)&a←v3212 = (
x14 = a←v3212, *(float*)&x14
) / (
x15 = (* (ptr) &fc10 ), *(float*)&x15
);
};
goto lab←L100008;
lab←L100006: ;
SOURCE(689, 56)
lab←L100011: ;
if (( (int)INEG(scale←v3240) > (int)0)) {
}
else {
goto lab←L100009;
};
SOURCE(709, 17)
scale←v3240 = (scale←v3240 + 1);
SOURCE(728, 17)
{
word x16;
word x18;
*(float*)&a←v3212 = (
x16 = a←v3212, *(float*)&x16
) / (
x18 = (* (ptr) &fc17 ), *(float*)&x18
);
};
goto lab←L100011;
lab←L100009: ;
SOURCE(747, 11)
return(a←v3212);
};
}
static word RangeError←P120(a←v3344)
word a←v3344;
{
register ptr gf←c7844 = (ptr) &globalframe;
word var←c3388;
word flags←v4772 = 0;
word vp←v4800 = 0;
W2 var←c031;
word var←c032;
/* RangeError: */
SOURCE(765, 277)
SOURCE(935, 25)
flags←v4772 = (flags←v4772 & 4294967263) | (((1)) << 5);
SOURCE(962, 53)
(* (ptr) (word) &var←c031 ) = flags←v4772;
(* (( (ptr) (word) &var←c031) + 1) ) = vp←v4800;
(void) (XR←RaiseSignal((word) (( (bPt) gf←c7844)+28), (word) &var←c032, (word) &var←c031));
if ((0 != var←c032)) {
};
SOURCE(1031, 11)
return(a←v3344);
}
static word Fix←P180(a←v3448)
word a←v3448;
{
word var←c3492;
/* Fix: */
SOURCE(1046, 128)
SOURCE(1091, 51)
if (((((unsigned)a←v3448 << 1) >> 24) == 255)) {
SOURCE(1125, 17)
a←v3448 = (word) RangeError←P120(a←v3448);
};
SOURCE(1145, 29)
return((word) XR←REAL32←Fix(a←v3448));
}
static word Round←P240(a←v3552)
word a←v3552;
{
word var←c3596;
/* Round: */
SOURCE(1178, 132)
SOURCE(1225, 51)
if (((((unsigned)a←v3552 << 1) >> 24) == 255)) {
SOURCE(1259, 17)
a←v3552 = (word) RangeError←P120(a←v3552);
};
SOURCE(1279, 31)
return((word) XR←REAL32←Round(a←v3552));
}
static word Ceiling←P300(a←v3656)
word a←v3656;
{
word var←c3700;
/* Ceiling: */
SOURCE(1314, 136)
SOURCE(1363, 51)
if (((((unsigned)a←v3656 << 1) >> 24) == 255)) {
SOURCE(1397, 17)
a←v3656 = (word) RangeError←P120(a←v3656);
};
SOURCE(1417, 33)
return((word) XR←REAL32←Ceiling(a←v3656));
}
static word Floor←P360(a←v3760)
word a←v3760;
{
word var←c3804;
/* Floor: */
SOURCE(1454, 132)
SOURCE(1501, 51)
if (((((unsigned)a←v3760 << 1) >> 24) == 255)) {
SOURCE(1535, 17)
a←v3760 = (word) RangeError←P120(a←v3760);
};
SOURCE(1555, 31)
return((word) XR←REAL32←Floor(a←v3760));
}
static word PairToReal←P420(fr←v3864, exp10←v3892)
word fr←v3864;
word exp10←v3892;
{
register ptr gf←c7876 = (ptr) &globalframe;
word var←c3936;
word a←v4856;
word i←v4884;
/* PairToReal: */
SOURCE(1590, 331)
SOURCE(1659, 12)
{
float tf19;
a←v4856 = (
tf19 = (float)(int)fr←v3864, *(word*)&tf19
);
};
SOURCE(1673, 18)
i←v4884 = exp10←v3892;
SOURCE(1729, 192)
lab←L100014: ;
SOURCE(1732, 168)
{
word var←c7684;
var←c7684 = i←v4884;
if (( (int)var←c7684 > (int)20)) {
SOURCE(1756, 19)
{
word x21;
word x22;
*(float*)&a←v4856 = (
x21 = a←v4856, *(float*)&x21
) * (
x22 = (* (( (ptr) (* (( (ptr) gf←c7876)+4)/* tenToThe←v2748 */ ))+20) ), *(float*)&x22
);
};
SOURCE(1777, 11)
i←v4884 = (i←v4884 - 20);
SOURCE(1790, 4)
goto lab←L100014;
};
if (( (int)var←c7684 < (int) (word) -20)) {
SOURCE(1808, 19)
{
word x23;
word x24;
*(float*)&a←v4856 = (
x23 = a←v4856, *(float*)&x23
) / (
x24 = (* (( (ptr) (* (( (ptr) gf←c7876)+4)/* tenToThe←v2748 */ ))+20) ), *(float*)&x24
);
};
SOURCE(1829, 11)
i←v4884 = (i←v4884 + 20);
SOURCE(1842, 4)
goto lab←L100014;
};
if (( (int)var←c7684 > (int)0)) {
SOURCE(1856, 17)
{
word x25;
word x26;
*(float*)&a←v4856 = (
x25 = a←v4856, *(float*)&x25
) * (
x26 = (* (( (ptr) (* (( (ptr) gf←c7876)+4)/* tenToThe←v2748 */ ))+BCK(i←v4884, 21)) ), *(float*)&x26
);
};
goto endif020;
};
if (( (int)var←c7684 < (int)0)) {
SOURCE(1882, 18)
{
word x27;
word idx28;
word x29;
*(float*)&a←v4856 = (
x27 = a←v4856, *(float*)&x27
) / (
x29 = (* (( (ptr) (* (( (ptr) gf←c7876)+4)/* tenToThe←v2748 */ ))+(
idx28 = (word) INEG(i←v4884),
BCK(idx28, 21)
)) ), *(float*)&x29
);
};
goto endif020;
};
endif020: ;
};
SOURCE(1911, 10)
return(a←v4856);
/* c2c skipped dead code */
}
static word PowersOfTen←P480()
{
register ptr gf←c7908 = (ptr) &globalframe;
word var←c4044;
word t←v4956;
/* PowersOfTen: */
SOURCE(2073, 223)
SOURCE(2123, 160)
t←v4956 = XR←NewObject(84, (* (( (ptr) gf←c7908)+6) ));
(* (ptr) t←v4956 ) = (* (ptr) &fc7 );
(* (( (ptr) t←v4956)+1) ) = (* (ptr) &fc30 );
(* (( (ptr) t←v4956)+2) ) = (* (ptr) &fc31 );
(* (( (ptr) t←v4956)+3) ) = (* (ptr) &fc32 );
(* (( (ptr) t←v4956)+4) ) = (* (ptr) &fc33 );
(* (( (ptr) t←v4956)+5) ) = (* (ptr) &fc34 );
(* (( (ptr) t←v4956)+6) ) = (* (ptr) &fc35 );
(* (( (ptr) t←v4956)+7) ) = (* (ptr) &fc36 );
(* (( (ptr) t←v4956)+8) ) = (* (ptr) &fc37 );
(* (( (ptr) t←v4956)+9) ) = (* (ptr) &fc38 );
(* (( (ptr) t←v4956)+10) ) = (* (ptr) &fc39 );
(* (( (ptr) t←v4956)+11) ) = (* (ptr) &fc40 );
(* (( (ptr) t←v4956)+12) ) = (* (ptr) &fc41 );
(* (( (ptr) t←v4956)+13) ) = (* (ptr) &fc42 );
(* (( (ptr) t←v4956)+14) ) = (* (ptr) &fc43 );
(* (( (ptr) t←v4956)+15) ) = (* (ptr) &fc44 );
(* (( (ptr) t←v4956)+16) ) = (* (ptr) &fc45 );
(* (( (ptr) t←v4956)+17) ) = (* (ptr) &fc46 );
(* (( (ptr) t←v4956)+18) ) = (* (ptr) &fc47 );
(* (( (ptr) t←v4956)+19) ) = (* (ptr) &fc48 );
(* (( (ptr) t←v4956)+20) ) = (* (ptr) &fc49 );
SOURCE(2285, 11)
return(t←v4956);
}
static void RealToPair←P540(formal←c056, r←v4116, precision←v4144)
word formal←c056;
word r←v4116;
word precision←v4144;
{
register ptr gf←c7940 = (ptr) &globalframe;
word type←v4188;
word fr←v4216;
word exp10←v4244;
word rep←v5012;
/* RealToPair: */
SOURCE(2300, 831)
SOURCE(2441, 34)
rep←v5012 = r←v4116;
SOURCE(2477, 79)
if ((precision←v4144 > 20)) {
SOURCE(2521, 35)
precision←v4144 = 20;
};
if (((((unsigned)rep←v5012 << 1) >> 24) < 255)) {
SOURCE(2592, 290)
{
word a←v5056;
SOURCE(2594, 27)
a←v5056 = ( (((unsigned)r←v4116 << 1) >> 1) );
SOURCE(2623, 53)
{
word x50;
word x51;
if (((
x50 = a←v5056, *(float*)&x50
) <= (
x51 = (* (ptr) &fc7 ), *(float*)&x51
))) {
SOURCE(2640, 36)
type←v4188 = 1;
fr←v4216 = 0;
exp10←v4244 = 0;
goto lab←L100015;
};
};
SOURCE(2678, 9)
exp10←v4244 = 0;
SOURCE(2689, 13)
type←v4188 = 0;
SOURCE(2704, 68)
lab←L100018: ;
{
word x52;
word x53;
if (((
x52 = a←v5056, *(float*)&x52
) < (
x53 = (* (( (ptr) (* (( (ptr) gf←c7940)+4)/* tenToThe←v2748 */ ))+BCK(precision←v4144, 21)) ), *(float*)&x53
))) {
}
else {
goto lab←L100016;
};
};
SOURCE(2737, 10)
{
word x54;
word x56;
*(float*)&a←v5056 = (
x54 = a←v5056, *(float*)&x54
) * (
x56 = (* (ptr) &fc55 ), *(float*)&x56
);
};
SOURCE(2749, 23)
exp10←v4244 = (exp10←v4244 - 1);
goto lab←L100018;
lab←L100016: ;
SOURCE(2774, 69)
lab←L100021: ;
{
word x57;
word x58;
if (((
x57 = a←v5056, *(float*)&x57
) >= (
x58 = (* (( (ptr) (* (( (ptr) gf←c7940)+4)/* tenToThe←v2748 */ ))+BCK(precision←v4144, 21)) ), *(float*)&x58
))) {
}
else {
goto lab←L100019;
};
};
SOURCE(2808, 10)
{
word x59;
word x60;
*(float*)&a←v5056 = (
x59 = a←v5056, *(float*)&x59
) / (
x60 = (* (ptr) &fc55 ), *(float*)&x60
);
};
SOURCE(2820, 23)
exp10←v4244 = (exp10←v4244 + 1);
goto lab←L100021;
lab←L100019: ;
SOURCE(2845, 35)
{
word x61;
word x62;
word x63;
float tf64;
if (((
x61 = r←v4116, *(float*)&x61
) < (
x62 = (* (ptr) &fc7 ), *(float*)&x62
))) {
fr←v4216 = (word) Round←P240((
tf64 = - (
x63 = a←v5056, *(float*)&x63
), *(word*)&tf64
));
}
else {
fr←v4216 = (word) Round←P240(a←v5056);
};
};
};
}
else {
if ((rep←v5012 == 2139095040)) {
SOURCE(2922, 58)
type←v4188 = 2;
fr←v4216 = 2147483647;
exp10←v4244 = 2147483647;
goto lab←L100015;
}
else {
if ((rep←v5012 == 4286578688)) {
SOURCE(3020, 59)
type←v4188 = 2;
fr←v4216 = 2147483648;
exp10←v4244 = 2147483647;
goto lab←L100015;
}
else {
SOURCE(3092, 39)
type←v4188 = 3;
fr←v4216 = ( (((unsigned)rep←v5012 << 9) >> 9) );
exp10←v4244 = 0;
goto lab←L100015;
};
};
};
/* removed tail goto */
lab←L100015: ;
(* (ptr) formal←c056 ) = type←v4188;
(* (( (ptr) formal←c056)+1) ) = fr←v4216;
(* (( (ptr) formal←c056)+2) ) = exp10←v4244;
return;
}
static void CVExtended←P600(formal←c059, z←v4304)
word formal←c059;
W3 z←v4304;
{
W4 var←c4348;
/* CVExtended: */
SOURCE(3137, 25)
SOURCE(3203, 5)
(void) XR←RaiseUnnamedError();
}
static word Pack←P660(z←v4408)
word z←v4408;
{
word r←v4464;
/* Pack: */
SOURCE(3237, 19)
SOURCE(3302, 5)
(void) XR←RaiseUnnamedError();
}
static word UsualPack←P720(z←v4524)
W3 z←v4524;
{
word var←c4568;
/* UsualPack: */
SOURCE(3336, 24)
SOURCE(3392, 5)
(void) XR←RaiseUnnamedError();
}
static void Unpack←P780(formal←c066, r←v4628)
word formal←c066;
word r←v4628;
{
W3 z←v4672;
/* Unpack: */
SOURCE(3426, 21)
SOURCE(3482, 5)
(void) XR←RaiseUnnamedError();
}
/* file: RealImpl, module: RealImpl, compiled at: February 21, 1992 9:04:27 pm PST */
extern void XR←install←RealImpl() {
NoName←Q1008();
}
extern void XR←run←RealImpl() { XR←Start(&globalframe); }