/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */ /* time: April 9, 1992 11:41:10 pm PDT */ /* C2C version: October 16, 1990 (native) */ /* ref-counting: off */ /* file: GGCubic2Impl, module: GGCubic2Impl */ /* switches: bcfhklnouw */ #include <cedar/InstallationSupport.h> #include <cedar/CedarExtra.h> static char versionStamp[] = "@(#)mob←version [2901984797,4123673133] GGCubic2Impl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8; typedef struct {word f0, f1;} W2; typedef word (*fPt)(); typedef W8 *W8Pt; typedef W2 *W2Pt; typedef struct {W8 f; W8 r;} W16; typedef struct {word f0, f1, f2;} W3; typedef struct {W8 f; W3 r;} W11; typedef struct {word f0, f1, f2, f3, f4, f5;} W6; typedef W6 *W6Pt; #define SOURCE(p, l) /* source p, l */ #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) ) static float fc15 = 0.0; static float fc20 = 1.0; static float fc34 = 10E6; #define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i ) #define FMIN(x, y, tx, ty) ( (tx=((float) x)) <= (ty=((float) y)) ? tx : ty ) #define FMAX(x, y, tx, ty) ( (tx=((float) x)) >= (ty=((float) y)) ? tx : ty ) static float fc90 = 100.0; static float fc95 = 2.0; #define FABS(f, t) ( ((t=(f)) >= (float) 0.0) ? (t) : (- (t)) ) static void NoName←Q1272(); static void GGCubic2Impl←P0(); static void WalkPath←P60(); static word subdivide←P420(); static void ClosestPointSubdivide←P120(); static word test←P672(); static void CheapRealRootsInInterval←P180(); static word RootBetween←P240(); static word NewtonStep←P972(); static void Evaluate←P300(); static word AsPolyline←P360(); static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\254\073\314\103\300\064\024\167\046\102\220\000\000"}; static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\254\370\306\035\300\365\312\102\055\100\164\000\000"}; static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\176\067\335\331\300\021\260\123\113\100\150\000\000"}; static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\355\363\234\160\300\023\117\014\141\100\150\000\000"}; static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\247\031\224\326\300\123\162\224\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string6 = {851984, "\257\300\335\021\351\270\300\210\237\013\247\100\150\000\000"}; static struct { word f0[5]; 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[5]; } globalframe = { {0}, (word) AsPolyline←P360, 0, (word) Evaluate←P300, 0, (word) RootBetween←P240, 0, (word) CheapRealRootsInInterval←P180, 0, (word) ClosestPointSubdivide←P120, 0, (word) WalkPath←P60, 0, (word) GGCubic2Impl←P0, {0} }; static void NoName←Q1272() { register ptr gf←c0123 = (ptr) &globalframe; word var←c10260; (* (( (ptr) gf←c0123)+4) ) = (word) XR←GetTypeIndexS((word) (&string1)); (void) XR←DeclareGlobalFrame((word) "GGCubic2Impl", &globalframe, (word) XR←GetTypeIndexS((word) (&string2)), (word) (( (bPt) gf←c0123)+68) /* var←c9300 */ ); var←c10260 = (word) XR←ImportInterface((word) "Cubic2", (word) XR←GetTypeIndexS((word) (&string3)), 5); (* (( (ptr) gf←c0123)+19)/* var←c9492 */ ) = var←c10260; (void) XR←ImportProcS(var←c10260, 1075839489); (void) XR←ImportProcS(var←c10260, 69469186); var←c10260 = (word) XR←ImportInterface((word) "Polynomial", (word) XR←GetTypeIndexS((word) (&string4)), 26); (* (( (ptr) gf←c0123)+21)/* var←c9812 */ ) = var←c10260; (void) XR←ImportProcS(var←c10260, 67638274); (void) XR←ImportProcS(var←c10260, 67633666); (void) XR←ImportProcS(var←c10260, 266753); (void) XR←ImportProcS(var←c10260, 67371265); var←c10260 = (word) XR←ImportInterface((word) "Vector2", (word) XR←GetTypeIndexS((word) (&string5)), 22); (* (( (ptr) gf←c0123)+20)/* var←c9556 */ ) = var←c10260; (void) XR←ImportProcS(var←c10260, 67637761); (void) XR←ImportProcS(var←c10260, 135005698); (void) XR←ImportProcS(var←c10260, 135266306); (void) XR←ImportProcS(var←c10260, 135266818); (void) XR←ImportProcS(var←c10260, 67638273); var←c10260 = (word) XR←ExportInterface((word) "GGCubic2", (word) XR←GetTypeIndexS((word) (&string6)), 3); (* (( (ptr) gf←c0123)+22)/* var←c10292 */ ) = var←c10260; (void) XR←ExportProcS(var←c10260, (word) (( (bPt) gf←c0123)+52)/* var←c9236 */ , 202637316); (void) XR←ExportProcS(var←c10260, (word) (( (bPt) gf←c0123)+44)/* var←c9204 */ , 403439875); (void) XR←ExportProcS(var←c10260, (word) (( (bPt) gf←c0123)+20)/* var←c9108 */ , 69468674); } static void GGCubic2Impl←P0(formal←c015, formal←c014) word formal←c015; word formal←c014; { /* GGCubic2Impl: */ } static void WalkPath←P60(path←v3080, formal←c0142, formal←c0143) word path←v3080; word formal←c0142; word formal←c0143; { W8 var←c10324; /* declaration of epsilon←v3108 skipped */ /* declaration of proc←v3136 skipped */ /* declaration of var←c9332 skipped */ word var←c9364; W2 var←c0133; var←c10324.f4/* epsilon←v3108 */ = formal←c0142; var←c10324.f5/* proc←v3136 */ = formal←c0143; /* WalkPath: */ SOURCE(462, 823) { word tmpAddr7; tmpAddr7 = (word) (( (ptr) &var←c10324)+6)/* var←c9332 */ ; (* (ptr) tmpAddr7 ) = ( ((word) (fPt) subdivide←P420) ); (* (( (ptr) tmpAddr7) + 1) ) = 1; }; SOURCE(1178, 107) { word pd9; { word limit8; var←c9364 = (* (( (ptr) path←v3080)+4) ); var←c0133 = (* (W2Pt) (( (W8Pt) (( (ptr) var←c9364)+1))+( limit8 = (* (ptr) var←c9364 ), BCK(0, limit8) )) ); }; pd9 = (word) (var←c10324.f5/* proc←v3136 */ ); if ((0 == (word) ( *( (fPt) ((* (ptr) pd9 ))))(var←c0133, pd9))) { SOURCE(1214, 71) { register word i←v4308 = 0; register word noName←c9396; noName←c9396 = (* (ptr) (* (( (ptr) path←v3080)+4) ) ); if ((i←v4308 >= noName←c9396)) { goto lab←L100000; }; lab←L100003: ; SOURCE(1255, 30) { word var←c9460; { word var←c9428; W8 var←c0134; var←c9428 = (* (( (ptr) path←v3080)+4) ); { word limit10; var←c0134 = (* (( (W8Pt) (( (ptr) var←c9428)+1))+( limit10 = (* (ptr) var←c9428 ), BCK(i←v4308, limit10) )) ); }; var←c9460 = (word) subdivide←P420(var←c0134, (word) (( (bPt) &var←c10324)+24)/* var←c9332 */ ); }; }; i←v4308 = (i←v4308 + 1); if ((i←v4308 < noName←c9396)) { goto lab←L100003; }; lab←L100000: ; }; }; }; } static word subdivide←P420(bezier←v4236, formal←c10388) W8 bezier←v4236; word formal←c10388; { register ptr gf←c10356 = (ptr) &globalframe; word quit←v4280; formal←c10388 = (formal←c10388 - 24); /* subdivide: */ SOURCE(533, 637) SOURCE(600, 12) quit←v4280 = 0; SOURCE(614, 556) { word pd11; pd11 = (* (( (ptr) (* (( (ptr) gf←c10356)+19)/* var←c9492 */ ))+8) ); if ((0 != (word) ( *( (fPt) ((* (ptr) pd11 ))))(bezier←v4236, (* (( (ptr) formal←c10388)+4) ), pd11))) { SOURCE(651, 418) { word len←v4352; SOURCE(653, 61) { W2 var←c9524; { word pd12; pd12 = (* (( (ptr) (* (( (ptr) gf←c10356)+20)/* var←c9556 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd12 ))))((word) &var←c9524, (* (W2Pt) &bezier←v4236 ), (* (W2Pt) (( (ptr) &bezier←v4236)+6) ), pd12); }; { word pd13; pd13 = (* (( (ptr) (* (( (ptr) gf←c10356)+20)/* var←c9556 */ ))+24) ); len←v4352 = (word) ( *( (fPt) ((* (ptr) pd13 ))))(var←c9524, pd13); }; }; SOURCE(716, 339) { word x14; word x16; if ((( x14 = len←v4352, *(float*)&x14 ) > ( x16 = (* (ptr) &fc15 ), *(float*)&x16 ))) { SOURCE(732, 294) { word alphaStep←v4396; word alpha←v4424; W2 pt←v4452; SOURCE(734, 29) { word x17; word x18; *(float*)&alphaStep←v4396 = ( x17 = (* (( (ptr) formal←c10388)+4) ), *(float*)&x17 ) / ( x18 = len←v4352, *(float*)&x18 ); }; SOURCE(819, 23) alpha←v4424 = alphaStep←v4396; SOURCE(853, 162) lab←L100006: ; { word x19; word x21; if ((( x19 = alpha←v4424, *(float*)&x19 ) <= ( x21 = (* (ptr) &fc20 ), *(float*)&x21 ))) { } else { goto lab←L100004; }; }; SOURCE(872, 80) { W2 var←c9588; W2 var←c9620; { word pd22; word x23; word x24; float tf25; pd22 = (* (( (ptr) (* (( (ptr) gf←c10356)+20)/* var←c9556 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd22 ))))((word) &var←c9588, (* (W2Pt) &bezier←v4236 ), ( /*1*/ tf25 = ( /*1*/ x23 = (* (ptr) &fc20 ), *(float*)&x23 /*1*/ ) - ( /*1*/ x24 = alpha←v4424, *(float*)&x24 /*1*/ ), *(word*)&tf25 /*1*/ ), pd22); }; { word pd26; pd26 = (* (( (ptr) (* (( (ptr) gf←c10356)+20)/* var←c9556 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd26 ))))((word) &var←c9620, (* (W2Pt) (( (ptr) &bezier←v4236)+6) ), alpha←v4424, pd26); }; { W2 var←c037; { /*1*/ word pd27; /*1*/ pd27 = (* (( (ptr) (* (( (ptr) gf←c10356)+20)/* var←c9556 */ ))+4) ); /*1*/ (void) ( *( (fPt) ((* (ptr) pd27 ))))((word) &var←c037, var←c9588, var←c9620, pd27); /*1*/ }; pt←v4452 = var←c037; }; }; SOURCE(954, 29) { word pd28; pd28 = (* (( (ptr) formal←c10388)+5) ); if ((0 != (word) ( *( (fPt) ((* (ptr) pd28 ))))(pt←v4452, pd28))) { SOURCE(972, 11) quit←v4280 = 1; SOURCE(985, 4) goto lab←L100005; }; }; SOURCE(992, 23) { word x29; word x30; *(float*)&alpha←v4424 = ( x29 = alpha←v4424, *(float*)&x29 ) + ( x30 = alphaStep←v4396, *(float*)&x30 ); }; goto lab←L100006; lab←L100004: ; lab←L100005: ; }; } else { SOURCE(1033, 22) { word pd31; pd31 = (* (( (ptr) formal←c10388)+5) ); quit←v4280 = (word) ( *( (fPt) ((* (ptr) pd31 ))))((* (W2Pt) ((( (ptr) &bezier←v4236)+6)) ), pd31); }; }; }; SOURCE(1057, 12) return(quit←v4280); }; } else { SOURCE(1076, 96) { W8 b1←v4496; W8 b2←v4524; SOURCE(1094, 30) { W16 var←c9652; { word pd32; pd32 = (* (( (ptr) (* (( (ptr) gf←c10356)+19)/* var←c9492 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd32 ))))((word) &var←c9652, bezier←v4236, pd32); }; b2←v4524 = (* (W8Pt) (( (ptr) &var←c9652)+8) ); b1←v4496 = (* (W8Pt) &var←c9652 ); }; SOURCE(1126, 44) if ((0 == (word) subdivide←P420(b1←v4496, (word) (( (bPt) formal←c10388)+24)))) { SOURCE(1152, 18) { word var←c9684; var←c9684 = (word) subdivide←P420(b2←v4524, (word) (( (bPt) formal←c10388)+24)); }; }; }; }; }; SOURCE(533, 637) return(quit←v4280); } static void ClosestPointSubdivide←P120(formal←c052, formal←c0144, path←v3224, epsilon←v3252, tolerance←v3280) word formal←c052; W2 formal←c0144; word path←v3224; word epsilon←v3252; word tolerance←v3280; { W11 var←c10420; /* declaration of pt←v3196 skipped */ /* declaration of closest←v3324 skipped */ word success←v3352; /* declaration of var←c9716 skipped */ /* declaration of minD←v4596 skipped */ (* (W2Pt) (( (ptr) &var←c10420)+4)/* pt←v3196 */ ) = formal←c0144; /* ClosestPointSubdivide: */ SOURCE(1301, 361) { word tmpAddr33; tmpAddr33 = (word) (( (ptr) &var←c10420)+8)/* var←c9716 */ ; (* (ptr) tmpAddr33 ) = ( ((word) (fPt) test←P672) ); (* (( (ptr) tmpAddr33) + 1) ) = 1; }; SOURCE(1301, 361) success←v3352 = 1; SOURCE(1571, 17) (* (( (ptr) &var←c10420)+10)/* minD←v4596 */ ) = (* (ptr) &fc34 ); { word var←c9748; SOURCE(1604, 27) { word limit35; var←c9748 = (* (( (ptr) path←v3224)+4) ); (* (W2Pt) (( (ptr) &var←c10420)+6)/* closest←v3324 */ ) = (* (W2Pt) (( (W8Pt) (( (ptr) var←c9748)+1))+( limit35 = (* (ptr) var←c9748 ), BCK(0, limit35) )) ); }; SOURCE(1633, 29) (void) WalkPath←P60(path←v3224, epsilon←v3252, (word) (( (bPt) &var←c10420)+32)/* var←c9716 */ ); }; /* removed tail goto */ (* (W2Pt) formal←c052 ) = (* (W2Pt) (( (ptr) &var←c10420)+6)/* closest←v3324 */ ); (* (( (ptr) formal←c052)+2) ) = success←v3352; return; } static word test←P672(p←v7800, formal←c10484) W2 p←v7800; word formal←c10484; { register ptr gf←c10452 = (ptr) &globalframe; word stop←v7844; word thisD←v4640; formal←c10484 = (formal←c10484 - 32); /* test: */ SOURCE(1448, 117) SOURCE(1448, 117) stop←v7844 = 0; SOURCE(1468, 48) { W2 var←c9780; { word pd36; pd36 = (* (( (ptr) (* (( (ptr) gf←c10452)+20)/* var←c9556 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd36 ))))((word) &var←c9780, p←v7800, (* (W2Pt) (( (ptr) formal←c10484)+4) ), pd36); }; { word pd37; pd37 = (* (( (ptr) (* (( (ptr) gf←c10452)+20)/* var←c9556 */ ))+22) ); thisD←v4640 = (word) ( *( (fPt) ((* (ptr) pd37 ))))(var←c9780, pd37); }; }; SOURCE(1518, 47) { word x38; word x39; if ((( x38 = thisD←v4640, *(float*)&x38 ) < ( x39 = (* (( (ptr) formal←c10484)+10) ), *(float*)&x39 ))) { SOURCE(1540, 11) (* (W2Pt) (( (ptr) formal←c10484)+6) ) = p←v7800; SOURCE(1553, 12) (* (( (ptr) formal←c10484)+10) ) = thisD←v4640; }; }; SOURCE(1448, 117) return(stop←v7844); } static void CheapRealRootsInInterval←P180(formal←c073, poly←v3412, lo←v3440, hi←v3468) word formal←c073; word poly←v3412; word lo←v3440; word hi←v3468; { register ptr gf←c10516 = (ptr) &globalframe; W6 roots←v3512; word d←v4684; /* CheapRealRootsInInterval: */ SOURCE(1668, 1133) SOURCE(1781, 32) { word pd40; pd40 = (* (( (ptr) (* (( (ptr) gf←c10516)+21)/* var←c9812 */ ))+5) ); d←v4684 = (word) ( *( (fPt) ((* (ptr) pd40 ))))(poly←v3412, pd40); }; SOURCE(1815, 16) roots←v3512.f0 = 0; SOURCE(1833, 968) if ((d←v4684 <= 1)) { SOURCE(1848, 67) if ((d←v4684 == 1)) { SOURCE(1861, 16) roots←v3512.f0 = 1; SOURCE(1879, 36) { word limit41; word x42; word limit43; word x44; *(float*)&roots←v3512.f1 = ( - ( x42 = (* ((( (ptr) poly←v3412)+1)+( limit41 = (* (ptr) poly←v3412 ), BCK(0, limit41) )) ), *(float*)&x42 )) / ( x44 = (* ((( (ptr) poly←v3412)+1)+( limit43 = (* (ptr) poly←v3412 ), BCK(1, limit43) )) ), *(float*)&x44 ); }; }; } else { SOURCE(1924, 886) { W6 savedCoeff←v4728; SOURCE(1960, 55) { register word i←v4808 = 0; register word noName←c9844; noName←c9844 = d←v4684; if ((i←v4808 > noName←c9844)) { goto lab←L100009; }; lab←L100012: ; SOURCE(1984, 31) { word limit45; (* (( (ptr) &savedCoeff←v4728)+BCK(i←v4808, 6)) ) = (* ((( (ptr) poly←v3412)+1)+( limit45 = (* (ptr) poly←v3412 ), BCK(i←v4808, limit45) )) ); }; if ((i←v4808 >= noName←c9844)) { goto lab←L100009; }; i←v4808 = (i←v4808 + 1); goto lab←L100012; lab←L100009: ; }; SOURCE(2017, 30) { word pd46; pd46 = (* (( (ptr) (* (( (ptr) gf←c10516)+21)/* var←c9812 */ ))+22) ); (void) ( *( (fPt) ((* (ptr) pd46 ))))(poly←v3412, pd46); }; SOURCE(2049, 757) { W6 extrema←v4852; word x←v4880; SOURCE(2055, 66) (void) CheapRealRootsInInterval←P180((word) &extrema←v4852, poly←v3412, lo←v3440, hi←v3468); SOURCE(2132, 55) { register word i←v4924 = 0; register word noName←c9876; noName←c9876 = d←v4684; if ((i←v4924 > noName←c9876)) { goto lab←L100013; }; lab←L100016: ; SOURCE(2156, 31) { word limit47; (* ((( (ptr) poly←v3412)+1)+( limit47 = (* (ptr) poly←v3412 ), BCK(i←v4924, limit47) )) ) = (* (( (ptr) &savedCoeff←v4728)+BCK(i←v4924, 6)) ); }; if ((i←v4924 >= noName←c9876)) { goto lab←L100013; }; i←v4924 = (i←v4924 + 1); goto lab←L100016; lab←L100013: ; }; SOURCE(2189, 612) if ((extrema←v4852.f0 > 0)) { SOURCE(2216, 46) x←v4880 = (word) RootBetween←P240(poly←v3412, lo←v3440, extrema←v4852.f1); SOURCE(2264, 72) { word x48; word x49; if ((( x48 = x←v4880, *(float*)&x48 ) <= ( x49 = extrema←v4852.f1, *(float*)&x49 ))) { SOURCE(2297, 16) roots←v3512.f0 = 1; SOURCE(2315, 21) roots←v3512.f1 = x←v4880; }; }; SOURCE(2339, 207) { register word i←v4968 = 0; register word noName←c9908; { word idx50; noName←c9908 = ( idx50 = (word) (extrema←v4852.f0 - 1), SGNCK(idx50) ); }; if ((i←v4968 >= noName←c9908)) { goto lab←L100017; }; lab←L100020: ; SOURCE(2378, 65) x←v4880 = (word) RootBetween←P240(poly←v3412, (* ((( (ptr) &extrema←v4852)+1)+BCK(i←v4968, 5)) ), (* ((( (ptr) &extrema←v4852)+1) +BCK((i←v4968 + 1), 5)) )); SOURCE(2445, 101) { word x51; word x52; if ((( x51 = x←v4880, *(float*)&x51 ) <= ( x52 = (* ((( (ptr) &extrema←v4852)+1)+BCK((i←v4968 + 1), 5)) ), *(float*)&x52 ))) { SOURCE(2481, 32) { word idx53; (* ((( (ptr) &roots←v3512)+1)+( /*1*/ idx53 = (word) roots←v3512.f0, /*1*/ BCK(idx53, 5) /*1*/ )) ) = x←v4880; }; SOURCE(2515, 31) roots←v3512.f0 = (roots←v3512.f0 + 1); }; }; i←v4968 = (i←v4968 + 1); if ((i←v4968 < noName←c9908)) { goto lab←L100020; }; lab←L100017: ; }; SOURCE(2558, 61) { word idx54; x←v4880 = (word) RootBetween←P240(poly←v3412, (* ((( (ptr) &extrema←v4852)+1)+( idx54 = (word) (extrema←v4852.f0 - 1), BCK(idx54, 5) )) ), hi←v3468); }; SOURCE(2621, 82) { word x55; word x56; if ((( x55 = x←v4880, *(float*)&x55 ) <= ( x56 = hi←v3468, *(float*)&x56 ))) { SOURCE(2638, 32) { word idx57; (* ((( (ptr) &roots←v3512)+1)+( /*1*/ idx57 = (word) roots←v3512.f0, /*1*/ BCK(idx57, 5) /*1*/ )) ) = x←v4880; }; SOURCE(2672, 31) roots←v3512.f0 = (roots←v3512.f0 + 1); }; }; } else { SOURCE(2714, 29) x←v4880 = (word) RootBetween←P240(poly←v3412, lo←v3440, hi←v3468); SOURCE(2745, 56) { word x58; word x59; if ((( x58 = x←v4880, *(float*)&x58 ) <= ( x59 = hi←v3468, *(float*)&x59 ))) { SOURCE(2762, 21) roots←v3512.f1 = x←v4880; SOURCE(2785, 16) roots←v3512.f0 = 1; }; }; }; }; }; }; /* removed tail goto */ (* (W6Pt) formal←c073 ) = roots←v3512; return; } static word RootBetween←P240(formal←c0145, x0←v3600, x1←v3628) word formal←c0145; word x0←v3600; word x1←v3628; { W11 var←c10548; /* declaration of poly←v3572 skipped */ register ptr gf←c10580 = (ptr) &globalframe; word x←v3672; /* declaration of var←c9940 skipped */ word y0←v5012; word y1←v5040; word xx←v5068; /* declaration of xx0←v5096 skipped */ /* declaration of xx1←v5124 skipped */ /* declaration of yy0←v5152 skipped */ /* declaration of yy1←v5180 skipped */ (* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ) = formal←c0145; /* RootBetween: */ SOURCE(2817, 1379) { word tmpAddr60; tmpAddr60 = (word) (( (ptr) &var←c10548)+5)/* var←c9940 */ ; (* (ptr) tmpAddr60 ) = ( ((word) (fPt) NewtonStep←P972) ); (* (( (ptr) tmpAddr60) + 1) ) = 1; }; SOURCE(2915, 35) { word pd61; pd61 = (* (( (ptr) (* (( (ptr) gf←c10580)+21)/* var←c9812 */ ))+6) ); y0←v5012 = (word) ( *( (fPt) ((* (ptr) pd61 ))))((* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ), x0←v3600, pd61); }; SOURCE(2952, 35) { word pd62; pd62 = (* (( (ptr) (* (( (ptr) gf←c10580)+21)/* var←c9812 */ ))+6) ); y1←v5040 = (word) ( *( (fPt) ((* (ptr) pd62 ))))((* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ), x1←v3628, pd62); }; SOURCE(2999, 36) { word x63; word x64; (* (( (ptr) &var←c10548)+7)/* xx0←v5096 */ ) = ( (( x63 = y0←v5012, *(float*)&x63 ) < ( x64 = y1←v5040, *(float*)&x64 )) ? x0←v3600 : x1←v3628 ) ; }; SOURCE(3037, 36) { word x65; word x66; (* (( (ptr) &var←c10548)+8)/* xx1←v5124 */ ) = ( (( x65 = y0←v5012, *(float*)&x65 ) < ( x66 = y1←v5040, *(float*)&x66 )) ? x1←v3628 : x0←v3600 ) ; }; SOURCE(3075, 22) { word x67; float tf68; float tf69; word x70; float tf71; (* (( (ptr) &var←c10548)+9)/* yy0←v5152 */ ) = ( tf71 = FMIN(( x67 = y0←v5012, *(float*)&x67 ), ( x70 = y1←v5040, *(float*)&x70 ), tf68, tf69), *(word*)&tf71 ); }; SOURCE(3099, 22) { word x72; float tf73; float tf74; word x75; float tf76; (* (( (ptr) &var←c10548)+10)/* yy1←v5180 */ ) = ( tf76 = FMAX(( x72 = y0←v5012, *(float*)&x72 ), ( x75 = y1←v5040, *(float*)&x75 ), tf73, tf74), *(word*)&tf76 ); }; SOURCE(3403, 23) { word x77; word x78; if ((( x77 = y0←v5012, *(float*)&x77 ) == ( x78 = (* (ptr) &fc15 ), *(float*)&x78 ))) { SOURCE(3416, 10) return(x0←v3600); }; }; SOURCE(3428, 23) { word x79; word x80; if ((( x79 = y1←v5040, *(float*)&x79 ) == ( x80 = (* (ptr) &fc15 ), *(float*)&x80 ))) { SOURCE(3441, 10) return(x1←v3628); }; }; SOURCE(3453, 66) { word x81; word x82; word x83; word x84; word x85; word x86; word x87; word x88; if ( ( (( x81 = y0←v5012, *(float*)&x81 ) > ( x82 = (* (ptr) &fc15 ), *(float*)&x82 )) ? (( x83 = y1←v5040, *(float*)&x83 ) > ( x84 = (* (ptr) &fc15 ), *(float*)&x84 )) : 0 ) || ( (( x85 = y0←v5012, *(float*)&x85 ) < ( x86 = (* (ptr) &fc15 ), *(float*)&x86 )) ? (( x87 = y1←v5040, *(float*)&x87 ) < ( x88 = (* (ptr) &fc15 ), *(float*)&x88 )) : 0 ) ) { SOURCE(3504, 15) { word x89; word x91; float tf92; return(( tf92 = ( x89 = x1←v3628, *(float*)&x89 ) + ( x91 = (* (ptr) &fc90 ), *(float*)&x91 ), *(word*)&tf92 )); }; }; }; SOURCE(3521, 18) { word var←c9972; { word x93; word x94; word x96; *(float*)&var←c9972 = (( x93 = x0←v3600, *(float*)&x93 ) + ( x94 = x1←v3628, *(float*)&x94 )) / ( x96 = (* (ptr) &fc95 ), *(float*)&x96 ); }; x←v3672 = var←c9972; xx←v5068 = var←c9972; }; SOURCE(3541, 129) lab←L100023: ; { word x97; word x98; word x99; word x100; if ( ( (( x97 = x←v3672, *(float*)&x97 ) >= ( x98 = x0←v3600, *(float*)&x98 )) ? (( x99 = x←v3672, *(float*)&x99 ) <= ( x100 = x1←v3628, *(float*)&x100 )) : 0 ) ) { } else { goto lab←L100021; }; }; { word newx←v5356; SOURCE(3564, 25) newx←v5356 = (word) NewtonStep←P972(x←v3672, (word) (( (bPt) &var←c10548)+20)/* var←c9940 */ ); SOURCE(3591, 21) { word x101; word x102; if ((( x101 = x←v3672, *(float*)&x101 ) == ( x102 = newx←v5356, *(float*)&x102 ))) { SOURCE(3606, 6) return(x←v3672); }; }; SOURCE(3614, 20) x←v3672 = (word) NewtonStep←P972(newx←v5356, (word) (( (bPt) &var←c10548)+20)/* var←c9940 */ ); SOURCE(3636, 19) xx←v5068 = (word) NewtonStep←P972(xx←v5068, (word) (( (bPt) &var←c10548)+20)/* var←c9940 */ ); SOURCE(3657, 13) { word x103; word x104; if ((( x103 = xx←v5068, *(float*)&x103 ) == ( x104 = x←v3672, *(float*)&x104 ))) { SOURCE(3670, 4) goto lab←L100022; }; }; }; goto lab←L100023; lab←L100021: ; lab←L100022: ; SOURCE(3685, 86) { word x105; word x106; word x107; word x108; word x109; word x110; word x111; word x112; if ( ( ( (( x105 = (* (( (ptr) &var←c10548)+7)/* xx0←v5096 */ ), *(float*)&x105 ) >= ( x106 = x0←v3600, *(float*)&x106 )) ? (( x107 = (* (( (ptr) &var←c10548)+7)/* xx0←v5096 */ ), *(float*)&x107 ) <= ( x108 = x1←v3628, *(float*)&x108 )) : 0 ) ? ( (( x109 = (* (( (ptr) &var←c10548)+8)/* xx1←v5124 */ ), *(float*)&x109 ) >= ( x110 = x0←v3600, *(float*)&x110 )) ? (( x111 = (* (( (ptr) &var←c10548)+8)/* xx1←v5124 */ ), *(float*)&x111 ) <= ( x112 = x1←v3628, *(float*)&x112 )) : 0 ) : 0 ) ) { SOURCE(3735, 17) { word x113; float tf114; float tf115; word x116; float tf117; x0←v3600 = ( tf117 = FMIN(( x113 = (* (( (ptr) &var←c10548)+7)/* xx0←v5096 */ ), *(float*)&x113 ), ( x116 = (* (( (ptr) &var←c10548)+8)/* xx1←v5124 */ ), *(float*)&x116 ), tf114, tf115), *(word*)&tf117 ); }; SOURCE(3754, 17) { word x118; float tf119; float tf120; word x121; float tf122; x1←v3628 = ( tf122 = FMAX(( x118 = (* (( (ptr) &var←c10548)+7)/* xx0←v5096 */ ), *(float*)&x118 ), ( x121 = (* (( (ptr) &var←c10548)+8)/* xx1←v5124 */ ), *(float*)&x121 ), tf119, tf120), *(word*)&tf122 ); }; }; }; SOURCE(3778, 29) { word pd123; pd123 = (* (( (ptr) (* (( (ptr) gf←c10580)+21)/* var←c9812 */ ))+6) ); y0←v5012 = (word) ( *( (fPt) ((* (ptr) pd123 ))))((* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ), x0←v3600, pd123); }; SOURCE(3809, 29) { word pd124; pd124 = (* (( (ptr) (* (( (ptr) gf←c10580)+21)/* var←c9812 */ ))+6) ); y1←v5040 = (word) ( *( (fPt) ((* (ptr) pd124 ))))((* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ), x1←v3628, pd124); }; SOURCE(3840, 356) { register word noName←c10004 = 0; if ((noName←c10004 > 499)) { goto lab←L100024; }; lab←L100027: ; { word y←v5400; SOURCE(3860, 46) { word var←c0135; { word x125; word x126; word x127; *(float*)&x←v3672 = (( x125 = x0←v3600, *(float*)&x125 ) + ( x126 = x1←v3628, *(float*)&x126 )) / ( x127 = (* (ptr) &fc95 ), *(float*)&x127 ); }; var←c0135 = x←v3672; { word pd128; pd128 = (* (( (ptr) (* (( (ptr) gf←c10580)+21)/* var←c9812 */ ))+6) ); y←v5400 = (word) ( *( (fPt) ((* (ptr) pd128 ))))((* (( (ptr) &var←c10548)+4)/* poly←v3572 */ ), var←c0135, pd128); }; }; SOURCE(3908, 74) { word x129; word x130; word x131; word x132; if ((( x129 = x←v3672, *(float*)&x129 ) == ( x130 = x0←v3600, *(float*)&x130 )) || (( x131 = x←v3672, *(float*)&x131 ) == ( x132 = x1←v3628, *(float*)&x132 ))) { SOURCE(3930, 52) { float tf133; word x134; float tf135; word x136; if ((FABS(( x134 = y0←v5012, *(float*)&x134 ), tf133) < FABS(( x136 = y1←v5040, *(float*)&x136 ), tf135))) { SOURCE(3956, 16) return(x0←v3600); } else { SOURCE(3972, 10) return(x1←v3628); }; }; }; }; SOURCE(3985, 86) { word x137; word x138; word x139; word x140; word x141; word x142; word x143; word x144; if ( ( (( x137 = y←v5400, *(float*)&x137 ) > ( x138 = (* (ptr) &fc15 ), *(float*)&x138 )) ? (( x139 = y0←v5012, *(float*)&x139 ) < ( x140 = (* (ptr) &fc15 ), *(float*)&x140 )) : 0 ) || ( (( x141 = y←v5400, *(float*)&x141 ) < ( x142 = (* (ptr) &fc15 ), *(float*)&x142 )) ? (( x143 = y0←v5012, *(float*)&x143 ) > ( x144 = (* (ptr) &fc15 ), *(float*)&x144 )) : 0 ) ) { SOURCE(4035, 6) x1←v3628 = x←v3672; SOURCE(4043, 6) y1←v5040 = y←v5400; } else { SOURCE(4057, 6) x0←v3600 = x←v3672; SOURCE(4065, 6) y0←v5012 = y←v5400; }; }; SOURCE(4074, 122) { word x145; word x146; word x147; word x148; word x149; word x150; word x151; word x152; word x153; word x154; word x155; word x156; if (( ( (( x145 = y0←v5012, *(float*)&x145 ) > ( x146 = (* (ptr) &fc15 ), *(float*)&x146 )) ? (( x147 = y1←v5040, *(float*)&x147 ) > ( x148 = (* (ptr) &fc15 ), *(float*)&x148 )) : 0 ) || ( (( x149 = y0←v5012, *(float*)&x149 ) < ( x150 = (* (ptr) &fc15 ), *(float*)&x150 )) ? (( x151 = y1←v5040, *(float*)&x151 ) < ( x152 = (* (ptr) &fc15 ), *(float*)&x152 )) : 0 ) ) || ( (( x153 = y0←v5012, *(float*)&x153 ) == ( x154 = (* (ptr) &fc15 ), *(float*)&x154 )) ? 1 : (( x155 = y1←v5040, *(float*)&x155 ) == ( x156 = (* (ptr) &fc15 ), *(float*)&x156 )) ) ) { SOURCE(4144, 52) { float tf157; word x158; float tf159; word x160; if ((FABS(( x158 = y0←v5012, *(float*)&x158 ), tf157) < FABS(( x160 = y1←v5040, *(float*)&x160 ), tf159))) { SOURCE(4170, 16) return(x0←v3600); } else { SOURCE(4186, 10) return(x1←v3628); }; }; }; }; }; if ((noName←c10004 >= 499)) { goto lab←L100024; }; noName←c10004 = (noName←c10004 + 1); goto lab←L100027; lab←L100024: ; }; SOURCE(4207, 5) (void) XR←RaiseUnnamedError(); } static word NewtonStep←P972(x←v5284, formal←c10644) word x←v5284; word formal←c10644; { register ptr gf←c10612 = (ptr) &globalframe; word newx←v5328; word y←v5444; word deriv←v5472; formal←c10644 = (formal←c10644 - 20); /* NewtonStep: */ SOURCE(3123, 273) SOURCE(3178, 34) { word pd161; pd161 = (* (( (ptr) (* (( (ptr) gf←c10612)+21)/* var←c9812 */ ))+6) ); y←v5444 = (word) ( *( (fPt) ((* (ptr) pd161 ))))((* (( (ptr) formal←c10644)+4) ), x←v5284, pd161); }; SOURCE(3214, 43) { word pd162; pd162 = (* (( (ptr) (* (( (ptr) gf←c10612)+21)/* var←c9812 */ ))+24) ); deriv←v5472 = (word) ( *( (fPt) ((* (ptr) pd162 ))))((* (( (ptr) formal←c10644)+4) ), x←v5284, pd162); }; SOURCE(3259, 44) { word x163; word x164; if ((( x163 = y←v5444, *(float*)&x163 ) < ( x164 = (* (ptr) &fc15 ), *(float*)&x164 ))) { SOURCE(3272, 31) { word x165; word x166; if ((( x165 = y←v5444, *(float*)&x165 ) > ( x166 = (* (( (ptr) formal←c10644)+9) ), *(float*)&x166 ))) { SOURCE(3287, 7) (* (( (ptr) formal←c10644)+7) ) = x←v5284; SOURCE(3296, 7) (* (( (ptr) formal←c10644)+9) ) = y←v5444; }; }; }; }; SOURCE(3307, 44) { word x167; word x168; if ((( x167 = y←v5444, *(float*)&x167 ) > ( x168 = (* (ptr) &fc15 ), *(float*)&x168 ))) { SOURCE(3320, 31) { word x169; word x170; if ((( x169 = y←v5444, *(float*)&x169 ) < ( x170 = (* (( (ptr) formal←c10644)+10) ), *(float*)&x170 ))) { SOURCE(3335, 7) (* (( (ptr) formal←c10644)+8) ) = x←v5284; SOURCE(3344, 7) (* (( (ptr) formal←c10644)+10) ) = y←v5444; }; }; }; }; SOURCE(3355, 41) { word x171; word x172; word x173; word x174; word x175; word x176; word x177; if ((( x171 = deriv←v5472, *(float*)&x171 ) == ( x172 = (* (ptr) &fc15 ), *(float*)&x172 ))) { *(float*)&newx←v5328 = ( x173 = x←v5284, *(float*)&x173 ) + ( x174 = y←v5444, *(float*)&x174 ); } else { *(float*)&newx←v5328 = ( x175 = x←v5284, *(float*)&x175 ) - (( x176 = y←v5444, *(float*)&x176 ) / ( x177 = deriv←v5472, *(float*)&x177 )); }; }; SOURCE(3123, 273) return(newx←v5328); } static void Evaluate←P300(formal←c0104, a3←v3732, a2←v3760, a1←v3788, a0←v3816, b3←v3844, b2←v3872, b1←v3900, b0←v3928, u←v3956) word formal←c0104; word a3←v3732; word a2←v3760; word a1←v3788; word a0←v3816; word b3←v3844; word b2←v3872; word b1←v3900; word b0←v3928; word u←v3956; { W2 pt←v4000; /* Evaluate: */ SOURCE(4220, 159) SOURCE(4305, 36) { word x178; word x179; word x180; word x181; word x182; word x183; word x184; *(float*)&pt←v4000.f0 = (((((( x178 = a3←v3732, *(float*)&x178 ) * ( x179 = u←v3956, *(float*)&x179 )) + ( x180 = a2←v3760, *(float*)&x180 )) * ( x181 = u←v3956, *(float*)&x181 )) + ( x182 = a1←v3788, *(float*)&x182 )) * ( x183 = u←v3956, *(float*)&x183 )) + ( x184 = a0←v3816, *(float*)&x184 ); }; SOURCE(4343, 36) { word x185; word x186; word x187; word x188; word x189; word x190; word x191; *(float*)&pt←v4000.f1 = (((((( x185 = b3←v3844, *(float*)&x185 ) * ( x186 = u←v3956, *(float*)&x186 )) + ( x187 = b2←v3872, *(float*)&x187 )) * ( x188 = u←v3956, *(float*)&x188 )) + ( x189 = b1←v3900, *(float*)&x189 )) * ( x190 = u←v3956, *(float*)&x190 )) + ( x191 = b0←v3928, *(float*)&x191 ); }; /* removed tail goto */ (* (W2Pt) formal←c0104 ) = pt←v4000; return; } static word AsPolyline←P360(bezier←v4060, tolerance←v4088) W8 bezier←v4060; word tolerance←v4088; { register ptr gf←c10676 = (ptr) &globalframe; word polyline←v4132; /* AsPolyline: */ SOURCE(4435, 779) SOURCE(4435, 779) polyline←v4132 = 0; SOURCE(4530, 684) { word pd192; pd192 = (* (( (ptr) (* (( (ptr) gf←c10676)+19)/* var←c9492 */ ))+8) ); if ((0 != (word) ( *( (fPt) ((* (ptr) pd192 ))))(bezier←v4060, tolerance←v4088, pd192))) { SOURCE(4571, 49) { word var←c10036; var←c10036 = XR←NewObject(24, (* (( (ptr) gf←c10676)+4) )); (* (( (ptr) var←c10036)+1) ) = 2; polyline←v4132 = var←c10036; }; SOURCE(4622, 19) (* (ptr) polyline←v4132 ) = 2; SOURCE(4643, 23) { word limit193; (* (( (W2Pt) (( (ptr) polyline←v4132)+2))+( limit193 = (* (( (ptr) polyline←v4132)+1) ), BCK(0, limit193) )) ) = (* (W2Pt) &bezier←v4060 ); }; SOURCE(4668, 23) { word limit194; (* (( (W2Pt) (( (ptr) polyline←v4132)+2))+( limit194 = (* (( (ptr) polyline←v4132)+1) ), BCK(1, limit194) )) ) = (* (W2Pt) (( (ptr) &bezier←v4060)+6) ); }; SOURCE(4693, 6) return(polyline←v4132); } else { SOURCE(4708, 517) { W8 bezier1←v5516; W8 bezier2←v5544; word totalLength←v5572; word poly1←v5600 = 0; word poly2←v5628 = 0; SOURCE(4782, 41) { W16 var←c10068; { word pd195; pd195 = (* (( (ptr) (* (( (ptr) gf←c10676)+19)/* var←c9492 */ ))+6) ); (void) ( *( (fPt) ((* (ptr) pd195 ))))((word) &var←c10068, bezier←v4060, pd195); }; bezier2←v5544 = (* (W8Pt) (( (ptr) &var←c10068)+8) ); bezier1←v5516 = (* (W8Pt) &var←c10068 ); }; SOURCE(4825, 38) poly1←v5600 = (word) AsPolyline←P360(bezier1←v5516, tolerance←v4088); SOURCE(4865, 38) poly2←v5628 = (word) AsPolyline←P360(bezier2←v5544, tolerance←v4088); SOURCE(4905, 41) { word idx196; totalLength←v5572 = ( idx196 = (word) (((* (ptr) poly1←v5600 ) + (* (ptr) poly2←v5628 )) - 1), SGNCK(idx196) ); }; SOURCE(4948, 59) { word var←c10100; word var←c10132; var←c10100 = (totalLength←v5572 << 3); var←c10132 = XR←NewObject((8 + var←c10100), (* (( (ptr) gf←c10676)+4) )); (* (( (ptr) var←c10132)+1) ) = totalLength←v5572; polyline←v4132 = var←c10132; }; SOURCE(5009, 29) (* (ptr) polyline←v4132 ) = totalLength←v5572; SOURCE(5040, 57) { register word i←v5672 = 0; register word noName←c10164; noName←c10164 = (* (ptr) poly1←v5600 ); if ((i←v5672 >= noName←c10164)) { goto lab←L100029; }; lab←L100032: ; SOURCE(5075, 22) { word limit197; word limit198; (* (( (W2Pt) (( (ptr) polyline←v4132)+2))+( limit197 = (* (( (ptr) polyline←v4132)+1) ), BCK(i←v5672, limit197) )) ) = (* (( (W2Pt) (( (ptr) poly1←v5600)+2))+( limit198 = (* (( (ptr) poly1←v5600)+1) ), BCK(i←v5672, limit198) )) ); }; i←v5672 = (i←v5672 + 1); if ((i←v5672 < noName←c10164)) { goto lab←L100032; }; lab←L100029: ; }; SOURCE(5108, 106) { register word i←v5716 = 1; register word noName←c10196; noName←c10196 = (* (ptr) poly2←v5628 ); if ((i←v5716 >= noName←c10196)) { goto lab←L100033; }; lab←L100036: ; SOURCE(5177, 37) { word var←c10228; var←c10228 = ((i←v5716 - 1) + (* (ptr) poly1←v5600 )); { word limit199; word limit200; (* (( (W2Pt) (( (ptr) polyline←v4132)+2))+( limit199 = (* (( (ptr) polyline←v4132)+1) ), BCK(var←c10228, limit199) )) ) = (* (( (W2Pt) (( (ptr) poly2←v5628)+2))+( limit200 = (* (( (ptr) poly2←v5628)+1) ), BCK(i←v5716, limit200) )) ); }; }; i←v5716 = (i←v5716 + 1); if ((i←v5716 < noName←c10196)) { goto lab←L100036; }; lab←L100033: ; }; }; }; }; SOURCE(4435, 779) return(polyline←v4132); } /* file: GGCubic2Impl, module: GGCubic2Impl, compiled at: April 9, 1992 11:41:10 pm PDT */ extern void XR←install←GGCubic2Impl() { NoName←Q1272(); } extern void XR←run←GGCubic2Impl() { XR←Start(&globalframe); }