/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1993 by Xerox Corporation. All rights reserved. */ /* time: February 5, 1993 1:54:49 pm PST */ /* C2C version: October 7, 1992 (native) */ /* ref-counting: off */ /* file: GGCirclesImpl, module: GGCirclesImpl */ /* switches: bcfhklnouw */ #include #include static char versionStamp[] = "@(#)mob_version [375179856,1736967435] GGCirclesImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef struct {word f0, f1;} W2; typedef W2 *W2Pt; typedef word (*fPt)(); typedef struct {word f0, f1, f2, f3;} W4; typedef W4 *W4Pt; typedef struct {word f0, f1, f2, f3, f4, f5;} W6; typedef struct {word f0, f1, f2;} W3; #define SOURCE(p, l) /* source p, l */ static float fc10 = 0.0; static float fc13 = 0.5; #define FABS(f, t) ( ((t=(f)) >= (float) 0.0) ? (t) : (- (t)) ) static float fc61 = 0.000005; static float fc63 = 12.0; static float fc79 = 1.0e-5; static float fc93 = 7.2E-4; static float fc96 = -7.2E-4; #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR_RaiseBoundsFault()) : (idx) ) static float fc137 = 1.0; static float fc157 = 2.0; static float fc209 = -1.0; static float fc255 = 360.0; #define FMIN(x, y, tx, ty) ( (tx=((float) x)) <= (ty=((float) y)) ? tx : ty ) static void NoName_Q2484(); static void GGCirclesImpl_P0(); static word CreateEmptyCircle_P60(); static void CopyCircle_P120(); static void FillCircleFromPointAndRadius_P180(); static word CircleFromPointAndRadius_P240(); static void CircleFrom3Points_P300(); static word FillCircleFrom3Points_P360(); static word RatherClose_P420(); static void CircleMeetsLine_P480(); static void CircleMeetsEdge_P540(); static void CircleMeetsCircle_P600(); static void CircleMeetsArc_P660(); static word SignedCircleDistance_P720(); static word CircleDistance_P780(); static void PointProjectedOntoCircle_P840(); static word PointIsInCircle_P900(); static word CreateArc_P960(); static word CreateEmptyArc_P1020(); static void ReverseArc_P1080(); static void FillArc_P1140(); static void CopyArc_P1200(); static word CirclePointOnArc_P1260(); static void ArcMeetsLine_P1320(); static void ArcMeetsEdge_P1380(); static void ArcMeetsArc_P1440(); static void NearestEndpoint_P1500(); static word DistanceSquaredToNearestEndpoint_P1560(); static void NearestPointOnArc_P1620(); static word DistancePointToArc_P1680(); static word DistanceSquaredPointToArc_P1740(); static word OnArc_P1800(); static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\012\121\313\233\300\012\365\115\261\100\164\000\000"}; static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\012\121\313\233\300\012\365\115\261\100\200\000\000"}; static struct {unsigned f; char r[4];} string3 = {196611, "\004A\001"}; static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\026\134\312\120\300\147\210\005\013\100\164\000\000"}; static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\121\216\014\136\300\111\163\224\167\100\150\000\000"}; static struct {unsigned f; char r[16];} string6 = {851984, "\257\300\103\306\166\071\300\047\126\012\237\100\150\000\000"}; static struct {unsigned f; char r[16];} string7 = {851984, "\257\300\004\142\347\110\300\363\053\254\345\100\150\000\000"}; static struct {unsigned f; char r[16];} string8 = {851984, "\257\300\245\247\302\156\300\052\156\325\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string9 = {851984, "\257\300IKM\275\300Y\0222&@h\000\000"}; static struct { word f0[6]; 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; word f44; word f45; word f46; word f47; word f48; word f49; word f50; word f51; word f52; word f53; word f54; word f55; word f56; word f57; word f58; word f59; word f60; word f61; word f62; word f63; word f64; word f65; word f66; word f67[6]; } globalframe = { {0}, (word) OnArc_P1800, 0, (word) DistanceSquaredPointToArc_P1740, 0, (word) DistancePointToArc_P1680, 0, (word) NearestPointOnArc_P1620, 0, (word) DistanceSquaredToNearestEndpoint_P1560, 0, (word) NearestEndpoint_P1500, 0, (word) ArcMeetsArc_P1440, 0, (word) ArcMeetsEdge_P1380, 0, (word) ArcMeetsLine_P1320, 0, (word) CirclePointOnArc_P1260, 0, (word) CopyArc_P1200, 0, (word) FillArc_P1140, 0, (word) ReverseArc_P1080, 0, (word) CreateEmptyArc_P1020, 0, (word) CreateArc_P960, 0, (word) PointIsInCircle_P900, 0, (word) PointProjectedOntoCircle_P840, 0, (word) CircleDistance_P780, 0, (word) SignedCircleDistance_P720, 0, (word) CircleMeetsArc_P660, 0, (word) CircleMeetsCircle_P600, 0, (word) CircleMeetsEdge_P540, 0, (word) CircleMeetsLine_P480, 0, (word) RatherClose_P420, 0, (word) FillCircleFrom3Points_P360, 0, (word) CircleFrom3Points_P300, 0, (word) CircleFromPointAndRadius_P240, 0, (word) FillCircleFromPointAndRadius_P180, 0, (word) CopyCircle_P120, 0, (word) CreateEmptyCircle_P60, 0, (word) GGCirclesImpl_P0, {0} }; static void NoName_Q2484() { register ptr gf_c0319 = (ptr) &globalframe; word var_c19340; (* (( (ptr) gf_c0319)+4) ) = (word) XR_GetTypeIndexS((word) (&string1)); (* (( (ptr) gf_c0319)+5) ) = (word) XR_GetTypeIndex((word) &string2, 0, (word) &string3); (void) XR_DeclareGlobalFrame((word) "GGCirclesImpl", &globalframe, (word) XR_GetTypeIndexS((word) (&string4)), (word) (( (bPt) gf_c0319)+264) /* var_c17292 */ ); var_c19340 = (word) XR_ImportInterface((word) "Angles2d", (word) XR_GetTypeIndexS((word) (&string5)), 11); (* (( (ptr) gf_c0319)+71)/* var_c18636 */ ) = var_c19340; (void) XR_ImportProcS(var_c19340, 67897603); (void) XR_ImportProcS(var_c19340, 67634178); (void) XR_ImportProcS(var_c19340, 67897347); var_c19340 = (word) XR_ImportInterface((word) "Lines2d", (word) XR_GetTypeIndexS((word) (&string6)), 50); (* (( (ptr) gf_c0319)+69)/* var_c17516 */ ) = var_c19340; (void) XR_ImportProcS(var_c19340, 67905282); (void) XR_ImportProcS(var_c19340, 67905538); (void) XR_ImportProcS(var_c19340, 135014914); (void) XR_ImportProcS(var_c19340, 135013890); (void) XR_ImportProcS(var_c19340, 201859074); (void) XR_ImportProcS(var_c19340, 201858818); (void) XR_ImportProcS(var_c19340, 67906562); (void) XR_ImportProcS(var_c19340, 529922); (void) XR_ImportProcS(var_c19340, 67114240); (void) XR_ImportProcS(var_c19340, 68163330); (void) XR_ImportProcS(var_c19340, 67906306); (void) XR_ImportProcS(var_c19340, 67904002); var_c19340 = (word) XR_ImportInterface((word) "Vectors2d", (word) XR_GetTypeIndexS((word) (&string7)), 21); (* (( (ptr) gf_c0319)+68)/* var_c17356 */ ) = var_c19340; (void) XR_ImportProcS(var_c19340, 68161794); (void) XR_ImportProcS(var_c19340, 67633665); (void) XR_ImportProcS(var_c19340, 67636737); (void) XR_ImportProcS(var_c19340, 135267842); (void) XR_ImportProcS(var_c19340, 135006210); (void) XR_ImportProcS(var_c19340, 135268098); (void) XR_ImportProcS(var_c19340, 68161282); var_c19340 = (word) XR_ImportInterface((word) "RealFns", (word) XR_GetTypeIndexS((word) (&string8)), 36); (* (( (ptr) gf_c0319)+70)/* var_c17740 */ ) = var_c19340; (void) XR_ImportProcS(var_c19340, 67372289); var_c19340 = (word) XR_ExportInterface((word) "GGCircles", (word) XR_GetTypeIndexS((word) (&string9)), 29); (* (( (ptr) gf_c0319)+72)/* var_c19372 */ ) = var_c19340; (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+256)/* var_c17260 */ , 67108864); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+248)/* var_c17228 */ , 524546); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+240)/* var_c17196 */ , 1049091); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+232)/* var_c17164 */ , 67896066); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+216)/* var_c17100 */ , 68944900); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+224)/* var_c17132 */ , 135791875); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+200)/* var_c17036 */ , 403179010); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+192)/* var_c17004 */ , 403179266); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+184)/* var_c16972 */ , 403179522); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+176)/* var_c16940 */ , 403179778); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+88)/* var_c16588 */ , 403180034); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+80)/* var_c16556 */ , 403180290); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+72)/* var_c16524 */ , 403180546); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+168)/* var_c16908 */ , 67898626); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+160)/* var_c16876 */ , 67898882); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+152)/* var_c16844 */ , 135008002); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+144)/* var_c16812 */ , 67899394); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+128)/* var_c16748 */ , 67113216); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+104)/* var_c16652 */ , 528898); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+112)/* var_c16684 */ , 1839876); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+136)/* var_c16780 */ , 68686851); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+120)/* var_c16716 */ , 267521); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+96)/* var_c16620 */ , 67900930); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+64)/* var_c16492 */ , 135010050); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+56)/* var_c16460 */ , 67901442); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+48)/* var_c16428 */ , 135010562); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+40)/* var_c16396 */ , 67901954); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+32)/* var_c16364 */ , 67902210); (void) XR_ExportProcS(var_c19340, (word) (( (bPt) gf_c0319)+24)/* var_c16332 */ , 67902466); } static void GGCirclesImpl_P0(formal_c040, formal_c039) word formal_c040; word formal_c039; { /* GGCirclesImpl: */ } static word CreateEmptyCircle_P60() { register ptr gf_c19404 = (ptr) &globalframe; word circle_v3860; /* CreateEmptyCircle: */ SOURCE(469, 124) SOURCE(469, 124) circle_v3860 = 0; SOURCE(532, 61) { word var_c17324; var_c17324 = XR_NewObject(12, (* (( (ptr) gf_c19404)+4) )); (* (ptr) var_c17324 ) = (* (ptr) &fc10 ); (* (( (ptr) var_c17324)+1) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c17324)+2) ) = (* (ptr) &fc10 ); circle_v3860 = var_c17324; }; SOURCE(469, 124) return(circle_v3860); } static void CopyCircle_P120(from_v3920, to_v3948) word from_v3920; word to_v3948; { /* CopyCircle: */ SOURCE(599, 104) SOURCE(655, 23) (* (W2Pt) to_v3948 ) = (* (W2Pt) from_v3920 ); SOURCE(680, 23) (* (( (ptr) to_v3948)+2) ) = (* (( (ptr) from_v3920)+2) ); } static void FillCircleFromPointAndRadius_P180(pt_v4008, radius_v4036, circle_v4064) W2 pt_v4008; word radius_v4036; word circle_v4064; { /* FillCircleFromPointAndRadius: */ SOURCE(709, 131) SOURCE(798, 18) (* (W2Pt) circle_v4064 ) = pt_v4008; SOURCE(818, 22) (* (( (ptr) circle_v4064)+2) ) = radius_v4036; } static word CircleFromPointAndRadius_P240(pt_v4124, radius_v4152) W2 pt_v4124; word radius_v4152; { word circle_v4196; /* CircleFromPointAndRadius: */ SOURCE(846, 172) SOURCE(846, 172) circle_v4196 = 0; SOURCE(940, 28) circle_v4196 = (word) CreateEmptyCircle_P60(); SOURCE(970, 48) (void) FillCircleFromPointAndRadius_P180(pt_v4124, radius_v4152, circle_v4196); SOURCE(846, 172) return(circle_v4196); } static void CircleFrom3Points_P300(formal_c056, p0_v4256, p1_v4284, p2_v4312) word formal_c056; W2 p0_v4256; W2 p1_v4284; W2 p2_v4312; { word circle_v4356; word linear_v4384; /* CircleFrom3Points: */ SOURCE(1024, 174) SOURCE(1024, 174) circle_v4356 = 0; SOURCE(1118, 28) circle_v4356 = (word) CreateEmptyCircle_P60(); SOURCE(1148, 50) linear_v4384 = (word) FillCircleFrom3Points_P360(p0_v4256, p1_v4284, p2_v4312, circle_v4356); /* removed tail goto */ (* (ptr) formal_c056 ) = circle_v4356; (* (( (ptr) formal_c056)+1) ) = linear_v4384; return; } static word FillCircleFrom3Points_P360(p0_v4444, p1_v4472, p2_v4500, circle_v4528) W2 p0_v4444; W2 p1_v4472; W2 p2_v4500; word circle_v4528; { register ptr gf_c19436 = (ptr) &globalframe; word linear_v4572; /* FillCircleFrom3Points: */ SOURCE(1204, 1045) SOURCE(1319, 930) if (XR_EqualWords(&p0_v4444, &p2_v4500, 2)) { SOURCE(1337, 50) { word x11; word x12; word x14; *(float*)circle_v4528 = (( x11 = p0_v4444.f0, *(float*)&x11 ) + ( x12 = p1_v4472.f0, *(float*)&x12 )) * ( x14 = (* (ptr) &fc13 ), *(float*)&x14 ); }; { word x15; word x16; word x17; *(float*)(( (ptr) circle_v4528)+1) = (( x15 = p0_v4444.f1, *(float*)&x15 ) + ( x16 = p1_v4472.f1, *(float*)&x16 )) * ( x17 = (* (ptr) &fc13 ), *(float*)&x17 ); }; SOURCE(1413, 43) { word pd18; pd18 = (* (( (ptr) (* (( (ptr) gf_c19436)+68)/* var_c17356 */ ))+19) ); (* (( (ptr) circle_v4528)+2) ) = (word) ( *( (fPt) ((* (ptr) pd18 ))))((* (W2Pt) circle_v4528 ), p0_v4444, pd18); }; SOURCE(1486, 14) linear_v4572 = 0; } else { SOURCE(1509, 745) { W2 m1_v8404; W2 v1_v8432; word a1_v8460; word b1_v8488; word c1_v8516; W2 m2_v8544; W2 v2_v8572; word a2_v8600; word b2_v8628; word c2_v8656; word det_v8684; SOURCE(1511, 46) { word x19; word x20; word x21; *(float*)&m1_v8404.f0 = (( x19 = p0_v4444.f0, *(float*)&x19 ) + ( x20 = p1_v4472.f0, *(float*)&x20 )) * ( x21 = (* (ptr) &fc13 ), *(float*)&x21 ); }; { word x22; word x23; word x24; *(float*)&m1_v8404.f1 = (( x22 = p0_v4444.f1, *(float*)&x22 ) + ( x23 = p1_v4472.f1, *(float*)&x23 )) * ( x24 = (* (ptr) &fc13 ), *(float*)&x24 ); }; SOURCE(1596, 34) { word x25; word x26; *(float*)&v1_v8432.f0 = ( x25 = m1_v8404.f1, *(float*)&x25 ) - ( x26 = p0_v4444.f1, *(float*)&x26 ); }; { word x27; word x28; *(float*)&v1_v8432.f1 = ( x27 = p0_v4444.f0, *(float*)&x27 ) - ( x28 = m1_v8404.f0, *(float*)&x28 ); }; SOURCE(1678, 15) a1_v8460 = v1_v8432.f1; SOURCE(1695, 16) { word x29; *(float*)&b1_v8488 = - ( x29 = v1_v8432.f0, *(float*)&x29 ); }; SOURCE(1713, 26) { word x30; word x31; word x32; word x33; *(float*)&c1_v8516 = (( x30 = a1_v8460, *(float*)&x30 ) * ( x31 = m1_v8404.f0, *(float*)&x31 )) + (( x32 = b1_v8488, *(float*)&x32 ) * ( x33 = m1_v8404.f1, *(float*)&x33 )); }; SOURCE(1741, 46) { word x34; word x35; word x36; *(float*)&m2_v8544.f0 = (( x34 = p0_v4444.f0, *(float*)&x34 ) + ( x35 = p2_v4500.f0, *(float*)&x35 )) * ( x36 = (* (ptr) &fc13 ), *(float*)&x36 ); }; { word x37; word x38; word x39; *(float*)&m2_v8544.f1 = (( x37 = p0_v4444.f1, *(float*)&x37 ) + ( x38 = p2_v4500.f1, *(float*)&x38 )) * ( x39 = (* (ptr) &fc13 ), *(float*)&x39 ); }; SOURCE(1827, 34) { word x40; word x41; *(float*)&v2_v8572.f0 = ( x40 = m2_v8544.f1, *(float*)&x40 ) - ( x41 = p0_v4444.f1, *(float*)&x41 ); }; { word x42; word x43; *(float*)&v2_v8572.f1 = ( x42 = p0_v4444.f0, *(float*)&x42 ) - ( x43 = m2_v8544.f0, *(float*)&x43 ); }; SOURCE(1863, 15) a2_v8600 = v2_v8572.f1; SOURCE(1880, 16) { word x44; *(float*)&b2_v8628 = - ( x44 = v2_v8572.f0, *(float*)&x44 ); }; SOURCE(1898, 26) { word x45; word x46; word x47; word x48; *(float*)&c2_v8656 = (( x45 = a2_v8600, *(float*)&x45 ) * ( x46 = m2_v8544.f0, *(float*)&x46 )) + (( x47 = b2_v8628, *(float*)&x47 ) * ( x48 = m2_v8544.f1, *(float*)&x48 )); }; SOURCE(1926, 23) { word x49; word x50; word x51; word x52; *(float*)&det_v8684 = (( x49 = a1_v8460, *(float*)&x49 ) * ( x50 = b2_v8628, *(float*)&x50 )) - (( x51 = a2_v8600, *(float*)&x51 ) * ( x52 = b1_v8488, *(float*)&x52 )); }; SOURCE(1951, 298) { word x53; word x54; float tf56; word x57; float tf58; word x59; word x60; word x62; if ((( x53 = det_v8684, *(float*)&x53 ) == ( x54 = (* (ptr) &fc10 ), *(float*)&x54 ))) { goto then055;}; if ((FABS(( x57 = det_v8684, *(float*)&x57 ), tf56) < FABS((( x59 = a1_v8460, *(float*)&x59 ) * ( x60 = b2_v8628, *(float*)&x60 )), tf58) * ( x62 = (* (ptr) &fc61 ), *(float*)&x62 ))) { then055: ; SOURCE(2003, 26) (* (ptr) circle_v4528 ) = (* (ptr) &fc10 ); (* (( (ptr) circle_v4528)+1) ) = (* (ptr) &fc10 ); SOURCE(2031, 20) (* (( (ptr) circle_v4528)+2) ) = (* (ptr) &fc63 ); SOURCE(2083, 13) linear_v4572 = 1; } else { SOURCE(2107, 54) { word x64; word x65; word x66; word x67; word x68; *(float*)circle_v4528 = ((( x64 = c1_v8516, *(float*)&x64 ) * ( x65 = b2_v8628, *(float*)&x65 )) - (( x66 = c2_v8656, *(float*)&x66 ) * ( x67 = b1_v8488, *(float*)&x67 ))) / ( x68 = det_v8684, *(float*)&x68 ); }; { word x69; word x70; word x71; word x72; word x73; *(float*)(( (ptr) circle_v4528)+1) = ((( x69 = a1_v8460, *(float*)&x69 ) * ( x70 = c2_v8656, *(float*)&x70 )) - (( x71 = a2_v8600, *(float*)&x71 ) * ( x72 = c1_v8516, *(float*)&x72 ))) / ( x73 = det_v8684, *(float*)&x73 ); }; SOURCE(2190, 43) { word pd74; pd74 = (* (( (ptr) (* (( (ptr) gf_c19436)+68)/* var_c17356 */ ))+19) ); (* (( (ptr) circle_v4528)+2) ) = (word) ( *( (fPt) ((* (ptr) pd74 ))))((* (W2Pt) circle_v4528 ), p0_v4444, pd74); }; SOURCE(2235, 14) linear_v4572 = 0; }; }; }; }; SOURCE(1204, 1045) return(linear_v4572); } static word RatherClose_P420(p1_v4632, p2_v4660) W2 p1_v4632; W2 p2_v4660; { word var_c4704; /* RatherClose: */ SOURCE(2261, 142) SOURCE(2338, 65) { word tc75; float tf76; word x77; word x78; word x80; float tf81; word x82; word x83; word x84; if ((FABS((( x77 = p1_v4632.f0, *(float*)&x77 ) - ( x78 = p2_v4660.f0, *(float*)&x78 )), tf76) < ( x80 = (* (ptr) &fc79 ), *(float*)&x80 ))) { tc75 = (word) (FABS((( x82 = p1_v4632.f1, *(float*)&x82 ) - ( x83 = p2_v4660.f1, *(float*)&x83 )), tf81) < ( x84 = (* (ptr) &fc79 ), *(float*)&x84 )); } else { tc75 = (word) 0; }; return(tc75); }; } static void CircleMeetsLine_P480(formal_c0102, circle_v4764, line_v4792) word formal_c0102; word circle_v4764; word line_v4792; { register ptr gf_c19468 = (ptr) &globalframe; W4 points_v4836; word hitCount_v4864; word tangent_v4892; word d_v8772; word magD_v8800; word b_v8828; W2 p_v8856; W2 h_v8884; /* CircleMeetsLine: */ SOURCE(2409, 808) SOURCE(2409, 808) tangent_v4892 = 0; SOURCE(2627, 51) { word pd85; pd85 = (* (( (ptr) (* (( (ptr) gf_c19468)+69)/* var_c17516 */ ))+38) ); d_v8772 = (word) ( *( (fPt) ((* (ptr) pd85 ))))((* (W2Pt) circle_v4764 ), line_v4792, pd85); }; SOURCE(2680, 13) { float tf86; word x87; float tf88; magD_v8800 = ( tf88 = FABS(( x87 = d_v8772, *(float*)&x87 ), tf86), *(word*)&tf88 ); }; SOURCE(2695, 522) { word var_c17548; { word x89; word x90; *(float*)&var_c17548 = ( x89 = magD_v8800, *(float*)&x89 ) - ( x90 = (* (( (ptr) circle_v4764)+2) ), *(float*)&x90 ); }; { word x92; word x94; word x95; word x97; word x98; word x99; word x103; word x104; if ((( x92 = var_c17548, *(float*)&x92 ) > ( x94 = (* (ptr) &fc93 ), *(float*)&x94 ))) { SOURCE(2741, 12) hitCount_v4864 = 0; goto endif091; }; if ( ( (( x95 = var_c17548, *(float*)&x95 ) >= ( x97 = (* (ptr) &fc96 ), *(float*)&x97 )) ? (( x98 = var_c17548, *(float*)&x98 ) <= ( x99 = (* (ptr) &fc93 ), *(float*)&x99 )) : 0 ) ) { SOURCE(2820, 12) hitCount_v4864 = 1; SOURCE(2834, 79) { W2 var_c17580; { W2 var_c17612; { W2 var_c090; { W2 var_c17644; { word x100; *(float*)&var_c17644.f0 = - ( /*1*/ x100 = (* (( (ptr) line_v4792)+3) ), *(float*)&x100 /*1*/ ); }; var_c17644.f1 = (* (( (ptr) line_v4792)+2) ); { word pd101; pd101 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd101 ))))((word) &var_c090, var_c17644, d_v8772, pd101); }; }; var_c17612 = var_c090; }; { W2 var_c091; { word pd102; pd102 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd102 ))))((word) &var_c091, (* (W2Pt) circle_v4764 ), var_c17612, pd102); }; var_c17580 = var_c091; }; }; (* (W2Pt) &points_v4836 ) = var_c17580; }; SOURCE(2915, 14) tangent_v4892 = 1; goto endif091; }; if ((( x103 = var_c17548, *(float*)&x103 ) < ( x104 = (* (ptr) &fc96 ), *(float*)&x104 ))) { SOURCE(2971, 12) hitCount_v4864 = 2; SOURCE(2985, 71) { W2 var_c17676; { W2 var_c094; { W2 var_c17708; { word x105; *(float*)&var_c17708.f0 = - ( x105 = (* (( (ptr) line_v4792)+3) ), *(float*)&x105 ); }; var_c17708.f1 = (* (( (ptr) line_v4792)+2) ); { word pd106; pd106 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd106 ))))((word) &var_c094, var_c17708, d_v8772, pd106); }; }; var_c17676 = var_c094; }; { W2 var_c095; { word pd107; pd107 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd107 ))))((word) &var_c095, (* (W2Pt) circle_v4764 ), var_c17676, pd107); }; p_v8856 = var_c095; }; }; SOURCE(3058, 51) { word pd108; word x109; word x110; word x111; word x112; float tf113; pd108 = (* (( (ptr) (* (( (ptr) gf_c19468)+70)/* var_c17740 */ ))+9) ); b_v8828 = (word) ( *( (fPt) ((* (ptr) pd108 ))))(( tf113 = (( x109 = (* (( (ptr) circle_v4764)+2) ), *(float*)&x109 ) * ( x110 = (* (( (ptr) circle_v4764)+2) ), *(float*)&x110 )) - (( x111 = d_v8772, *(float*)&x111 ) * ( x112 = d_v8772, *(float*)&x112 )), *(word*)&tf113 ), pd108); }; SOURCE(3111, 40) { W2 var_c097; { W2 var_c17772; var_c17772.f0 = (* (( (ptr) line_v4792)+2) ); var_c17772.f1 = (* (( (ptr) line_v4792)+3) ); { word pd114; pd114 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd114 ))))((word) &var_c097, var_c17772, b_v8828, pd114); }; }; h_v8884 = var_c097; }; SOURCE(3153, 31) { W2 var_c17804; { word pd115; pd115 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd115 ))))((word) &var_c17804, p_v8856, h_v8884, pd115); }; (* (W2Pt) &points_v4836 ) = var_c17804; }; SOURCE(3186, 31) { W2 var_c17836; { word pd116; pd116 = (* (( (ptr) (* (( (ptr) gf_c19468)+68)/* var_c17356 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd116 ))))((word) &var_c17836, p_v8856, h_v8884, pd116); }; (* (W2Pt) (( (ptr) &points_v4836)+2) ) = var_c17836; }; goto endif091; }; SOURCE(3233, 5) (void) XR_RaiseUnnamedError(); goto endif091; endif091: ; }; }; /* removed tail goto */ (* (W4Pt) formal_c0102 ) = points_v4836; (* (( (ptr) formal_c0102)+4) ) = hitCount_v4864; (* (( (ptr) formal_c0102)+5) ) = tangent_v4892; return; } static void CircleMeetsEdge_P540(formal_c0115, circle_v5008, edge_v5036) word formal_c0115; word circle_v5008; word edge_v5036; { register ptr gf_c19500 = (ptr) &globalframe; W4 points_v5080; word hitCount_v5108; word tangent_v5136; word line_v8956; W4 testPoints_v8984; word testCount_v9012; /* CircleMeetsEdge: */ SOURCE(3244, 429) SOURCE(3380, 22) line_v8956 = (* (ptr) edge_v5036 ); SOURCE(3458, 64) { W6 var_c17868; (void) CircleMeetsLine_P480((word) &var_c17868, circle_v5008, line_v8956); tangent_v5136 = var_c17868.f5; testCount_v9012 = var_c17868.f4; testPoints_v8984 = (* (W4Pt) &var_c17868 ); }; SOURCE(3524, 12) hitCount_v5108 = 0; SOURCE(3538, 135) { register word i_v9112 = 1; register word noName_c17900; noName_c17900 = testCount_v9012; if ((i_v9112 > noName_c17900)) { goto lab_L100003; }; lab_L100006: ; SOURCE(3570, 103) { word pd117; pd117 = (* (( (ptr) (* (( (ptr) gf_c19500)+69)/* var_c17516 */ ))+47) ); if ((0 != (word) ( *( (fPt) ((* (ptr) pd117 ))))((* (( (W2Pt) &testPoints_v8984)+BCK((i_v9112 - 1), 2)) ), edge_v5036, pd117) )) { SOURCE(3616, 23) hitCount_v5108 = BCK((hitCount_v5108 + 1), 3); SOURCE(3641, 32) (* (( (W2Pt) &points_v5080)+BCK((hitCount_v5108 - 1), 2)) ) = (* (( (W2Pt) &testPoints_v8984)+BCK((i_v9112 - 1), 2)) ); }; }; if ((i_v9112 >= noName_c17900)) { goto lab_L100003; }; i_v9112 = (i_v9112 + 1); goto lab_L100006; lab_L100003: ; }; /* removed tail goto */ (* (W4Pt) formal_c0115 ) = points_v5080; (* (( (ptr) formal_c0115)+4) ) = hitCount_v5108; (* (( (ptr) formal_c0115)+5) ) = tangent_v5136; return; } static void CircleMeetsCircle_P600(formal_c0162, circle1_v5252, circle2_v5280) word formal_c0162; word circle1_v5252; word circle2_v5280; { register ptr gf_c19532 = (ptr) &globalframe; W4 points_v5324; word hitCount_v5352; word tangent_v5380; W2 o1ToO2_v9156; W2 o1ToO2Hat_v9184; word magO1ToO2_v9240; word outerTangent_v9268; word innerTangent_v9296; /* CircleMeetsCircle: */ SOURCE(3691, 2067) SOURCE(3691, 2067) tangent_v5380 = 0; SOURCE(3950, 160) if ((0 != (word) RatherClose_P420((* (W2Pt) circle1_v5252 ), (* (W2Pt) circle2_v5280 )))) { SOURCE(4026, 12) hitCount_v5352 = 0; SOURCE(4040, 34) { W2 var_c17932; var_c17932.f0 = (* (ptr) &fc10 ); var_c17932.f1 = (* (ptr) &fc10 ); (* (W2Pt) (( (ptr) &points_v5324)+2) ) = var_c17932; (* (W2Pt) &points_v5324 ) = var_c17932; }; SOURCE(4104, 6) goto lab_L100007; }; SOURCE(4115, 54) { word pd118; pd118 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd118 ))))((word) &o1ToO2_v9156, (* (W2Pt) circle2_v5280 ), (* (W2Pt) circle1_v5252 ), pd118) ; }; SOURCE(4171, 39) { word pd119; pd119 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+18) ); magO1ToO2_v9240 = (word) ( *( (fPt) ((* (ptr) pd119 ))))(o1ToO2_v9156, pd119); }; SOURCE(4212, 46) { word x120; word x121; *(float*)&outerTangent_v9268 = ( x120 = (* (( (ptr) circle1_v5252)+2) ), *(float*)&x120 ) + ( x121 = (* (( (ptr) circle2_v5280)+2) ), *(float*)&x121 ); }; SOURCE(4260, 51) { float tf122; word x123; word x124; float tf125; innerTangent_v9296 = ( tf125 = FABS((( x123 = (* (( (ptr) circle1_v5252)+2) ), *(float*)&x123 ) - ( x124 = (* (( (ptr) circle2_v5280)+2) ), *(float*)&x124 )), tf122), *(word*)&tf125 ); }; SOURCE(4313, 1445) { word var_c17964; var_c17964 = magO1ToO2_v9240; { word x127; word x128; word x129; word x130; word x131; word x132; word x133; word x134; word x135; word x143; word x144; word x145; word x146; word x147; word x148; word x194; word x195; word x196; word x197; word x198; word x199; word x215; word x216; word x217; if ((( x127 = var_c17964, *(float*)&x127 ) > ( x128 = outerTangent_v9268, *(float*)&x128 ) + ( x129 = (* (ptr) &fc93 ), *(float*)&x129 ))) { SOURCE(4361, 12) hitCount_v5352 = 0; goto endif0126; }; if ( ( (( x130 = var_c17964, *(float*)&x130 ) >= ( x131 = outerTangent_v9268, *(float*)&x131 ) - ( x132 = (* (ptr) &fc93 ), *(float*)&x132 )) ? (( x133 = var_c17964, *(float*)&x133 ) <= ( x134 = outerTangent_v9268, *(float*)&x134 ) + ( x135 = (* (ptr) &fc93 ), *(float*)&x135 )) : 0 ) ) { SOURCE(4482, 12) hitCount_v5352 = 1; SOURCE(4496, 14) tangent_v5380 = 1; SOURCE(4512, 50) { word pd136; word x138; word x139; float tf140; pd136 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd136 ))))((word) &o1ToO2Hat_v9184, o1ToO2_v9156, ( tf140 = ( x138 = (* (ptr) &fc137 ), *(float*)&x138 ) / ( x139 = magO1ToO2_v9240, *(float*)&x139 ), *(word*)&tf140 ), pd136); }; SOURCE(4564, 85) { W2 var_c17996; { W2 var_c18028; { word pd141; pd141 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd141 ))))((word) &var_c18028, o1ToO2Hat_v9184, (* (( (ptr) circle1_v5252)+2) ), pd141); }; { W2 var_c0133; { word pd142; pd142 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd142 ))))((word) &var_c0133, (* (W2Pt) circle1_v5252 ), var_c18028, pd142); }; var_c17996 = var_c0133; }; }; (* (W2Pt) &points_v5324 ) = var_c17996; }; goto endif0126; }; if ( ( (( x143 = var_c17964, *(float*)&x143 ) > ( x144 = innerTangent_v9296, *(float*)&x144 ) + ( x145 = (* (ptr) &fc93 ), *(float*)&x145 )) ? (( x146 = var_c17964, *(float*)&x146 ) < ( x147 = outerTangent_v9268, *(float*)&x147 ) - ( x148 = (* (ptr) &fc93 ), *(float*)&x148 )) : 0 ) ) { SOURCE(4707, 587) { W2 p_v9340; W2 normal_v9368; word s_v9396; word h_v9424; word m_v9452; word b_v9480; word a_v9508; SOURCE(4750, 24) b_v9480 = (* (( (ptr) circle1_v5252)+2) ); SOURCE(4776, 24) a_v9508 = (* (( (ptr) circle2_v5280)+2) ); SOURCE(4802, 12) hitCount_v5352 = 2; SOURCE(4816, 50) { word pd149; word x150; word x151; float tf152; pd149 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd149 ))))((word) &o1ToO2Hat_v9184, o1ToO2_v9156, ( tf152 = ( x150 = (* (ptr) &fc137 ), *(float*)&x150 ) / ( x151 = magO1ToO2_v9240, *(float*)&x151 ), *(word*)&tf152 ), pd149); }; SOURCE(4868, 27) { word x153; word x154; word x155; word x156; *(float*)&s_v9396 = ( x153 = (* (ptr) &fc13 ), *(float*)&x153 ) * ((( x154 = b_v9480, *(float*)&x154 ) + ( x155 = a_v9508, *(float*)&x155 )) + ( x156 = magO1ToO2_v9240, *(float*)&x156 )); }; SOURCE(4897, 59) { word x158; word pd159; word x160; word x161; word x162; word x163; word x164; word x165; word x166; float tf167; word x168; word x169; pd159 = (* (( (ptr) (* (( (ptr) gf_c19532)+70)/* var_c17740 */ ))+9) ); *(float*)&h_v9424 = (( x158 = (* (ptr) &fc157 ), *(float*)&x158 ) * ( x168 = (word) ( *( (fPt) ((* (ptr) pd159 ))))(( tf167 = ((( /*1*/ x160 = s_v9396, *(float*)&x160 /*1*/ ) * (( /*1*/ x161 = s_v9396, *(float*)&x161 /*1*/ ) - ( /*1*/ x162 = magO1ToO2_v9240, *(float*)&x162 /*1*/ ))) * (( /*1*/ x163 = s_v9396, *(float*)&x163 /*1*/ ) - ( /*1*/ x164 = b_v9480, *(float*)&x164 /*1*/ ))) * (( /*1*/ x165 = s_v9396, *(float*)&x165 /*1*/ ) - ( /*1*/ x166 = a_v9508, *(float*)&x166 /*1*/ )), *(word*)&tf167 ), pd159), *(float*)&x168 )) / ( x169 = magO1ToO2_v9240, *(float*)&x169 ); }; SOURCE(4958, 213) { word x170; word x171; if ((( x170 = b_v9480, *(float*)&x170 ) > ( x171 = a_v9508, *(float*)&x171 ))) { SOURCE(4974, 27) { word pd172; word x173; word x174; word x175; word x176; float tf177; pd172 = (* (( (ptr) (* (( (ptr) gf_c19532)+70)/* var_c17740 */ ))+9) ); m_v9452 = (word) ( *( (fPt) ((* (ptr) pd172 ))))(( /*1*/ tf177 = (( /*1*/ x173 = b_v9480, *(float*)&x173 /*1*/ ) * ( /*1*/ x174 = b_v9480, *(float*)&x174 /*1*/ )) - (( /*1*/ x175 = h_v9424, *(float*)&x175 /*1*/ ) * ( /*1*/ x176 = h_v9424, *(float*)&x176 /*1*/ )), *(word*)&tf177 /*1*/ ), pd172); }; SOURCE(5003, 64) { W2 var_c18060; { word pd178; pd178 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd178 ))))((word) &var_c18060, o1ToO2Hat_v9184, m_v9452, pd178); }; { W2 var_c0144; { /*1*/ word pd179; /*1*/ pd179 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+10) ); /*1*/ (void) ( *( (fPt) ((* (ptr) pd179 ))))((word) &var_c0144, (* (W2Pt) circle1_v5252 ), var_c18060, pd179); /*1*/ }; p_v9340 = var_c0144; }; }; } else { SOURCE(5078, 27) { word pd180; word x181; word x182; word x183; word x184; float tf185; pd180 = (* (( (ptr) (* (( (ptr) gf_c19532)+70)/* var_c17740 */ ))+9) ); m_v9452 = (word) ( *( (fPt) ((* (ptr) pd180 ))))(( /*1*/ tf185 = (( /*1*/ x181 = a_v9508, *(float*)&x181 /*1*/ ) * ( /*1*/ x182 = a_v9508, *(float*)&x182 /*1*/ )) - (( /*1*/ x183 = h_v9424, *(float*)&x183 /*1*/ ) * ( /*1*/ x184 = h_v9424, *(float*)&x184 /*1*/ )), *(word*)&tf185 /*1*/ ), pd180); }; SOURCE(5107, 64) { W2 var_c18092; { word pd186; pd186 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd186 ))))((word) &var_c18092, o1ToO2Hat_v9184, m_v9452, pd186); }; { W2 var_c0147; { /*1*/ word pd187; /*1*/ pd187 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+11) ); /*1*/ (void) ( *( (fPt) ((* (ptr) pd187 ))))((word) &var_c0147, (* (W2Pt) circle2_v5280 ), var_c18092, pd187); /*1*/ }; p_v9340 = var_c0147; }; }; }; }; SOURCE(5176, 40) { word x188; word x189; *(float*)&normal_v9368.f0 = ( - ( x188 = h_v9424, *(float*)&x188 )) * ( x189 = o1ToO2Hat_v9184.f1, *(float*)&x189 ); }; { word x190; word x191; *(float*)&normal_v9368.f1 = ( x190 = h_v9424, *(float*)&x190 ) * ( x191 = o1ToO2Hat_v9184.f0, *(float*)&x191 ); }; SOURCE(5218, 36) { W2 var_c18124; { word pd192; pd192 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd192 ))))((word) &var_c18124, p_v9340, normal_v9368, pd192); }; (* (W2Pt) &points_v5324 ) = var_c18124; }; SOURCE(5256, 36) { W2 var_c18156; { word pd193; pd193 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd193 ))))((word) &var_c18156, p_v9340, normal_v9368, pd193); }; (* (W2Pt) (( (ptr) &points_v5324)+2) ) = var_c18156; }; }; goto endif0126; }; if ( ( (( x194 = var_c17964, *(float*)&x194 ) >= ( x195 = innerTangent_v9296, *(float*)&x195 ) - ( x196 = (* (ptr) &fc93 ), *(float*)&x196 )) ? (( x197 = var_c17964, *(float*)&x197 ) <= ( x198 = innerTangent_v9296, *(float*)&x198 ) + ( x199 = (* (ptr) &fc93 ), *(float*)&x199 )) : 0 ) ) { SOURCE(5352, 12) hitCount_v5352 = 1; SOURCE(5366, 14) tangent_v5380 = 1; SOURCE(5382, 328) { word x200; word x201; if ((( x200 = (* (( (ptr) circle1_v5252)+2) ), *(float*)&x200 ) > ( x201 = (* (( (ptr) circle2_v5280)+2) ), *(float*)&x201 ))) { SOURCE(5424, 50) { word pd202; word x203; word x204; float tf205; pd202 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd202 ))))((word) &o1ToO2Hat_v9184, o1ToO2_v9156, ( tf205 = ( /*1*/ x203 = (* (ptr) &fc137 ), *(float*)&x203 /*1*/ ) / ( /*1*/ x204 = magO1ToO2_v9240, *(float*)&x204 /*1*/ ), *(word*)&tf205 ), pd202); }; SOURCE(5476, 85) { W2 var_c18188; { W2 var_c18220; { word pd206; pd206 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd206 ))))((word) &var_c18220, o1ToO2Hat_v9184, (* (( (ptr) circle1_v5252)+2) ), pd206); }; { W2 var_c0156; { /*1*/ word pd207; /*1*/ pd207 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+10) ); /*1*/ (void) ( *( (fPt) ((* (ptr) pd207 ))))((word) &var_c0156, (* (W2Pt) circle1_v5252 ), var_c18220, pd207); /*1*/ }; var_c18188 = var_c0156; }; }; (* (W2Pt) &points_v5324 ) = var_c18188; }; } else { SOURCE(5572, 51) { word pd208; word x210; word x211; float tf212; pd208 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd208 ))))((word) &o1ToO2Hat_v9184, o1ToO2_v9156, ( tf212 = ( /*1*/ x210 = (* (ptr) &fc209 ), *(float*)&x210 /*1*/ ) / ( /*1*/ x211 = magO1ToO2_v9240, *(float*)&x211 /*1*/ ), *(word*)&tf212 ), pd208); }; SOURCE(5625, 85) { W2 var_c18252; { W2 var_c18284; { word pd213; pd213 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd213 ))))((word) &var_c18284, o1ToO2Hat_v9184, (* (( (ptr) circle2_v5280)+2) ), pd213); }; { W2 var_c0161; { /*1*/ word pd214; /*1*/ pd214 = (* (( (ptr) (* (( (ptr) gf_c19532)+68)/* var_c17356 */ ))+10) ); /*1*/ (void) ( *( (fPt) ((* (ptr) pd214 ))))((word) &var_c0161, (* (W2Pt) circle2_v5280 ), var_c18284, pd214); /*1*/ }; var_c18252 = var_c0161; }; }; (* (W2Pt) &points_v5324 ) = var_c18252; }; }; }; goto endif0126; }; if ((( x215 = var_c17964, *(float*)&x215 ) < ( x216 = innerTangent_v9296, *(float*)&x216 ) - ( x217 = (* (ptr) &fc93 ), *(float*)&x217 ))) { SOURCE(5746, 12) hitCount_v5352 = 0; goto endif0126; }; SOURCE(5774, 5) (void) XR_RaiseUnnamedError(); goto endif0126; endif0126: ; }; }; /* removed tail goto */ lab_L100007: ; (* (W4Pt) formal_c0162 ) = points_v5324; (* (( (ptr) formal_c0162)+4) ) = hitCount_v5352; (* (( (ptr) formal_c0162)+5) ) = tangent_v5380; return; } static void CircleMeetsArc_P660(formal_c0176, circle_v5496, arc_v5524) word formal_c0176; word circle_v5496; word arc_v5524; { W4 points_v5568; word hitCount_v5596; word tangent_v5624; /* CircleMeetsArc: */ SOURCE(5785, 456) SOURCE(5917, 324) if (((* (( (ptr) arc_v5524)+8) ) != 0)) { SOURCE(5940, 69) { W6 var_c18316; (void) CircleMeetsEdge_P540((word) &var_c18316, circle_v5496, (* (( (ptr) arc_v5524)+8) )); tangent_v5624 = var_c18316.f5; hitCount_v5596 = var_c18316.f4; points_v5568 = (* (W4Pt) &var_c18316 ); }; } else { SOURCE(6009, 246) { W4 pts_v9552; word hCount_v9580; SOURCE(6055, 62) { W6 var_c18348; (void) CircleMeetsCircle_P600((word) &var_c18348, circle_v5496, (* (ptr) arc_v5524 )); tangent_v5624 = var_c18348.f5; hCount_v9580 = var_c18348.f4; pts_v9552 = (* (W4Pt) &var_c18348 ); }; SOURCE(6119, 12) hitCount_v5596 = 0; SOURCE(6133, 108) { register word i_v9680 = 1; register word noName_c18380; noName_c18380 = hCount_v9580; if ((i_v9680 > noName_c18380)) { goto lab_L100009; }; lab_L100012: ; SOURCE(6162, 79) if ((0 != (word) OnArc_P1800((* (( (W2Pt) &pts_v9552)+BCK((i_v9680 - 1), 2)) ), arc_v5524))) { SOURCE(6191, 23) hitCount_v5596 = BCK((hitCount_v5596 + 1), 3); SOURCE(6216, 25) (* (( (W2Pt) &points_v5568)+BCK((hitCount_v5596 - 1), 2)) ) = (* (( (W2Pt) &pts_v9552)+BCK((i_v9680 - 1), 2)) ); }; if ((i_v9680 >= noName_c18380)) { goto lab_L100009; }; i_v9680 = (i_v9680 + 1); goto lab_L100012; lab_L100009: ; }; }; }; /* removed tail goto */ (* (W4Pt) formal_c0176 ) = points_v5568; (* (( (ptr) formal_c0176)+4) ) = hitCount_v5596; (* (( (ptr) formal_c0176)+5) ) = tangent_v5624; return; } static word SignedCircleDistance_P720(pt_v5740, circle_v5768) W2 pt_v5740; word circle_v5768; { register ptr gf_c19564 = (ptr) &globalframe; word d_v5812; word originToPoint_v9724; /* SignedCircleDistance: */ SOURCE(6262, 210) SOURCE(6368, 69) { W2 var_c18412; { word pd218; pd218 = (* (( (ptr) (* (( (ptr) gf_c19564)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd218 ))))((word) &var_c18412, pt_v5740, (* (W2Pt) circle_v5768 ), pd218); }; { word pd219; pd219 = (* (( (ptr) (* (( (ptr) gf_c19564)+68)/* var_c17356 */ ))+18) ); originToPoint_v9724 = (word) ( *( (fPt) ((* (ptr) pd219 ))))(var_c18412, pd219); }; }; SOURCE(6439, 33) { word x220; word x221; *(float*)&d_v5812 = ( x220 = originToPoint_v9724, *(float*)&x220 ) - ( x221 = (* (( (ptr) circle_v5768)+2) ), *(float*)&x221 ); }; SOURCE(6262, 210) return(d_v5812); } static word CircleDistance_P780(pt_v5872, circle_v5900) W2 pt_v5872; word circle_v5900; { word d_v5944; /* CircleDistance: */ SOURCE(6478, 120) SOURCE(6557, 41) { float tf222; word x223; float tf224; d_v5944 = ( tf224 = FABS(( x223 = (word) SignedCircleDistance_P720(pt_v5872, circle_v5900), *(float*)&x223 ), tf222), *(word*)&tf224 ); }; SOURCE(6478, 120) return(d_v5944); } static void PointProjectedOntoCircle_P840(formal_c0195, pt_v6004, circle_v6032) word formal_c0195; W2 pt_v6004; word circle_v6032; { register ptr gf_c19596 = (ptr) &globalframe; W2 projectedPt_v6076; W2 originToPoint_v9796; word magOriginToPoint_v9824; /* PointProjectedOntoCircle: */ SOURCE(6604, 496) SOURCE(6775, 48) { word pd225; pd225 = (* (( (ptr) (* (( (ptr) gf_c19596)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd225 ))))((word) &originToPoint_v9796, pt_v6004, (* (W2Pt) circle_v6032 ), pd225); }; SOURCE(6825, 53) { word pd226; pd226 = (* (( (ptr) (* (( (ptr) gf_c19596)+68)/* var_c17356 */ ))+18) ); magOriginToPoint_v9824 = (word) ( *( (fPt) ((* (ptr) pd226 ))))(originToPoint_v9796, pd226); }; SOURCE(6880, 109) { word x227; word x228; if ((( x227 = magOriginToPoint_v9824, *(float*)&x227 ) < ( x228 = (* (ptr) &fc79 ), *(float*)&x228 ))) { SOURCE(6917, 64) { word x229; word x230; *(float*)&projectedPt_v6076.f0 = ( x229 = (* (ptr) circle_v6032 ), *(float*)&x229 ) + ( x230 = (* (( (ptr) circle_v6032)+2) ), *(float*)&x230 ); }; projectedPt_v6076.f1 = (* (( (ptr) circle_v6032)+1) ); SOURCE(6983, 6) goto lab_L100013; }; }; SOURCE(6994, 106) { W2 var_c18444; { word pd231; word x232; word x233; float tf234; pd231 = (* (( (ptr) (* (( (ptr) gf_c19596)+68)/* var_c17356 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd231 ))))((word) &var_c18444, originToPoint_v9796, ( tf234 = ( x232 = (* (( (ptr) circle_v6032)+2) ), *(float*)&x232 ) / ( x233 = magOriginToPoint_v9824, *(float*)&x233 ), *(word*)&tf234 ), pd231); }; { W2 var_c0194; { word pd235; pd235 = (* (( (ptr) (* (( (ptr) gf_c19596)+68)/* var_c17356 */ ))+10) ); (void) ( *( (fPt) ((* (ptr) pd235 ))))((word) &var_c0194, (* (W2Pt) circle_v6032 ), var_c18444, pd235); }; projectedPt_v6076 = var_c0194; }; }; /* removed tail goto */ lab_L100013: ; (* (W2Pt) formal_c0195 ) = projectedPt_v6076; return; } static word PointIsInCircle_P900(pt_v6136, circle_v6164) W2 pt_v6136; word circle_v6164; { word var_c6208; word deltaX_v9868; word deltaY_v9896; /* PointIsInCircle: */ SOURCE(7105, 230) SOURCE(7204, 31) { word x236; word x237; *(float*)&deltaX_v9868 = ( x236 = pt_v6136.f0, *(float*)&x236 ) - ( x237 = (* (ptr) circle_v6164 ), *(float*)&x237 ); }; SOURCE(7237, 31) { word x238; word x239; *(float*)&deltaY_v9896 = ( x238 = pt_v6136.f1, *(float*)&x238 ) - ( x239 = (* (( (ptr) circle_v6164)+1) ), *(float*)&x239 ); }; SOURCE(7270, 65) { word x240; word x241; word x242; word x243; word x244; word x245; return(((( x240 = deltaX_v9868, *(float*)&x240 ) * ( x241 = deltaX_v9868, *(float*)&x241 )) + (( x242 = deltaY_v9896, *(float*)&x242 ) * ( x243 = deltaY_v9896, *(float*)&x243 )) < ( x244 = (* (( (ptr) circle_v6164)+2) ), *(float*)&x244 ) * ( x245 = (* (( (ptr) circle_v6164)+2) ), *(float*)&x245 ))); }; } static word CreateArc_P960(v0_v6268, v1_v6296, v2_v6324) W2 v0_v6268; W2 v1_v6296; W2 v2_v6324; { word arc_v6368; /* CreateArc: */ SOURCE(7342, 115) SOURCE(7342, 115) arc_v6368 = 0; SOURCE(7409, 22) arc_v6368 = (word) CreateEmptyArc_P1020(); SOURCE(7433, 24) (void) FillArc_P1140(v0_v6268, v1_v6296, v2_v6324, arc_v6368); SOURCE(7342, 115) return(arc_v6368); } static word CreateEmptyArc_P1020() { register ptr gf_c19628 = (ptr) &globalframe; word arc_v6428; /* CreateEmptyArc: */ SOURCE(7463, 175) SOURCE(7463, 175) arc_v6428 = 0; SOURCE(7517, 121) { word var_c18476; word var_c18508; var_c18476 = (word) CreateEmptyCircle_P60(); var_c18508 = XR_NewObject(36, (* (( (ptr) gf_c19628)+5) )); (* (ptr) var_c18508 ) = var_c18476; (* (( (ptr) var_c18508)+2) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c18508)+3) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c18508)+4) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c18508)+5) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c18508)+6) ) = (* (ptr) &fc10 ); (* (( (ptr) var_c18508)+7) ) = (* (ptr) &fc10 ); arc_v6428 = var_c18508; }; SOURCE(7463, 175) return(arc_v6428); } static void ReverseArc_P1080(arc_v6488) word arc_v6488; { /* ReverseArc: */ SOURCE(7644, 134) SOURCE(7683, 21) (* (( (ptr) arc_v6488)+1) ) = (0 == (* (( (ptr) arc_v6488)+1) )); SOURCE(7706, 72) if (((* (( (ptr) arc_v6488)+8) ) != 0)) { SOURCE(7729, 49) (* (( (ptr) (* (( (ptr) arc_v6488)+8) ))+1) ) = (0 == (* (( (ptr) (* (( (ptr) arc_v6488)+8) ))+1) )); }; } static void FillArc_P1140(v0_v6548, v1_v6576, v2_v6604, arc_v6632) W2 v0_v6548; W2 v1_v6576; W2 v2_v6604; word arc_v6632; { register ptr gf_c19660 = (ptr) &globalframe; word theta0_v9940; word theta1_v9968; word theta2_v9996; word deltaTheta_v10024; W2 vector0_v10052; W2 vector1_v10080; W2 vector2_v10108; word linear_v10136; /* FillArc: */ SOURCE(7874, 1204) SOURCE(8021, 54) linear_v10136 = (word) FillCircleFrom3Points_P360(v0_v6548, v1_v6576, v2_v6604, (* (ptr) arc_v6632 )); SOURCE(8077, 1001) if ((0 != linear_v10136)) { SOURCE(8094, 118) { word var_c18540; { word pd246; pd246 = (* (( (ptr) (* (( (ptr) gf_c19660)+69)/* var_c17516 */ ))+27) ); var_c18540 = (word) ( *( (fPt) ((* (ptr) pd246 ))))(v0_v6548, v2_v6604, pd246); }; { word var_c18572; var_c18572 = (* (ptr) arc_v6632 ); (* (ptr) arc_v6632 ) = var_c18572; (* (( (ptr) arc_v6632)+1) ) = 1; (* (W2Pt) (( (ptr) arc_v6632)+2) ) = v0_v6548; (* (W2Pt) (( (ptr) arc_v6632)+4) ) = v2_v6604; (* (( (ptr) arc_v6632)+6) ) = (* (ptr) &fc10 ); (* (( (ptr) arc_v6632)+7) ) = (* (ptr) &fc10 ); (* (( (ptr) arc_v6632)+8) ) = var_c18540; }; }; } else { SOURCE(8223, 46) { word pd247; pd247 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd247 ))))((word) &vector0_v10052, v0_v6548, (* (W2Pt) (* (ptr) arc_v6632 ) ), pd247); }; SOURCE(8271, 43) { word pd248; pd248 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+6) ); theta0_v9940 = (word) ( *( (fPt) ((* (ptr) pd248 ))))(vector0_v10052, pd248); }; SOURCE(8316, 46) { word pd249; pd249 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd249 ))))((word) &vector1_v10080, v1_v6576, (* (W2Pt) (* (ptr) arc_v6632 ) ), pd249); }; SOURCE(8364, 43) { word pd250; pd250 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+6) ); theta1_v9968 = (word) ( *( (fPt) ((* (ptr) pd250 ))))(vector1_v10080, pd250); }; SOURCE(8409, 46) { word pd251; pd251 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd251 ))))((word) &vector2_v10108, v2_v6604, (* (W2Pt) (* (ptr) arc_v6632 ) ), pd251); }; SOURCE(8457, 43) { word pd252; pd252 = (* (( (ptr) (* (( (ptr) gf_c19660)+68)/* var_c17356 */ ))+6) ); theta2_v9996 = (word) ( *( (fPt) ((* (ptr) pd252 ))))(vector2_v10108, pd252); }; SOURCE(8502, 576) { word x253; word x254; if ((( x253 = theta0_v9940, *(float*)&x253 ) == ( x254 = theta2_v9996, *(float*)&x254 ))) { SOURCE(8528, 18) deltaTheta_v10024 = (* (ptr) &fc255 ); SOURCE(8548, 105) { word var_c18604; var_c18604 = (* (ptr) arc_v6632 ); (* (ptr) arc_v6632 ) = var_c18604; (* (( (ptr) arc_v6632)+1) ) = 1; (* (W2Pt) (( (ptr) arc_v6632)+2) ) = v0_v6548; (* (W2Pt) (( (ptr) arc_v6632)+4) ) = v2_v6604; (* (( (ptr) arc_v6632)+6) ) = theta0_v9940; (* (( (ptr) arc_v6632)+7) ) = deltaTheta_v10024; (* (( (ptr) arc_v6632)+8) ) = 0; }; } else { SOURCE(8664, 414) { word pd256; pd256 = (* (( (ptr) (* (( (ptr) gf_c19660)+71)/* var_c18636 */ ))+12) ); if ((0 != (word) ( *( (fPt) ((* (ptr) pd256 ))))(theta1_v9968, theta0_v9940, theta2_v9996, pd256))) { SOURCE(8734, 59) { word pd257; pd257 = (* (( (ptr) (* (( (ptr) gf_c19660)+71)/* var_c18636 */ ))+8) ); deltaTheta_v10024 = (word) ( *( (fPt) ((* (ptr) pd257 ))))(theta0_v9940, theta2_v9996, pd257); }; SOURCE(8795, 105) { word var_c18668; var_c18668 = (* (ptr) arc_v6632 ); (* (ptr) arc_v6632 ) = var_c18668; (* (( (ptr) arc_v6632)+1) ) = 1; (* (W2Pt) (( (ptr) arc_v6632)+2) ) = v0_v6548; (* (W2Pt) (( (ptr) arc_v6632)+4) ) = v2_v6604; (* (( (ptr) arc_v6632)+6) ) = theta0_v9940; (* (( (ptr) arc_v6632)+7) ) = deltaTheta_v10024; (* (( (ptr) arc_v6632)+8) ) = 0; }; } else { SOURCE(8911, 59) { word pd258; pd258 = (* (( (ptr) (* (( (ptr) gf_c19660)+71)/* var_c18636 */ ))+8) ); deltaTheta_v10024 = (word) ( *( (fPt) ((* (ptr) pd258 ))))(theta2_v9996, theta0_v9940, pd258); }; SOURCE(8972, 106) { word var_c18700; var_c18700 = (* (ptr) arc_v6632 ); (* (ptr) arc_v6632 ) = var_c18700; (* (( (ptr) arc_v6632)+1) ) = 0; (* (W2Pt) (( (ptr) arc_v6632)+2) ) = v2_v6604; (* (W2Pt) (( (ptr) arc_v6632)+4) ) = v0_v6548; (* (( (ptr) arc_v6632)+6) ) = theta2_v9996; (* (( (ptr) arc_v6632)+7) ) = deltaTheta_v10024; (* (( (ptr) arc_v6632)+8) ) = 0; }; }; }; }; }; }; } static void CopyArc_P1200(from_v6692, to_v6720) word from_v6692; word to_v6720; { register ptr gf_c19692 = (ptr) &globalframe; /* CopyArc: */ SOURCE(9093, 302) SOURCE(9139, 34) (void) CopyCircle_P120((* (ptr) from_v6692 ), (* (ptr) to_v6720 )); SOURCE(9175, 17) (* (( (ptr) to_v6720)+1) ) = (* (( (ptr) from_v6692)+1) ); SOURCE(9194, 15) (* (W2Pt) (( (ptr) to_v6720)+2) ) = (* (W2Pt) (( (ptr) from_v6692)+2) ); SOURCE(9211, 15) (* (W2Pt) (( (ptr) to_v6720)+4) ) = (* (W2Pt) (( (ptr) from_v6692)+4) ); SOURCE(9228, 23) (* (( (ptr) to_v6720)+6) ) = (* (( (ptr) from_v6692)+6) ); SOURCE(9253, 31) (* (( (ptr) to_v6720)+7) ) = (* (( (ptr) from_v6692)+7) ); SOURCE(9286, 109) if (((* (( (ptr) from_v6692)+8) ) != 0)) { SOURCE(9312, 35) { word pd259; pd259 = (* (( (ptr) (* (( (ptr) gf_c19692)+69)/* var_c17516 */ ))+25) ); (* (( (ptr) to_v6720)+8) ) = (word) ( *( (fPt) ((* (ptr) pd259 ))))(pd259); }; SOURCE(9349, 46) { word pd260; pd260 = (* (( (ptr) (* (( (ptr) gf_c19692)+69)/* var_c17516 */ ))+26) ); (void) ( *( (fPt) ((* (ptr) pd260 ))))((* (( (ptr) from_v6692)+8) ), (* (( (ptr) to_v6720)+8) ), pd260); }; }; } static word CirclePointOnArc_P1260(pt_v6780, arc_v6808) W2 pt_v6780; word arc_v6808; { register ptr gf_c19724 = (ptr) &globalframe; word var_c6852; W2 direction_v10180; word angle_v10208; /* CirclePointOnArc: */ SOURCE(9404, 320) SOURCE(9476, 56) { word pd261; pd261 = (* (( (ptr) (* (( (ptr) gf_c19724)+68)/* var_c17356 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd261 ))))((word) &direction_v10180, pt_v6780, (* (W2Pt) (* (ptr) arc_v6808 ) ), pd261); }; SOURCE(9534, 50) { word pd262; pd262 = (* (( (ptr) (* (( (ptr) gf_c19724)+68)/* var_c17356 */ ))+6) ); angle_v10208 = (word) ( *( (fPt) ((* (ptr) pd262 ))))(direction_v10180, pd262); }; SOURCE(9586, 68) if (((* (( (ptr) arc_v6808)+8) ) != 0)) { SOURCE(9609, 45) { word pd263; pd263 = (* (( (ptr) (* (( (ptr) gf_c19724)+69)/* var_c17516 */ ))+48) ); return((word) ( *( (fPt) ((* (ptr) pd263 ))))(pt_v6780, (* (( (ptr) arc_v6808)+8) ), pd263)); }; }; SOURCE(9656, 68) { word pd264; pd264 = (* (( (ptr) (* (( (ptr) gf_c19724)+71)/* var_c18636 */ ))+13) ); return((word) ( *( (fPt) ((* (ptr) pd264 ))))(angle_v10208, (* (( (ptr) arc_v6808)+6) ), (* (( (ptr) arc_v6808)+7) ), pd264) ); }; } static void ArcMeetsLine_P1320(formal_c0251, arc_v6912, line_v6940) word formal_c0251; word arc_v6912; word line_v6940; { register ptr gf_c19756 = (ptr) &globalframe; W4 points_v6984; word hitCount_v7012; word tangent_v7040; /* ArcMeetsLine: */ SOURCE(9730, 502) SOURCE(9730, 502) tangent_v7040 = 0; SOURCE(9864, 368) if (((* (( (ptr) arc_v6912)+8) ) != 0)) { SOURCE(9887, 110) { word noHit_v10252; SOURCE(9902, 58) { W3 var_c18796; { word pd265; pd265 = (* (( (ptr) (* (( (ptr) gf_c19756)+69)/* var_c17516 */ ))+35) ); (void) ( *( (fPt) ((* (ptr) pd265 ))))((word) &var_c18796, line_v6940, (* (( (ptr) arc_v6912)+8) ), pd265); }; noHit_v10252 = var_c18796.f2; (* (W2Pt) &points_v6984 ) = (* (W2Pt) &var_c18796 ); }; SOURCE(9962, 33) { word idx266; hitCount_v7012 = ( idx266 = (word) ( (0 != noHit_v10252) ? 0 : 1 ) , BCK(idx266, 3) ); }; }; } else { SOURCE(10004, 242) { W4 pts_v10296; word hCount_v10324; SOURCE(10050, 58) { W6 var_c18828; (void) CircleMeetsLine_P480((word) &var_c18828, (* (ptr) arc_v6912 ), line_v6940); tangent_v7040 = var_c18828.f5; hCount_v10324 = var_c18828.f4; pts_v10296 = (* (W4Pt) &var_c18828 ); }; SOURCE(10110, 12) hitCount_v7012 = 0; SOURCE(10124, 108) { register word i_v10424 = 1; register word noName_c18860; noName_c18860 = hCount_v10324; if ((i_v10424 > noName_c18860)) { goto lab_L100015; }; lab_L100018: ; SOURCE(10153, 79) if ((0 != (word) OnArc_P1800((* (( (W2Pt) &pts_v10296)+BCK((i_v10424 - 1), 2)) ), arc_v6912))) { SOURCE(10182, 23) hitCount_v7012 = BCK((hitCount_v7012 + 1), 3); SOURCE(10207, 25) (* (( (W2Pt) &points_v6984)+BCK((hitCount_v7012 - 1), 2)) ) = (* (( (W2Pt) &pts_v10296)+BCK((i_v10424 - 1), 2)) ); }; if ((i_v10424 >= noName_c18860)) { goto lab_L100015; }; i_v10424 = (i_v10424 + 1); goto lab_L100018; lab_L100015: ; }; }; }; /* removed tail goto */ (* (W4Pt) formal_c0251 ) = points_v6984; (* (( (ptr) formal_c0251)+4) ) = hitCount_v7012; (* (( (ptr) formal_c0251)+5) ) = tangent_v7040; return; } static void ArcMeetsEdge_P1380(formal_c0266, arc_v7156, edge_v7184) word formal_c0266; word arc_v7156; word edge_v7184; { register ptr gf_c19788 = (ptr) &globalframe; W4 points_v7228; word hitCount_v7256; word tangent_v7284; /* ArcMeetsEdge: */ SOURCE(10253, 502) SOURCE(10253, 502) tangent_v7284 = 0; SOURCE(10387, 368) if (((* (( (ptr) arc_v7156)+8) ) != 0)) { SOURCE(10410, 110) { word noHit_v10468; SOURCE(10425, 58) { W3 var_c18892; { word pd267; pd267 = (* (( (ptr) (* (( (ptr) gf_c19788)+69)/* var_c17516 */ ))+36) ); (void) ( *( (fPt) ((* (ptr) pd267 ))))((word) &var_c18892, edge_v7184, (* (( (ptr) arc_v7156)+8) ), pd267); }; noHit_v10468 = var_c18892.f2; (* (W2Pt) &points_v7228 ) = (* (W2Pt) &var_c18892 ); }; SOURCE(10485, 33) { word idx268; hitCount_v7256 = ( idx268 = (word) ( (0 != noHit_v10468) ? 0 : 1 ) , BCK(idx268, 3) ); }; }; } else { SOURCE(10527, 242) { W4 pts_v10512; word hCount_v10540; SOURCE(10573, 58) { W6 var_c18924; (void) CircleMeetsEdge_P540((word) &var_c18924, (* (ptr) arc_v7156 ), edge_v7184); tangent_v7284 = var_c18924.f5; hCount_v10540 = var_c18924.f4; pts_v10512 = (* (W4Pt) &var_c18924 ); }; SOURCE(10633, 12) hitCount_v7256 = 0; SOURCE(10647, 108) { register word i_v10640 = 1; register word noName_c18956; noName_c18956 = hCount_v10540; if ((i_v10640 > noName_c18956)) { goto lab_L100020; }; lab_L100023: ; SOURCE(10676, 79) if ((0 != (word) OnArc_P1800((* (( (W2Pt) &pts_v10512)+BCK((i_v10640 - 1), 2)) ), arc_v7156))) { SOURCE(10705, 23) hitCount_v7256 = BCK((hitCount_v7256 + 1), 3); SOURCE(10730, 25) (* (( (W2Pt) &points_v7228)+BCK((hitCount_v7256 - 1), 2)) ) = (* (( (W2Pt) &pts_v10512)+BCK((i_v10640 - 1), 2)) ); }; if ((i_v10640 >= noName_c18956)) { goto lab_L100020; }; i_v10640 = (i_v10640 + 1); goto lab_L100023; lab_L100020: ; }; }; }; /* removed tail goto */ (* (W4Pt) formal_c0266 ) = points_v7228; (* (( (ptr) formal_c0266)+4) ) = hitCount_v7256; (* (( (ptr) formal_c0266)+5) ) = tangent_v7284; return; } static void ArcMeetsArc_P1440(formal_c0280, arc1_v7400, arc2_v7428) word formal_c0280; word arc1_v7400; word arc2_v7428; { W4 points_v7472; word hitCount_v7500; word tangent_v7528; /* ArcMeetsArc: */ SOURCE(10776, 438) SOURCE(10896, 318) if (((* (( (ptr) arc1_v7400)+8) ) != 0)) { SOURCE(10920, 65) { W6 var_c18988; (void) ArcMeetsEdge_P1380((word) &var_c18988, arc2_v7428, (* (( (ptr) arc1_v7400)+8) )); tangent_v7528 = var_c18988.f5; hitCount_v7500 = var_c18988.f4; points_v7472 = (* (W4Pt) &var_c18988 ); }; } else { SOURCE(10985, 243) { W4 pts_v10684; word hCount_v10712; SOURCE(11031, 58) { W6 var_c19020; (void) CircleMeetsArc_P660((word) &var_c19020, (* (ptr) arc1_v7400 ), arc2_v7428); tangent_v7528 = var_c19020.f5; hCount_v10712 = var_c19020.f4; pts_v10684 = (* (W4Pt) &var_c19020 ); }; SOURCE(11091, 12) hitCount_v7500 = 0; SOURCE(11105, 109) { register word i_v10812 = 1; register word noName_c19052; noName_c19052 = hCount_v10712; if ((i_v10812 > noName_c19052)) { goto lab_L100025; }; lab_L100028: ; SOURCE(11134, 80) if ((0 != (word) OnArc_P1800((* (( (W2Pt) &pts_v10684)+BCK((i_v10812 - 1), 2)) ), arc1_v7400))) { SOURCE(11164, 23) hitCount_v7500 = BCK((hitCount_v7500 + 1), 3); SOURCE(11189, 25) (* (( (W2Pt) &points_v7472)+BCK((hitCount_v7500 - 1), 2)) ) = (* (( (W2Pt) &pts_v10684)+BCK((i_v10812 - 1), 2)) ); }; if ((i_v10812 >= noName_c19052)) { goto lab_L100025; }; i_v10812 = (i_v10812 + 1); goto lab_L100028; lab_L100025: ; }; }; }; /* removed tail goto */ (* (W4Pt) formal_c0280 ) = points_v7472; (* (( (ptr) formal_c0280)+4) ) = hitCount_v7500; (* (( (ptr) formal_c0280)+5) ) = tangent_v7528; return; } static void NearestEndpoint_P1500(formal_c0288, pt_v7644, arc_v7672) word formal_c0288; W2 pt_v7644; word arc_v7672; { register ptr gf_c19820 = (ptr) &globalframe; W2 endpoint_v7716; /* NearestEndpoint: */ SOURCE(11235, 522) SOURCE(11317, 68) if (((* (( (ptr) arc_v7672)+8) ) != 0)) { SOURCE(11340, 45) { W2 var_c19116; { word pd269; pd269 = (* (( (ptr) (* (( (ptr) gf_c19820)+69)/* var_c17516 */ ))+42) ); (void) ( *( (fPt) ((* (ptr) pd269 ))))((word) &var_c19116, pt_v7644, (* (( (ptr) arc_v7672)+8) ), pd269); }; endpoint_v7716 = var_c19116; goto lab_L100029; }; }; SOURCE(11387, 370) SOURCE(11393, 207) { float tf270; word x271; word x272; float tf273; word x274; word x275; if ((FABS((( x271 = pt_v7644.f0, *(float*)&x271 ) - ( x272 = (* (( (ptr) arc_v7672)+2) ), *(float*)&x272 )), tf270) <= FABS((( x274 = pt_v7644.f0, *(float*)&x274 ) - ( x275 = (* (( (ptr) arc_v7672)+4) ), *(float*)&x275 )), tf273))) { SOURCE(11444, 69) { float tf276; word x277; word x278; float tf279; word x280; word x281; if ((FABS((( x277 = pt_v7644.f1, *(float*)&x277 ) - ( x278 = (* (( (ptr) arc_v7672)+3) ), *(float*)&x278 )), tf276) <= FABS((( x280 = pt_v7644.f1, *(float*)&x280 ) - ( x281 = (* (( (ptr) arc_v7672)+5) ), *(float*)&x281 )), tf279))) { SOURCE(11493, 20) endpoint_v7716 = (* (W2Pt) (( (ptr) arc_v7672)+2) ); goto lab_L100029; } else { SOURCE(11513, 12) goto lab_L100030; }; }; } else { SOURCE(11532, 68) { float tf282; word x283; word x284; float tf285; word x286; word x287; if ((FABS((( x283 = pt_v7644.f1, *(float*)&x283 ) - ( x284 = (* (( (ptr) arc_v7672)+3) ), *(float*)&x284 )), tf282) > FABS((( x286 = pt_v7644.f1, *(float*)&x286 ) - ( x287 = (* (( (ptr) arc_v7672)+5) ), *(float*)&x287 )), tf285))) { SOURCE(11580, 20) endpoint_v7716 = (* (W2Pt) (( (ptr) arc_v7672)+4) ); goto lab_L100029; } else { SOURCE(11600, 11) goto lab_L100030; }; }; }; }; /* c2c skipped dead code */ lab_L100030: ; SOURCE(11629, 126) { word pd288; word x289; word pd290; word x291; pd288 = (* (( (ptr) (* (( (ptr) gf_c19820)+68)/* var_c17356 */ ))+21) ); pd290 = (* (( (ptr) (* (( (ptr) gf_c19820)+68)/* var_c17356 */ ))+21) ); if ((( x289 = (word) ( *( (fPt) ((* (ptr) pd288 ))))(pt_v7644, (* (W2Pt) (( (ptr) arc_v7672)+2) ), pd288), *(float*)&x289 ) < ( x291 = (word) ( *( (fPt) ((* (ptr) pd290 ))))(pt_v7644, (* (W2Pt) (( (ptr) arc_v7672)+4) ), pd290), *(float*)&x291 ))) { SOURCE(11715, 23) endpoint_v7716 = (* (W2Pt) (( (ptr) arc_v7672)+2) ); } else { SOURCE(11738, 17) endpoint_v7716 = (* (W2Pt) (( (ptr) arc_v7672)+4) ); }; }; /* removed tail goto */ lab_L100029: ; (* (W2Pt) formal_c0288 ) = endpoint_v7716; return; } static word DistanceSquaredToNearestEndpoint_P1560(pt_v7776, arc_v7804) W2 pt_v7776; word arc_v7804; { register ptr gf_c19852 = (ptr) &globalframe; word distanceSquared_v7848; word distance2ToPLo_v10856; word distance2ToPHi_v10884; /* DistanceSquaredToNearestEndpoint: */ SOURCE(11766, 297) SOURCE(11908, 54) { word pd292; pd292 = (* (( (ptr) (* (( (ptr) gf_c19852)+68)/* var_c17356 */ ))+21) ); distance2ToPLo_v10856 = (word) ( *( (fPt) ((* (ptr) pd292 ))))(pt_v7776, (* (W2Pt) (( (ptr) arc_v7804)+2) ), pd292); }; SOURCE(11964, 54) { word pd293; pd293 = (* (( (ptr) (* (( (ptr) gf_c19852)+68)/* var_c17356 */ ))+21) ); distance2ToPHi_v10884 = (word) ( *( (fPt) ((* (ptr) pd293 ))))(pt_v7776, (* (W2Pt) (( (ptr) arc_v7804)+4) ), pd293); }; SOURCE(12020, 43) { word x294; float tf295; float tf296; word x297; float tf298; return(( tf298 = FMIN(( x294 = distance2ToPLo_v10856, *(float*)&x294 ), ( x297 = distance2ToPHi_v10884, *(float*)&x297 ), tf295, tf296), *(word*)&tf298 )); }; } static void NearestPointOnArc_P1620(formal_c0302, pt_v7908, arc_v7936) word formal_c0302; W2 pt_v7908; word arc_v7936; { register ptr gf_c19884 = (ptr) &globalframe; W2 onArc_v7980; W2 projectedPt_v10928; /* NearestPointOnArc: */ SOURCE(12069, 329) SOURCE(12169, 71) if (((* (( (ptr) arc_v7936)+8) ) != 0)) { SOURCE(12192, 48) { W2 var_c19244; { word pd299; pd299 = (* (( (ptr) (* (( (ptr) gf_c19884)+69)/* var_c17516 */ ))+46) ); (void) ( *( (fPt) ((* (ptr) pd299 ))))((word) &var_c19244, pt_v7908, (* (( (ptr) arc_v7936)+8) ), pd299); }; onArc_v7980 = var_c19244; goto lab_L100032; }; }; SOURCE(12242, 54) (void) PointProjectedOntoCircle_P840((word) &projectedPt_v10928, pt_v7908, (* (ptr) arc_v7936 )); SOURCE(12298, 100) if ((0 != (word) CirclePointOnArc_P1260(projectedPt_v10928, arc_v7936))) { SOURCE(12341, 25) onArc_v7980 = projectedPt_v10928; } else { SOURCE(12366, 32) (void) NearestEndpoint_P1500((word) &onArc_v7980, pt_v7908, arc_v7936); }; /* removed tail goto */ lab_L100032: ; (* (W2Pt) formal_c0302 ) = onArc_v7980; return; } static word DistancePointToArc_P1680(pt_v8040, arc_v8068) W2 pt_v8040; word arc_v8068; { register ptr gf_c19916 = (ptr) &globalframe; word distance_v8112; W2 projectedPt_v10972; W2 nearEndpoint_v11000; /* DistancePointToArc: */ SOURCE(12404, 433) SOURCE(12522, 72) if (((* (( (ptr) arc_v8068)+8) ) != 0)) { SOURCE(12545, 49) { word pd300; pd300 = (* (( (ptr) (* (( (ptr) gf_c19916)+69)/* var_c17516 */ ))+44) ); return((word) ( *( (fPt) ((* (ptr) pd300 ))))(pt_v8040, (* (( (ptr) arc_v8068)+8) ), pd300)); }; }; SOURCE(12596, 54) (void) PointProjectedOntoCircle_P840((word) &projectedPt_v10972, pt_v8040, (* (ptr) arc_v8068 )); SOURCE(12652, 185) if ((0 != (word) CirclePointOnArc_P1260(projectedPt_v10972, arc_v8068))) { SOURCE(12695, 52) { float tf301; word x302; float tf303; distance_v8112 = ( tf303 = FABS(( x302 = (word) CircleDistance_P780(pt_v8040, (* (ptr) arc_v8068 )), *(float*)&x302 ), tf301), *(word*)&tf303 ); }; } else { SOURCE(12749, 39) (void) NearestEndpoint_P1500((word) &nearEndpoint_v11000, pt_v8040, arc_v8068); SOURCE(12790, 47) { word pd304; pd304 = (* (( (ptr) (* (( (ptr) gf_c19916)+68)/* var_c17356 */ ))+19) ); distance_v8112 = (word) ( *( (fPt) ((* (ptr) pd304 ))))(pt_v8040, nearEndpoint_v11000, pd304); }; }; SOURCE(12404, 433) return(distance_v8112); } static word DistanceSquaredPointToArc_P1740(pt_v8172, arc_v8200) W2 pt_v8172; word arc_v8200; { register ptr gf_c19948 = (ptr) &globalframe; word distanceSquared_v8244; W2 projectedPt_v11044; /* DistanceSquaredPointToArc: */ SOURCE(12846, 465) SOURCE(12964, 79) if (((* (( (ptr) arc_v8200)+8) ) != 0)) { SOURCE(12987, 56) { word pd305; pd305 = (* (( (ptr) (* (( (ptr) gf_c19948)+69)/* var_c17516 */ ))+43) ); return((word) ( *( (fPt) ((* (ptr) pd305 ))))(pt_v8172, (* (( (ptr) arc_v8200)+8) ), pd305)); }; }; SOURCE(13045, 54) (void) PointProjectedOntoCircle_P840((word) &projectedPt_v11044, pt_v8172, (* (ptr) arc_v8200 )); SOURCE(13101, 210) if ((0 != (word) CirclePointOnArc_P1260(projectedPt_v11044, arc_v8200))) { SOURCE(13145, 48) distanceSquared_v8244 = (word) CircleDistance_P780(pt_v8172, (* (ptr) arc_v8200 )); SOURCE(13196, 49) { word x306; word x307; *(float*)&distanceSquared_v8244 = ( x306 = distanceSquared_v8244, *(float*)&x306 ) * ( x307 = distanceSquared_v8244, *(float*)&x307 ); }; } else { SOURCE(13252, 59) distanceSquared_v8244 = (word) DistanceSquaredToNearestEndpoint_P1560(pt_v8172, arc_v8200); }; SOURCE(12846, 465) return(distanceSquared_v8244); } static word OnArc_P1800(pt_v8304, arc_v8332) W2 pt_v8304; word arc_v8332; { word var_c8376; word d2_v11088; /* OnArc: */ SOURCE(13317, 155) SOURCE(13411, 39) d2_v11088 = (word) DistanceSquaredPointToArc_P1740(pt_v8304, arc_v8332); SOURCE(13452, 20) { word x308; word x309; return((( x308 = d2_v11088, *(float*)&x308 ) < ( x309 = (* (ptr) &fc79 ), *(float*)&x309 ))); }; } /* file: GGCirclesImpl, module: GGCirclesImpl, compiled at: February 5, 1993 1:54:48 pm PST */ extern void XR_install_GGCirclesImpl() { NoName_Q2484(); } extern void XR_run_GGCirclesImpl() { XR_Start(&globalframe); }