/* 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 #include 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); }