/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation.  All rights reserved. */
/* time: July 11, 1993 8:14:52 pm PDT */
/* C2C version: April 20, 1993 (sun4) */
/* ref-counting: off */
/* file: GGTrajImpl, module: GGTrajImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [1259302800,3591173255] GGTrajImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef struct {word f0, f1, f2, f3;} W4;
typedef W4 *W4Pt;
typedef word (*fPt)();
typedef struct {word f0, f1;} W2;
typedef W2 *W2Pt;
typedef struct {word f0, f1, f2, f3, f4, f5;} W6;
typedef W6 *W6Pt;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {W8 f; W6 r;} W14;
typedef struct {word f0, f1, f2;} W3;
typedef struct {word f0, f1, f2, f3, f4, f5, f6;} W7;
typedef W3 *W3Pt;
typedef struct {W8 f; W2 r;} W10;
typedef struct {W8 f; W8 r;} W16;
typedef struct {W16 f; W2 r;} W18;
typedef struct {W8 f; W3 r;} W11;
typedef struct {W16 f; W11 r;} W27;
#define SOURCE(p, l) /* source p, l */
static float fc51 = 9999.0;
#define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i )
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static float fc224 = 0.0;
static float fc232 = 1.0;
static float fc245 = 0.5;
static float fc257 = 2.0;
static float fc281 = -1.0;
#define IOP2(op, x, y)  ( (word) ((x) op (y)) )
#define FABS(f, t) ( ((t=(f)) >= (float) 0.0) ? (t) : (- (t)) )
static float fc368 = 0.01;
static void NoName←Q7236();
static void GGTrajImpl←P0();
static word CreateTrajFromData←P60();
static word CreateTraj←P120();
static word AddSegment←P180();
static void CloseWithSegment←P240();
static void CloseByDistorting←P300();
static void SetSelectionBits←P360();
static word ReplaceFirstRun←P420();
static void SegToSegMatchCp←P480();
static void SegAndCpsToSegs←P540();
static word DeleteControlPoints←P600();
static void DeleteSequence←P660();
static word OutlinesOfTrajMinusSequence←P720();
static word GroupPieces←P780();
static word CopyTrajFromRun←P840();
static void CopyEachSegment←P4968();
static word CopySegmentAndBuild←P5088();
static void CopyEachJoint←P5028();
static word CopyJointAndBuild←P5148();
static word CopyTrajFromRange←P900();
static void CopyEachSegment←P5208();
static word CopySegmentAndBuild←P5328();
static void CopyEachJoint←P5268();
static word CopyJointAndBuild←P5388();
static word Concat←P960();
static word SpliceIn←P1020();
static void ResetEndSelectionBits←P1080();
static word SpliceInOpen←P1140();
static word SpliceInClosed←P1200();
static void ReverseTraj←P1260();
static word IsClockwiseTraj←P1320();
static word IsClockwiseTrajTransformSeq←P1380();
static void DrawPolyline←P1440();
static void PolyPathProc←P5544();
static void TranslateTraj←P1500();
static word ConstrainJoint←P1560();
static word ConstrainCP←P1620();
static word MatchShape←P1680();
static word FetchSegment←P1740();
static word FetchSegmentTraj←P1800();
static word FetchJoint←P1860();
static void FetchJointPos←P1920();
static void FetchJointPosTraj←P1980();
static void FetchJointNormal←P2040();
static void LastJointPos←P2100();
static void SetJointPos←P2160();
static word HiSegment←P2220();
static word HiSegmentTraj←P2280();
static word HiJoint←P2340();
static word HiJointTraj←P2400();
static word PreviousSegment←P2460();
static word PreviousSegmentNum←P2520();
static word FollowingSegmentNum←P2580();
static word FollowingJoint←P2640();
static word IsEndJoint←P2700();
static void SaveSelection←P2760();
static void SaveSelectionInSequence←P2820();
static void SaveSelectionInParts←P2880();
static void ClearSelection←P2940();
static void ClearSelections←P3000();
static word RemakeSelection←P3060();
static void SetControlPointField←P3120();
static word GetControlPointField←P3180();
static word GetJointField←P3240();
static word GetSegmentField←P3300();
static void SetJointField←P3360();
static void SetSegmentField←P3420();
static word CopyJoint←P3480();
static void SetTrajRole←P3540();
static word GetTrajRole←P3600();
static void UnpackSimpleDescriptor←P3660();
static void UnpackHitData←P3720();
static void PointToVector←P3780();
static void CrossProduct←P3840();
static word GetPartialArea←P3900();
static word SignedArea←P3960();
static word SignedAreaTransformSeq←P4020();
static word OnlyChild←P4080();
static void NearestSegment←P4140();
static word ProcessSegment←P6756();
static void NearestJoint←P4200();
static word ProcessJoint←P6912();
static void NearestControlPoint←P4260();
static word SomeCP←P6972();
static word ProcessSegment←P7032();
static word IndexOfJoint←P4320();
static word IndexOfSegment←P4380();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\247\365\203\234\300\047\265\225\046\106\354\000\000"};
static struct {unsigned f; char r[8];} string2 = {262148, "\004\200@\034\000\000\000"};
static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\247\365\203\234\300\047\265\225\046\100\324\000\000"};
static struct {unsigned f; char r[32];} string4 = {1966110, "\006\015\000\001\004\001\010\001\034\001\040\001\044\001\050\001\054\001\060\001\064\001\074\001\100\110\001\100\130\001\000"};
static struct {unsigned f; char r[4];} string5 = {131076, "\216\251\000"};
static struct {unsigned f; char r[4];} string6 = {65537, "\001\000\000"};
static struct {unsigned f; char r[16];} string7 = {851984, "\257\300\254\073\314\103\300\064\024\167\046\100\164\000\000"};
static struct {unsigned f; char r[4];} string8 = {131074, "\003\006\000"};
static struct {unsigned f; char r[20];} string9 = {1179668, "\260\006\005\146\151\162\163\164\217\005\004\162\145\163\164\214\217\261\000"};
static struct {unsigned f; char r[4];} string10 = {131074, "\004\003\000"};
static struct {unsigned f; char r[16];} string11 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[16];} string12 = {851984, "\257\300\311\023\117\300\300\337\236\305\170\100\164\000\000"};
static struct {unsigned f; char r[4];} string13 = {196611, "\004A6"};
static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\247\365\203\234\300\047\265\225\046\107\050\000\000"};
static struct {unsigned f; char r[4];} string15 = {131074, "\004\007\000"};
static struct {unsigned f; char r[16];} string16 = {851984, "\257\300\050\310\006\072\300\004\273\314\121\100\214\000\000"};
static struct {unsigned f; char r[16];} string17 = {851984, "\257\300\254\073\314\103\300\064\024\167\046\100\200\000\000"};
static struct {unsigned f; char r[28];} string18 = {1638425, "\006\011\000\001\004\001\024\001\040\001\100\124\001\100\130\001\100\134\001\100\140\001\100\144\001\000\000"};
static struct {unsigned f; char r[48];} string19 = {2883632, "\260\006\005\146\151\162\163\164\216\257\300\247\365\203\234\300\047\265\225\046\100\324\005\004\162\145\163\164\214\216\257\300\247\365\203\234\300\047\265\225\046\100\324\261\000\000\000"};
static struct {unsigned f; char r[12];} string20 = {524300, "Gargoyle\000\000\000"};
static struct {unsigned f; char r[8];} string21 = {458760, "Apology"};
static struct {unsigned f; char r[48];} string22 = {2949168, "Only delete control points from Cubic Splines\000\000"};
static struct {unsigned f; char r[12];} string23 = {720908, "CubicSpline"};
static struct {unsigned f; char r[4];} string24 = {196612, "Arc"};
static struct {unsigned f; char r[8];} string25 = {393224, "Bezier\000"};
static struct {unsigned f; char r[8];} string26 = {327688, "Conic\000\000"};
static struct {unsigned f; char r[40];} string27 = {2424872, "single closed segment not implemented\000\000"};
static struct {unsigned f; char r[8];} string28 = {262152, "Traj\000\000\000"};
static struct {unsigned f; char r[16];} string29 = {851984, "\257\300\113\017\157\220\300\326\014\364\207\100\164\000\000"};
static struct {unsigned f; char r[8];} string30 = {458759, "\006\001@X\004A\377"};
static struct {unsigned f; char r[16];} string31 = {851984, "\257\300\322\334\347\304\300\124\107\000\027\100\150\000\000"};
static struct {unsigned f; char r[16];} string32 = {851984, "\257\300\265\217\206\011\300\172\271\371\033\100\150\000\000"};
static struct {unsigned f; char r[16];} string33 = {851984, "\257\300\231\005\151\136\300\275\231\323\274\100\150\000\000"};
static struct {unsigned f; char r[16];} string34 = {851984, "\257\300\311\023\117\300\300\337\236\305\170\100\150\000\000"};
static struct {unsigned f; char r[16];} string35 = {851984, "\257\300\301\241\007\150\300\032\111\265\237\100\150\000\000"};
static struct {unsigned f; char r[16];} string36 = {851984, "\257\300\043\211\212\366\300\343\003\307\242\100\150\000\000"};
static struct {unsigned f; char r[16];} string37 = {851984, "\257\300\011\245\206\305\300\112\326\356\245\100\150\000\000"};
static struct {unsigned f; char r[16];} string38 = {851984, "\257\300\261\002\056\176\300\055\321\222\125\100\150\000\000"};
static struct {unsigned f; char r[16];} string39 = {851984, "\257\300U$)\337\300Xo9\243@t\000\000"};
static struct {unsigned f; char r[16];} string40 = {851984, "\257\300\336\025\013\356\300\216\115\352\271\100\150\000\000"};
static struct {unsigned f; char r[16];} string41 = {851984, "\257\300\104\154\010\164\300\126\073\363\036\100\150\000\000"};
static struct {unsigned f; char r[16];} string42 = {851984, "\257\300\370\132\042\205\300\045\133\011\125\100\150\000\000"};
static struct {unsigned f; char r[16];} string43 = {851984, "\257\300\074\177\166\242\300\203\113\217\044\100\150\000\000"};
static struct {unsigned f; char r[16];} string44 = {851984, "\257\300\121\117\377\026\300\315\013\026\004\100\150\000\000"};
static struct {unsigned f; char r[16];} string45 = {851984, "\257\300\103\306\166\071\300\047\126\012\237\100\150\000\000"};
static struct {unsigned f; char r[16];} string46 = {851984, "\257\300\245\247\302\156\300\052\156\325\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string47 = {851984, "\257\300\252\120\163\253\300\126\171\142\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string48 = {851984, "\257\300\353\035\365\325\300\132\075\117\337\100\150\000\000"};
static struct {unsigned f; char r[16];} string49 = {851984, "\257\300\004\142\347\110\300\363\053\254\345\100\150\000\000"};
static struct {unsigned f; char r[16];} string50 = {851984, "\257\300\050\310\006\072\300\004\273\314\121\100\150\000\000"};
static struct {
   word f0[31]; 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; word f68; word f69; 
   word f70; word f71; word f72; word f73; 
   word f74; word f75; word f76; word f77; 
   word f78; word f79; word f80; word f81; 
   word f82; word f83; word f84; word f85; 
   word f86; word f87; word f88; word f89; 
   word f90; word f91; word f92; word f93; 
   word f94; word f95; word f96; word f97; 
   word f98; word f99; word f100; word f101; 
   word f102; word f103; word f104; word f105; 
   word f106; word f107; word f108; word f109; 
   word f110; word f111; word f112; word f113; 
   word f114; word f115; word f116; word f117; 
   word f118; word f119; word f120; word f121; 
   word f122; word f123; word f124; word f125; 
   word f126; word f127; word f128; word f129; 
   word f130; word f131; word f132; word f133; 
   word f134; word f135; word f136; word f137; 
   word f138; word f139; word f140; word f141; 
   word f142; word f143; word f144; word f145; 
   word f146; word f147; word f148; word f149; 
   word f150; word f151; word f152; word f153; 
   word f154; word f155; word f156; word f157; 
   word f158; word f159; word f160; word f161; 
   word f162; word f163; word f164; word f165; 
   word f166; word f167; word f168; word f169; 
   word f170; word f171; word f172; word f173; 
   word f174; word f175; word f176; word f177; 
   word f178[25]; 
   } globalframe = {
   {0}, (word) IndexOfSegment←P4380, 0, (word) IndexOfJoint←P4320, 
   0, (word) NearestControlPoint←P4260, 0, (word) NearestJoint←P4200, 
   0, (word) NearestSegment←P4140, 0, (word) OnlyChild←P4080, 
   0, (word) SignedAreaTransformSeq←P4020, 0, (word) SignedArea←P3960, 
   0, (word) GetPartialArea←P3900, 0, (word) CrossProduct←P3840, 
   0, (word) PointToVector←P3780, 0, (word) UnpackHitData←P3720, 
   0, (word) UnpackSimpleDescriptor←P3660, 0, (word) GetTrajRole←P3600, 
   0, (word) SetTrajRole←P3540, 0, (word) CopyJoint←P3480, 
   0, (word) SetSegmentField←P3420, 0, (word) SetJointField←P3360, 
   0, (word) GetSegmentField←P3300, 0, (word) GetJointField←P3240, 
   0, (word) GetControlPointField←P3180, 0, (word) SetControlPointField←P3120, 
   0, (word) RemakeSelection←P3060, 0, (word) ClearSelections←P3000, 
   0, (word) ClearSelection←P2940, 0, (word) SaveSelectionInParts←P2880, 
   0, (word) SaveSelectionInSequence←P2820, 0, (word) SaveSelection←P2760, 
   0, (word) IsEndJoint←P2700, 0, (word) FollowingJoint←P2640, 
   0, (word) FollowingSegmentNum←P2580, 0, (word) PreviousSegmentNum←P2520, 
   0, (word) PreviousSegment←P2460, 0, (word) HiJointTraj←P2400, 
   0, (word) HiJoint←P2340, 0, (word) HiSegmentTraj←P2280, 
   0, (word) HiSegment←P2220, 0, (word) SetJointPos←P2160, 
   0, (word) LastJointPos←P2100, 0, (word) FetchJointNormal←P2040, 
   0, (word) FetchJointPosTraj←P1980, 0, (word) FetchJointPos←P1920, 
   0, (word) FetchJoint←P1860, 0, (word) FetchSegmentTraj←P1800, 
   0, (word) FetchSegment←P1740, 0, (word) MatchShape←P1680, 
   0, (word) ConstrainCP←P1620, 0, (word) ConstrainJoint←P1560, 
   0, (word) TranslateTraj←P1500, 0, (word) DrawPolyline←P1440, 
   0, (word) IsClockwiseTrajTransformSeq←P1380, 0, (word) IsClockwiseTraj←P1320, 
   0, (word) ReverseTraj←P1260, 0, (word) SpliceInClosed←P1200, 
   0, (word) SpliceInOpen←P1140, 0, (word) ResetEndSelectionBits←P1080, 
   0, (word) SpliceIn←P1020, 0, (word) Concat←P960, 
   0, (word) CopyTrajFromRange←P900, 0, (word) CopyTrajFromRun←P840, 
   0, (word) GroupPieces←P780, 0, (word) OutlinesOfTrajMinusSequence←P720, 
   0, (word) DeleteSequence←P660, 0, (word) DeleteControlPoints←P600, 
   0, (word) SegAndCpsToSegs←P540, 0, (word) SegToSegMatchCp←P480, 
   0, (word) ReplaceFirstRun←P420, 0, (word) SetSelectionBits←P360, 
   0, (word) CloseByDistorting←P300, 0, (word) CloseWithSegment←P240, 
   0, (word) AddSegment←P180, 0, (word) CreateTraj←P120, 
   0, (word) CreateTrajFromData←P60, 0, (word) GGTrajImpl←P0, 
   {0}
   };

static void NoName←Q7236()
   {
   register ptr gf←c0917 =  (ptr) &globalframe;
   word var←c68860;
   (* (( (ptr) gf←c0917)+6) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c0917)+7) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4);
   (* (( (ptr) gf←c0917)+8) ) = (word) XR←GetTypeIndex((word) &string5, 0, (word) &string6);
   (* (( (ptr) gf←c0917)+13) ) = (word) XR←GetTypeIndex((word) &string7, 0, (word) &string8);
   (* (( (ptr) gf←c0917)+14) ) = (word) XR←GetTypeIndex((word) &string9, 0, (word) &string10);
   (* (( (ptr) gf←c0917)+16) ) = (word) XR←GetTypeIndex((word) &string11, 0, (word) &string6);
   (* (( (ptr) gf←c0917)+17) ) = (word) XR←GetTypeIndex((word) &string12, 0, (word) &string13);
   (* (( (ptr) gf←c0917)+18) ) = (word) XR←GetTypeIndex((word) &string14, 0, (word) &string15);
   (* (( (ptr) gf←c0917)+19) ) = (word) XR←GetTypeIndexS((word) (&string16));
   (* (( (ptr) gf←c0917)+20) ) = (word) XR←GetTypeIndex((word) &string17, 0, (word) &string18);
   (* (( (ptr) gf←c0917)+21) ) = (word) XR←GetTypeIndex((word) &string19, 0, (word) &string10);
   (*  (ptr) (( (bPt) gf←c0917)+88) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string20);
   (*  (ptr) (( (bPt) gf←c0917)+92) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string21);
   (*  (ptr) (( (bPt) gf←c0917)+96) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+16) ), (word) &string22);
   (*  (ptr) (( (bPt) gf←c0917)+100) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string23);
   (*  (ptr) (( (bPt) gf←c0917)+104) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string24);
   (*  (ptr) (( (bPt) gf←c0917)+108) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string25);
   (*  (ptr) (( (bPt) gf←c0917)+112) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string26);
   (*  (ptr) (( (bPt) gf←c0917)+116) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+16) ), (word) &string27);
   (*  (ptr) (( (bPt) gf←c0917)+120) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0917)+8) ), (word) &string28);
   (void) XR←DeclareGlobalFrame((word) "GGTrajImpl", &globalframe, (word) XR←GetTypeIndex((word) &string29, 0, (word) &string30)
      , (word) (( (bPt) gf←c0917)+708)/* var←c62396 */ );
   var←c68860 = (word) XR←ImportInterface((word) "Feedback", (word) XR←GetTypeIndexS((word) (&string31)), 25);
   (* (( (ptr) gf←c0917)+183)/* var←c62492 */  ) = var←c68860;
   var←c68860 = (word) XR←ImportInterface((word) "GGBoundBox", (word) XR←GetTypeIndexS((word) (&string32)), 24);
   (* (( (ptr) gf←c0917)+185)/* var←c62652 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 68162051);
   (void) XR←ImportProcS(var←c68860, 67371777);
   (void) XR←ImportProcS(var←c68860, 67109376);
   var←c68860 = (word) XR←ImportInterface((word) "GGCoreOps", (word) XR←GetTypeIndexS((word) (&string33)), 37);
   (* (( (ptr) gf←c0917)+196)/* var←c64668 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 269229059);
   var←c68860 = (word) XR←ImportInterface((word) "GGOutline", (word) XR←GetTypeIndexS((word) (&string34)), 19);
   (* (( (ptr) gf←c0917)+195)/* var←c64284 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67633922);
   (void) XR←ImportProcS(var←c68860, 67633410);
   (void) XR←ImportProcS(var←c68860, 67896323);
   var←c68860 = (word) XR←ImportInterface((word) "GGParent", (word) XR←GetTypeIndexS((word) (&string35)), 83);
   (* (( (ptr) gf←c0917)+190)/* var←c63708 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67386369);
   var←c68860 = (word) XR←ImportInterface((word) "GGSegment", (word) XR←GetTypeIndexS((word) (&string36)), 47);
   (* (( (ptr) gf←c0917)+187)/* var←c62940 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67637250);
   (void) XR←ImportProcS(var←c68860, 1056003);
   (void) XR←ImportProcS(var←c68860, 1054723);
   (void) XR←ImportProcS(var←c68860, 529922);
   (void) XR←ImportProcS(var←c68860, 267009);
   (void) XR←ImportProcS(var←c68860, 67640066);
   (void) XR←ImportProcS(var←c68860, 68944900);
   (void) XR←ImportProcS(var←c68860, 67374337);
   (void) XR←ImportProcS(var←c68860, 527874);
   (void) XR←ImportProcS(var←c68860, 788738);
   (void) XR←ImportProcS(var←c68860, 792322);
   (void) XR←ImportProcS(var←c68860, 266753);
   var←c68860 = (word) XR←ImportInterface((word) "GGSelect", (word) XR←GetTypeIndexS((word) (&string37)), 23);
   (* (( (ptr) gf←c0917)+193)/* var←c64124 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67637250);
   (void) XR←ImportProcS(var←c68860, 135271172);
   var←c68860 = (word) XR←ImportInterface((word) "GGSequence", (word) XR←GetTypeIndexS((word) (&string38)), 58);
   (* (( (ptr) gf←c0917)+189)/* var←c63644 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 799491);
   (void) XR←ImportProcS(var←c68860, 67905283);
   (void) XR←ImportProcS(var←c68860, 671621122);
   (void) XR←ImportProcS(var←c68860, 67371521);
   (void) XR←ImportProcS(var←c68860, 264705);
   (void) XR←ImportProcS(var←c68860, 134490881);
   (void) XR←ImportProcS(var←c68860, 67643650);
   (void) XR←ImportProcS(var←c68860, 67379713);
   (void) XR←ImportProcS(var←c68860, 134488321);
   (void) XR←ImportProcS(var←c68860, 67637506);
   (void) XR←ImportProcS(var←c68860, 67376385);
   (void) XR←ImportProcS(var←c68860, 67371777);
   (void) XR←ImportProcS(var←c68860, 67379969);
   (void) XR←ImportProcS(var←c68860, 67376641);
   (void) XR←ImportProcS(var←c68860, 67385601);
   (void) XR←ImportProcS(var←c68860, 67384321);
   (void) XR←ImportProcS(var←c68860, 67381761);
   (void) XR←ImportProcS(var←c68860, 67380225);
   var←c68860 = (word) XR←ImportInterface((word) "GGSlice", (word) XR←GetTypeIndexS((word) (&string39)), 128);
   (* (( (ptr) gf←c0917)+184)/* var←c62588 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 278529);
   (void) XR←ImportProcS(var←c68860, 67634178);
   (void) XR←ImportProcS(var←c68860, 67371777);
   var←c68860 = (word) XR←ImportInterface((word) "GGSliceOps", (word) XR←GetTypeIndexS((word) (&string40)), 73);
   (* (( (ptr) gf←c0917)+192)/* var←c64092 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67634434);
   (void) XR←ImportProcS(var←c68860, 67371521);
   (void) XR←ImportProcS(var←c68860, 67634690);
   (void) XR←ImportProcS(var←c68860, 134756866);
   (void) XR←ImportProcS(var←c68860, 67633922);
   (void) XR←ImportProcS(var←c68860, 1062148);
   var←c68860 = (word) XR←ImportInterface((word) "GGTransform", (word) XR←GetTypeIndexS((word) (&string41)), 7);
   (* (( (ptr) gf←c0917)+199)/* var←c66172 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 135004418);
   var←c68860 = (word) XR←ImportInterface((word) "GGUtility", (word) XR←GetTypeIndexS((word) (&string42)), 42);
   (* (( (ptr) gf←c0917)+191)/* var←c63996 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67378689);
   var←c68860 = (word) XR←ImportInterface((word) "Imager", (word) XR←GetTypeIndexS((word) (&string43)), 84);
   (* (( (ptr) gf←c0917)+197)/* var←c65980 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 803587);
   (void) XR←ImportProcS(var←c68860, 540674);
   (void) XR←ImportProcS(var←c68860, 541186);
   (void) XR←ImportProcS(var←c68860, 536578);
   var←c68860 = (word) XR←ImportInterface((word) "ImagerTransformation", (word) XR←GetTypeIndexS((word) (&string44)), 55);
   (* (( (ptr) gf←c0917)+198)/* var←c66076 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 135013122);
   (void) XR←ImportProcS(var←c68860, 67634689);
   var←c68860 = (word) XR←ImportInterface((word) "Lines2d", (word) XR←GetTypeIndexS((word) (&string45)), 50);
   (* (( (ptr) gf←c0917)+200)/* var←c66268 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 135014914);
   (void) XR←ImportProcS(var←c68860, 68163330);
   var←c68860 = (word) XR←ImportInterface((word) "RealFns", (word) XR←GetTypeIndexS((word) (&string46)), 36);
   (* (( (ptr) gf←c0917)+201)/* var←c66492 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67372289);
   (void) XR←ImportProcS(var←c68860, 67904259);
   var←c68860 = (word) XR←ImportInterface((word) "Rosary", (word) XR←GetTypeIndexS((word) (&string47)), 18);
   (* (( (ptr) gf←c0917)+186)/* var←c62748 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 67633410);
   (void) XR←ImportProcS(var←c68860, 68159746);
   (void) XR←ImportProcS(var←c68860, 67373057);
   (void) XR←ImportProcS(var←c68860, 67896067);
   (void) XR←ImportProcS(var←c68860, 67634178);
   (void) XR←ImportProcS(var←c68860, 67374593);
   (void) XR←ImportProcS(var←c68860, 67633666);
   var←c68860 = (word) XR←ImportInterface((word) "SimpleFeedback", (word) XR←GetTypeIndexS((word) (&string48)), 7);
   (* (( (ptr) gf←c0917)+194)/* var←c64188 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 1048580);
   var←c68860 = (word) XR←ImportInterface((word) "Vectors2d", (word) XR←GetTypeIndexS((word) (&string49)), 21);
   (* (( (ptr) gf←c0917)+188)/* var←c63004 */  ) = var←c68860;
   (void) XR←ImportProcS(var←c68860, 68158722);
   (void) XR←ImportProcS(var←c68860, 68161794);
   (void) XR←ImportProcS(var←c68860, 134744321);
   (void) XR←ImportProcS(var←c68860, 68161282);
   (void) XR←ImportProcS(var←c68860, 135270914);
   (void) XR←ImportProcS(var←c68860, 135006210);
   (void) XR←ImportProcS(var←c68860, 135267842);
   (void) XR←ImportProcS(var←c68860, 135268098);
   var←c68860 = (word) XR←ExportInterface((word) "GGTraj", (word) XR←GetTypeIndexS((word) (&string50)), 55);
   (* (( (ptr) gf←c0917)+202)/* var←c68892 */  ) = var←c68860;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+692)/* var←c62332 */ , 67633153, (word) "CreateTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+700)/* var←c62364 */ , 70517002, (word) "CreateTrajFromData")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+684)/* var←c62300 */ , 68157956, (word) "AddSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+676)/* var←c62268 */ , 787203, (word) "CloseWithSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+668)/* var←c62236 */ , 525314, (word) "CloseByDistorting");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+628)/* var←c62076 */ , 67634434, (word) "DeleteControlPoints")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+620)/* var←c62044 */ , 134481409, (word) "DeleteSequence");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+652)/* var←c62172 */ , 68159236, (word) "ReplaceFirstRun");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+644)/* var←c62140 */ , 1050628, (word) "SegToSegMatchCp");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+636)/* var←c62108 */ , 1050884, (word) "SegAndCpsToSegs");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+164)/* var←c60220 */ , 67373569, (word) "OnlyChild");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+236)/* var←c60508 */ , 527106, (word) "SetTrajRole");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+228)/* var←c60476 */ , 67374081, (word) "GetTrajRole");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+596)/* var←c61948 */ , 67636482, (word) "CopyTrajFromRun");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+588)/* var←c61916 */ , 67898883, (word) "CopyTrajFromRange");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+580)/* var←c61884 */ , 68161284, (word) "Concat");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+572)/* var←c61852 */ , 67637250, (word) "SpliceIn");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+540)/* var←c61724 */ , 266497, (word) "ReverseTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+532)/* var←c61692 */ , 67375617, (word) "IsClockwiseTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+524)/* var←c61660 */ , 67638018, (word) "IsClockwiseTrajTransformSeq")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+516)/* var←c61628 */ , 529666, (word) "DrawPolyline");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+500)/* var←c61564 */ , 67900931, (word) "ConstrainJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+492)/* var←c61532 */ , 68163332, (word) "ConstrainCP");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+484)/* var←c61500 */ , 67639298, (word) "MatchShape");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+476)/* var←c61468 */ , 67639554, (word) "FetchSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+468)/* var←c61436 */ , 67639810, (word) "FetchSegmentTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+460)/* var←c61404 */ , 67640066, (word) "FetchJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+452)/* var←c61372 */ , 134749186, (word) "FetchJointPos");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+444)/* var←c61340 */ , 134749442, (word) "FetchJointPosTraj")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+436)/* var←c61308 */ , 134749698, (word) "FetchJointNormal");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+428)/* var←c61276 */ , 134487809, (word) "LastJointPos");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+420)/* var←c61244 */ , 1056771, (word) "SetJointPos");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+412)/* var←c61212 */ , 67379457, (word) "HiSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+404)/* var←c61180 */ , 67379713, (word) "HiSegmentTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+396)/* var←c61148 */ , 67379969, (word) "HiJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+388)/* var←c61116 */ , 67380225, (word) "HiJointTraj");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+380)/* var←c61084 */ , 67642626, (word) "PreviousSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+372)/* var←c61052 */ , 67642882, (word) "PreviousSegmentNum")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+364)/* var←c61020 */ , 67643138, (word) "FollowingSegmentNum")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+356)/* var←c60988 */ , 67643394, (word) "FollowingJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+348)/* var←c60956 */ , 67643650, (word) "IsEndJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+340)/* var←c60924 */ , 797187, (word) "SaveSelection");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+332)/* var←c60892 */ , 535298, (word) "SaveSelectionInSequence")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+324)/* var←c60860 */ , 797699, (word) "SaveSelectionInParts")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+316)/* var←c60828 */ , 535810, (word) "ClearSelection");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+308)/* var←c60796 */ , 273921, (word) "ClearSelections");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+300)/* var←c60764 */ , 67645186, (word) "RemakeSelection");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+220)/* var←c60444 */ , 671625218, (word) "UnpackSimpleDescriptor")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+212)/* var←c60412 */ , 402927873, (word) "UnpackHitData");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+156)/* var←c60188 */ , 470823427, (word) "NearestSegment");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+148)/* var←c60156 */ , 470823683, (word) "NearestJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+140)/* var←c60124 */ , 537932803, (word) "NearestControlPoint")
   ;
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+132)/* var←c60092 */ , 67646722, (word) "IndexOfJoint");
   (void) XR←ExportProcS(var←c68860, (word) (( (bPt) gf←c0917)+124)/* var←c60060 */ , 67646978, (word) "IndexOfSegment");
   }

static void GGTrajImpl←P0(formal←c0102, formal←c0101)
   word formal←c0102;
   word formal←c0101;
   {
   register ptr gf←c68924 =  (ptr) &globalframe;
   /* GGTrajImpl: */ 
SOURCE(343, 51562)
SOURCE(2619, 16)
   (* (( (ptr) gf←c68924)+4)/* Problem←v4960 */  ) = (*  (ptr) (* (( (ptr) (* (( (ptr) gf←c68924)+183)/* var←c62492 */  ))+28)
    ) );
SOURCE(29633, 20)
   (* (( (ptr) gf←c68924)+5)/* closeness←v5744 */  ) =  (word) -18;
   }

static word CreateTrajFromData←P60(role←v7340, segCount←v7368, segments←v7396, joints←v7424, extraPoints←v7452, visibleJoints←v7480, strokeJoint←v7508, loArrow←v7536, hiArrow←v7564, selectedInPart←v7592)
   word role←v7340;
   word segCount←v7368;
   word segments←v7396;
   word joints←v7424;
   word extraPoints←v7452;
   word visibleJoints←v7480;
   word strokeJoint←v7508;
   word loArrow←v7536;
   word hiArrow←v7564;
   W4 selectedInPart←v7592;
   {
   register ptr gf←c68956 =  (ptr) &globalframe;
   word slice←v7720;
   word trajData←v17728;
   /* CreateTrajFromData: */ 
SOURCE(2671, 741)
SOURCE(2671, 741)
   slice←v7720 = 0;
SOURCE(3011, 168)
   trajData←v17728 = XR←NewObject(64, (* (( (ptr) gf←c68956)+6) ));
   (*  (ptr) trajData←v17728 ) = role←v7340;
   (* (( (ptr) trajData←v17728)+1) ) = segCount←v7368;
   (* (( (ptr) trajData←v17728)+2) ) = segments←v7396;
   (* (( (ptr) trajData←v17728)+3) ) = joints←v7424;
   (* (( (ptr) trajData←v17728)+4) ) = extraPoints←v7452;
   (* (( (ptr) trajData←v17728)+5) ) = visibleJoints←v7480;
   (* (( (ptr) trajData←v17728)+6) ) = strokeJoint←v7508;
   (* (( (ptr) trajData←v17728)+7) ) = loArrow←v7536;
   (* (( (ptr) trajData←v17728)+8) ) = hiArrow←v7564;
   (* (( (ptr) trajData←v17728)+9) ) = 1;
   (*  (W4Pt) (( (ptr) trajData←v17728)+10) ) = selectedInPart←v7592;
   (* (( (ptr) trajData←v17728)+15) ) = (*  (ptr) &fc51 );
SOURCE(3181, 79)
   {
      word var←c62556;
      word var←c62620;
      {
         word pd52;
         pd52 = (* (( (ptr) (* (( (ptr) gf←c68956)+184)/* var←c62588 */  ))+7) );
         var←c62556 = (word) ( *( (fPt) ((*  (ptr) pd52 ))))((* ((( (ptr) gf←c68956)+30)) ), pd52);
         };
      var←c62620 = XR←NewObject(92, (* (( (ptr) gf←c68956)+7) ));
      (*  (ptr) var←c62620 ) = var←c62556;
      (* (( (ptr) var←c62620)+1) ) = trajData←v17728;
      (*  (W4Pt) (( (ptr) var←c62620)+3) ) = (*  (W4Pt) (( (ptr) gf←c68956)+179)/* var←c62460 */  );
      (* (( (ptr) var←c62620)+21) ) =  (word) -1;
      slice←v7720 = var←c62620;
      };
SOURCE(3262, 42)
   {
      word pd53;
      pd53 = (* (( (ptr) (* (( (ptr) gf←c68956)+185)/* var←c62652 */  ))+6) );
      (* (( (ptr) slice←v7720)+15) ) = (word) ( *( (fPt) ((*  (ptr) pd53 ))))(pd53);
      };
SOURCE(3306, 42)
   {
      word pd54;
      pd54 = (* (( (ptr) (* (( (ptr) gf←c68956)+185)/* var←c62652 */  ))+6) );
      (* (( (ptr) slice←v7720)+13) ) = (word) ( *( (fPt) ((*  (ptr) pd54 ))))(pd54);
      };
SOURCE(3350, 62)
   {
      word pd55;
      pd55 = (* (( (ptr) (* (( (ptr) gf←c68956)+184)/* var←c62588 */  ))+8) );
      (* (( (ptr) slice←v7720)+11) ) = (word) ( *( (fPt) ((*  (ptr) pd55 ))))(slice←v7720, 0, pd55);
      };
SOURCE(2671, 741)
   return(slice←v7720);
   }

static word CreateTraj←P120(point←v7780)
   W2 point←v7780;
   {
   register ptr gf←c68988 =  (ptr) &globalframe;
   word slice←v7824;
   word firstJoint←v17772;
   word trajData←v17800;
   /* CreateTraj: */ 
SOURCE(3418, 695)
SOURCE(3418, 695)
   slice←v7824 = 0;
SOURCE(3485, 50)
   firstJoint←v17772 = XR←NewObject(28, (* (( (ptr) gf←c68988)+13) ));
   (*  (W2Pt) firstJoint←v17772 ) = point←v7780;
SOURCE(3537, 184)
   {
      word var←c62716;
      word var←c62780;
      {
         word pd56;
         pd56 = (* (( (ptr) (* (( (ptr) gf←c68988)+186)/* var←c62748 */  ))+6) );
         var←c62716 = (word) ( *( (fPt) ((*  (ptr) pd56 ))))(firstJoint←v17772, 1, pd56);
         };
      var←c62780 = XR←NewObject(64, (* (( (ptr) gf←c68988)+6) ));
      (*  (ptr) var←c62780 ) = 2;
      (* (( (ptr) var←c62780)+3) ) = var←c62716;
      (* (( (ptr) var←c62780)+6) ) = 2;
      (* (( (ptr) var←c62780)+9) ) = 1;
      (*  (W4Pt) (( (ptr) var←c62780)+10) ) = (*  (W4Pt) (( (ptr) gf←c68988)+179)/* var←c62460 */  );
      (* (( (ptr) var←c62780)+15) ) = (*  (ptr) &fc51 );
      trajData←v17800 = var←c62780;
      };
SOURCE(3723, 326)
   {
      word var←c62812;
      word var←c62844;
      word var←c62876;
      word var←c62908;
      {
         word pd57;
         pd57 = (* (( (ptr) (* (( (ptr) gf←c68988)+184)/* var←c62588 */  ))+7) );
         var←c62812 = (word) ( *( (fPt) ((*  (ptr) pd57 ))))((* ((( (ptr) gf←c68988)+30)) ), pd57);
         };
      {
         word pd58;
         pd58 = (* (( (ptr) (* (( (ptr) gf←c68988)+185)/* var←c62652 */  ))+6) );
         var←c62844 = (word) ( *( (fPt) ((*  (ptr) pd58 ))))(pd58);
         };
      {
         word pd59;
         pd59 = (* (( (ptr) (* (( (ptr) gf←c68988)+185)/* var←c62652 */  ))+6) );
         var←c62876 = (word) ( *( (fPt) ((*  (ptr) pd59 ))))(pd59);
         };
      var←c62908 = XR←NewObject(92, (* (( (ptr) gf←c68988)+7) ));
      (*  (ptr) var←c62908 ) = var←c62812;
      (* (( (ptr) var←c62908)+1) ) = trajData←v17800;
      (*  (W4Pt) (( (ptr) var←c62908)+3) ) = (*  (W4Pt) (( (ptr) gf←c68988)+179)/* var←c62460 */  );
      (* (( (ptr) var←c62908)+13) ) = var←c62844;
      (* (( (ptr) var←c62908)+15) ) = var←c62876;
      (* (( (ptr) var←c62908)+21) ) =  (word) -1;
      slice←v7824 = var←c62908;
      };
SOURCE(4051, 62)
   {
      word pd60;
      pd60 = (* (( (ptr) (* (( (ptr) gf←c68988)+184)/* var←c62588 */  ))+8) );
      (* (( (ptr) slice←v7824)+11) ) = (word) ( *( (fPt) ((*  (ptr) pd60 ))))(slice←v7824, 0, pd60);
      };
SOURCE(3418, 695)
   return(slice←v7824);
   }

static word AddSegment←P180(slice←v7884, trajEnd←v7912, seg←v7940, segEnd←v7968)
   word slice←v7884;
   word trajEnd←v7912;
   word seg←v7940;
   word segEnd←v7968;
   {
   register ptr gf←c69020 =  (ptr) &globalframe;
   word success←v8012;
   W2 diff←v17844;
   word loJoint←v17872 = 0;
   word hiJoint←v17900 = 0;
   word trajData←v17928;
   /* AddSegment: */ 
SOURCE(4119, 1314)
SOURCE(4119, 1314)
   success←v8012 = 1;
SOURCE(4282, 39)
   trajData←v17928 = XR←Narrow((* (( (ptr) slice←v7884)+1) ), (* (( (ptr) gf←c69020)+6) ));
SOURCE(4323, 78)
   if (((*  (ptr) trajData←v17928 ) == 0) || ((*  (ptr) trajData←v17928 ) == 1)) {
SOURCE(4378, 15)
      success←v8012 = 0;
SOURCE(4395, 6)
      return(success←v8012);
      };
SOURCE(4404, 54)
   if ((trajEnd←v7912 == segEnd←v7968)) {
SOURCE(4429, 29)
      {
         word pd61;
         pd61 = (* (( (ptr) (* (( (ptr) gf←c69020)+187)/* var←c62940 */  ))+22) );
         (void) ( *( (fPt) ((*  (ptr) pd61 ))))(seg←v7940, pd61);
         };
      };
SOURCE(4460, 142)
   if ((trajEnd←v7912 == 0)) {
      {
         W2 var←c62972;
         (void) FetchJointPos←P1920((word) &var←c62972, slice←v7884, 0);
         {
            W2 var←c0138;
            {
               word pd62;
               pd62 = (* (( (ptr) (* (( (ptr) gf←c69020)+188)/* var←c63004 */  ))+11) );
               (void) ( *( (fPt) ((*  (ptr) pd62 ))))((word) &var←c0138, var←c62972, (*  (W2Pt) (( (ptr) seg←v7940)+11) ), pd62);
               };
            diff←v17844 = var←c0138;
            };
         };
      }
   else {
      {
         W2 var←c63036;
         (void) FetchJointPos←P1920((word) &var←c63036, slice←v7884, (* (( (ptr) trajData←v17928)+1) ));
         {
            W2 var←c0141;
            {
               word pd63;
               pd63 = (* (( (ptr) (* (( (ptr) gf←c69020)+188)/* var←c63004 */  ))+11) );
               (void) ( *( (fPt) ((*  (ptr) pd63 ))))((word) &var←c0141, var←c63036, (*  (W2Pt) (( (ptr) seg←v7940)+9) ), pd63);
               };
            diff←v17844 = var←c0141;
            };
         };
      };
SOURCE(4604, 37)
   {
      word pd64;
      pd64 = (* (( (ptr) (* (( (ptr) gf←c69020)+187)/* var←c62940 */  ))+27) );
      (void) ( *( (fPt) ((*  (ptr) pd64 ))))(seg←v7940, diff←v17844, pd64);
      };
SOURCE(4643, 790)
   if (((* (( (ptr) trajData←v17928)+1) ) == 0)) {
SOURCE(4675, 40)
      {
         word pd65;
         pd65 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+6) );
         (* (( (ptr) trajData←v17928)+2) ) = (word) ( *( (fPt) ((*  (ptr) pd65 ))))(seg←v7940, 1, pd65);
         };
SOURCE(4717, 41)
      {
         word var←c63068;
         var←c63068 = XR←NewObject(28, (* (( (ptr) gf←c69020)+13) ));
         (*  (W2Pt) var←c63068 ) = (*  (W2Pt) (( (ptr) seg←v7940)+9) );
         (*  (W4Pt) (( (ptr) var←c63068)+2) ) = (*  (W4Pt) (( (ptr) gf←c69020)+179)/* var←c62460 */  );
         loJoint←v17872 = var←c63068;
         };
SOURCE(4760, 41)
      {
         word var←c63100;
         var←c63100 = XR←NewObject(28, (* (( (ptr) gf←c69020)+13) ));
         (*  (W2Pt) var←c63100 ) = (*  (W2Pt) (( (ptr) seg←v7940)+11) );
         (*  (W4Pt) (( (ptr) var←c63100)+2) ) = (*  (W4Pt) (( (ptr) gf←c69020)+179)/* var←c62460 */  );
         hiJoint←v17900 = var←c63100;
         };
SOURCE(4803, 57)
      {
         word var←c63132;
         {
            word var←c63164;
            word var←c63196;
            var←c63164 = XR←NewObject(8, (* (( (ptr) gf←c69020)+14) ));
            var←c63196 = var←c63164;
            (*  (ptr) var←c63196 ) = loJoint←v17872;
            (* (( (ptr) var←c63196)+1) ) = XR←NewObject(8, (* (( (ptr) gf←c69020)+14) ));
            var←c63196 = (* (( (ptr) var←c63196)+1) );
            (*  (ptr) var←c63196 ) = hiJoint←v17900;
            var←c63132 = var←c63164;
            };
         {
            word pd66;
            pd66 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+18) );
            (* (( (ptr) trajData←v17928)+3) ) = (word) ( *( (fPt) ((*  (ptr) pd66 ))))(var←c63132, pd66);
            };
         };
SOURCE(4862, 21)
      (* (( (ptr) trajData←v17928)+1) ) = 1;
SOURCE(4885, 42)
      {
         W6 var←c63228;
         {
            word pd67;
            pd67 = (* (( (ptr) (*  (ptr) seg←v7940 ))+1) );
            var←c63228 = (*  (W6Pt) ( *( (fPt) ((*  (ptr) pd67 ))))(seg←v7940, pd67) );
            };
         (*  (W6Pt) (* (( (ptr) slice←v7884)+15) ) ) = var←c63228;
         };
      }
   else {
SOURCE(4938, 420)
      if ((trajEnd←v7912 == 0)) {
SOURCE(4961, 41)
         {
            word var←c63260;
            var←c63260 = XR←NewObject(28, (* (( (ptr) gf←c69020)+13) ));
            (*  (W2Pt) var←c63260 ) = (*  (W2Pt) (( (ptr) seg←v7940)+9) );
            (*  (W4Pt) (( (ptr) var←c63260)+2) ) = (*  (W4Pt) (( (ptr) gf←c69020)+179)/* var←c62460 */  );
            loJoint←v17872 = var←c63260;
            };
SOURCE(5004, 74)
         {
            word var←c63292;
            {
               word pd68;
               pd68 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+6) );
               var←c63292 = (word) ( *( (fPt) ((*  (ptr) pd68 ))))(loJoint←v17872, 1, pd68);
               };
            {
               word pd69;
               pd69 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+8) );
               (* (( (ptr) trajData←v17928)+3) ) = (word) ( *( (fPt) ((*  (ptr) pd69 ))))(var←c63292, (* (( (ptr) trajData←v17928)+3) ), pd69)
               ;
               };
            };
SOURCE(5080, 74)
         {
            word var←c63324;
            {
               word pd70;
               pd70 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+6) );
               var←c63324 = (word) ( *( (fPt) ((*  (ptr) pd70 ))))(seg←v7940, 1, pd70);
               };
            {
               word pd71;
               pd71 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+8) );
               (* (( (ptr) trajData←v17928)+2) ) = (word) ( *( (fPt) ((*  (ptr) pd71 ))))(var←c63324, (* (( (ptr) trajData←v17928)+2) ), pd71)
               ;
               };
            };
         }
      else {
SOURCE(5165, 41)
         {
            word var←c63356;
            var←c63356 = XR←NewObject(28, (* (( (ptr) gf←c69020)+13) ));
            (*  (W2Pt) var←c63356 ) = (*  (W2Pt) (( (ptr) seg←v7940)+11) );
            (*  (W4Pt) (( (ptr) var←c63356)+2) ) = (*  (W4Pt) (( (ptr) gf←c69020)+179)/* var←c62460 */  );
            hiJoint←v17900 = var←c63356;
            };
SOURCE(5208, 74)
         {
            word var←c63388;
            {
               word pd72;
               pd72 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+6) );
               var←c63388 = (word) ( *( (fPt) ((*  (ptr) pd72 ))))(hiJoint←v17900, 1, pd72);
               };
            {
               word pd73;
               pd73 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+8) );
               (* (( (ptr) trajData←v17928)+3) ) = (word) ( *( (fPt) ((*  (ptr) pd73 ))))((* (( (ptr) trajData←v17928)+3) ), var←c63388, pd73)
               ;
               };
            };
SOURCE(5284, 74)
         {
            word var←c63420;
            {
               word pd74;
               pd74 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+6) );
               var←c63420 = (word) ( *( (fPt) ((*  (ptr) pd74 ))))(seg←v7940, 1, pd74);
               };
            {
               word pd75;
               pd75 = (* (( (ptr) (* (( (ptr) gf←c69020)+186)/* var←c62748 */  ))+8) );
               (* (( (ptr) trajData←v17928)+2) ) = (word) ( *( (fPt) ((*  (ptr) pd75 ))))((* (( (ptr) trajData←v17928)+2) ), var←c63420, pd75)
               ;
               };
            };
         };
SOURCE(5363, 41)
      (* (( (ptr) trajData←v17928)+1) ) = ((* (( (ptr) trajData←v17928)+1) ) + 1);
SOURCE(5406, 27)
      {
         word pd76;
         pd76 = (* (( (ptr) (* (( (ptr) gf←c69020)+184)/* var←c62588 */  ))+68) );
         (void) ( *( (fPt) ((*  (ptr) pd76 ))))(slice←v7884, pd76);
         };
      };
SOURCE(4119, 1314)
   return(success←v8012);
   }

static void CloseWithSegment←P240(slice←v8072, seg←v8100, segEnd←v8128)
   word slice←v8072;
   word seg←v8100;
   word segEnd←v8128;
   {
   register ptr gf←c69052 =  (ptr) &globalframe;
   W2 diff←v17972;
   word trajData←v18000;
   /* CloseWithSegment: */ 
SOURCE(5442, 573)
SOURCE(5536, 39)
   trajData←v18000 = XR←Narrow((* (( (ptr) slice←v8072)+1) ), (* (( (ptr) gf←c69052)+6) ));
SOURCE(5614, 89)
   if (((* (( (ptr) trajData←v18000)+1) ) == 0)) {
SOURCE(5644, 59)
      {
         word var←c0159;
         var←c0159 = (* (( (ptr) gf←c69052)+29) );
         (void) XR←RaiseError((* (( (ptr) gf←c69052)+4)/* Problem←v4960 */  ), (word) &var←c0159);
         };
      };
SOURCE(5705, 49)
   if ((segEnd←v8128 == 1)) {
SOURCE(5725, 29)
      {
         word pd77;
         pd77 = (* (( (ptr) (* (( (ptr) gf←c69052)+187)/* var←c62940 */  ))+22) );
         (void) ( *( (fPt) ((*  (ptr) pd77 ))))(seg←v8100, pd77);
         };
      };
SOURCE(5756, 49)
   {
      W2 var←c63452;
      (void) LastJointPos←P2100((word) &var←c63452, slice←v8072);
      {
         W2 var←c0162;
         {
            word pd78;
            pd78 = (* (( (ptr) (* (( (ptr) gf←c69052)+188)/* var←c63004 */  ))+11) );
            (void) ( *( (fPt) ((*  (ptr) pd78 ))))((word) &var←c0162, var←c63452, (*  (W2Pt) (( (ptr) seg←v8100)+9) ), pd78);
            };
         diff←v17972 = var←c0162;
         };
      };
SOURCE(5807, 37)
   {
      word pd79;
      pd79 = (* (( (ptr) (* (( (ptr) gf←c69052)+187)/* var←c62940 */  ))+27) );
      (void) ( *( (fPt) ((*  (ptr) pd79 ))))(seg←v8100, diff←v17972, pd79);
      };
SOURCE(5846, 74)
   {
      word var←c63484;
      {
         word pd80;
         pd80 = (* (( (ptr) (* (( (ptr) gf←c69052)+186)/* var←c62748 */  ))+6) );
         var←c63484 = (word) ( *( (fPt) ((*  (ptr) pd80 ))))(seg←v8100, 1, pd80);
         };
      {
         word pd81;
         pd81 = (* (( (ptr) (* (( (ptr) gf←c69052)+186)/* var←c62748 */  ))+8) );
         (* (( (ptr) trajData←v18000)+2) ) = (word) ( *( (fPt) ((*  (ptr) pd81 ))))((* (( (ptr) trajData←v18000)+2) ), var←c63484, pd81)
         ;
         };
      };
SOURCE(5922, 41)
   (* (( (ptr) trajData←v18000)+1) ) = ((* (( (ptr) trajData←v18000)+1) ) + 1);
SOURCE(5965, 21)
   (*  (ptr) trajData←v18000 ) = 0;
SOURCE(5988, 27)
   {
      word pd82;
      pd82 = (* (( (ptr) (* (( (ptr) gf←c69052)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd82 ))))(slice←v8072, pd82);
      };
   }

static void CloseByDistorting←P300(slice←v8188, distortEnd←v8216)
   word slice←v8188;
   word distortEnd←v8216;
   {
   register ptr gf←c69084 =  (ptr) &globalframe;
   word seg←v18044 = 0;
   word loJoint←v18072 = 0;
   word hiJoint←v18100 = 0;
   word trajData←v18128;
   /* CloseByDistorting: */ 
SOURCE(6020, 735)
SOURCE(6130, 39)
   trajData←v18128 = XR←Narrow((* (( (ptr) slice←v8188)+1) ), (* (( (ptr) gf←c69084)+6) ));
SOURCE(6208, 30)
   loJoint←v18072 = (word) FetchJoint←P1860(slice←v8188, 0);
SOURCE(6240, 43)
   {
      word var←c63516;
      var←c63516 = (word) HiJoint←P2340(slice←v8188);
      hiJoint←v18100 = (word) FetchJoint←P1860(slice←v8188, var←c63516);
      };
SOURCE(6285, 328)
   {
      word var←c63548;
      var←c63548 = distortEnd←v8216;
      if ((var←c63548 == 0)) {
SOURCE(6316, 28)
         seg←v18044 = (word) FetchSegment←P1740(slice←v8188, 0);
SOURCE(6346, 29)
         (*  (W2Pt) loJoint←v18072 ) = (*  (W2Pt) hiJoint←v18100 );
SOURCE(6377, 22)
         (*  (W2Pt) (( (ptr) seg←v18044)+9) ) = (*  (W2Pt) hiJoint←v18100 );
SOURCE(6401, 49)
         {
            word pd83;
            pd83 = (* (( (ptr) (*  (ptr) seg←v18044 ))+9) );
            (void) ( *( (fPt) ((*  (ptr) pd83 ))))(seg←v18044, 1, (*  (W2Pt) hiJoint←v18100 ), pd83);
            };
         }
      else {
         if ((var←c63548 == 1)) {
SOURCE(6463, 43)
            {
               word var←c63580;
               var←c63580 = (word) HiSegment←P2220(slice←v8188);
               seg←v18044 = (word) FetchSegment←P1740(slice←v8188, var←c63580);
               };
SOURCE(6508, 29)
            (*  (W2Pt) hiJoint←v18100 ) = (*  (W2Pt) loJoint←v18072 );
SOURCE(6539, 22)
            (*  (W2Pt) (( (ptr) seg←v18044)+11) ) = (*  (W2Pt) loJoint←v18072 );
SOURCE(6563, 50)
            {
               word pd84;
               pd84 = (* (( (ptr) (*  (ptr) seg←v18044 ))+9) );
               (void) ( *( (fPt) ((*  (ptr) pd84 ))))(seg←v18044, 0, (*  (W2Pt) loJoint←v18072 ), pd84);
               };
            }
         else {
SOURCE(6629, 5)
            (void) XR←RaiseUnnamedError();
            };
         };
      };
SOURCE(6636, 67)
   {
      word var←c63612;
      var←c63612 = (word) HiJoint←P2340(slice←v8188);
      {
         word pd85;
         pd85 = (* (( (ptr) (* (( (ptr) gf←c69084)+186)/* var←c62748 */  ))+7) );
         (* (( (ptr) trajData←v18128)+3) ) = (word) ( *( (fPt) ((*  (ptr) pd85 ))))((* (( (ptr) trajData←v18128)+3) ), 0, var←c63612, pd85)
         ;
         };
      };
SOURCE(6705, 21)
   (*  (ptr) trajData←v18128 ) = 0;
SOURCE(6728, 27)
   {
      word pd86;
      pd86 = (* (( (ptr) (* (( (ptr) gf←c69084)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd86 ))))(slice←v8188, pd86);
      };
   }

static void SetSelectionBits←P360(traj←v8276, selected←v8304, selectClass←v8332)
   word traj←v8276;
   word selected←v8304;
   word selectClass←v8332;
   {
   register ptr gf←c69116 =  (ptr) &globalframe;
   word segGen←v18172 = 0;
   word jointGen←v18200 = 0;
   word joint←v18228 = 0;
   word trajData←v18256;
   /* SetSelectionBits: */ 
SOURCE(6761, 777)
SOURCE(6939, 38)
   trajData←v18256 = XR←Narrow((* (( (ptr) traj←v8276)+1) ), (* (( (ptr) gf←c69116)+6) ));
SOURCE(6979, 44)
   {
      word pd87;
      pd87 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+40) );
      segGen←v18172 = (word) ( *( (fPt) ((*  (ptr) pd87 ))))(trajData←v18256, pd87);
      };
SOURCE(7025, 262)
   {
      register word seg←v18300;
      {
         word pd88;
         pd88 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+46) );
         seg←v18300 = (word) ( *( (fPt) ((*  (ptr) pd88 ))))(segGen←v18172, pd88);
         };
      lab←L100003: ;
      if ((seg←v18300 != 0)) {
         }
      else {
         goto lab←L100000;
         };
SOURCE(7126, 43)
      (void) SetSegmentField←P3420(seg←v18300, selected←v8304, selectClass←v8332);
SOURCE(7171, 116)
      {
         register word i←v18344 = 0;
         register word noName←c63676;
         {
            word pd89;
            pd89 = (* (( (ptr) (*  (ptr) seg←v18300 ))+17) );
            noName←c63676 = (word) ( *( (fPt) ((*  (ptr) pd89 ))))(seg←v18300, pd89);
            };
         if ((i←v18344 >= noName←c63676)) {
            goto lab←L100004;
            };
         lab←L100007: ;
SOURCE(7226, 61)
         {
            word pd90;
            pd90 = (* (( (ptr) (*  (ptr) seg←v18300 ))+14) );
            (void) ( *( (fPt) ((*  (ptr) pd90 ))))(seg←v18300, i←v18344, selected←v8304, selectClass←v8332, pd90);
            };
         i←v18344 = (i←v18344 + 1);
         if ((i←v18344 < noName←c63676)) {
            goto lab←L100007;
            };
         lab←L100004: ;
         };
      {
         word pd91;
         pd91 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+46) );
         seg←v18300 = (word) ( *( (fPt) ((*  (ptr) pd91 ))))(segGen←v18172, pd91);
         };
      goto lab←L100003;
      lab←L100000: ;
      };
SOURCE(7307, 44)
   {
      word pd92;
      pd92 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+56) );
      jointGen←v18200 = (word) ( *( (fPt) ((*  (ptr) pd92 ))))(trajData←v18256, pd92);
      };
SOURCE(7353, 185)
   {
      register word jointNum←v18388;
      {
         word pd93;
         pd93 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+61) );
         jointNum←v18388 = (word) ( *( (fPt) ((*  (ptr) pd93 ))))(jointGen←v18200, pd93);
         };
      lab←L100011: ;
      if (( (int)jointNum←v18388 !=  (int) (word) -1)) {
         }
      else {
         goto lab←L100008;
         };
SOURCE(7459, 34)
      joint←v18228 = (word) FetchJoint←P1860(traj←v8276, SGNCK(jointNum←v18388));
SOURCE(7495, 43)
      (void) SetJointField←P3360(joint←v18228, selected←v8304, selectClass←v8332);
      {
         word pd94;
         pd94 = (* (( (ptr) (* (( (ptr) gf←c69116)+189)/* var←c63644 */  ))+61) );
         jointNum←v18388 = (word) ( *( (fPt) ((*  (ptr) pd94 ))))(jointGen←v18200, pd94);
         };
      goto lab←L100011;
      lab←L100008: ;
      };
   }

static word ReplaceFirstRun←P420(trajD←v8392, runProc←v8420, segmentsOnly←v8448, selectNewRuns←v8476)
   word trajD←v8392;
   word runProc←v8420;
   word segmentsOnly←v8448;
   word selectNewRuns←v8476;
   {
   register ptr gf←c69148 =  (ptr) &globalframe;
   word newOutline←v8520;
   /* ReplaceFirstRun: */ 
SOURCE(7553, 1020)
SOURCE(7553, 1020)
   newOutline←v8520 = 0;
SOURCE(7696, 877)
SOURCE(7698, 42)
   {
      word trajParts←v18432;
      word traj←v18460;
      word run←v18488 = 0;
      word runParts←v18516 = 0;
      word oldOutline←v18544;
SOURCE(7698, 42)
      trajParts←v18432 = XR←Narrow((* (( (ptr) trajD←v8392)+1) ), (* (( (ptr) gf←c69148)+18) ));
SOURCE(7742, 25)
      traj←v18460 = (*  (ptr) trajD←v8392 );
SOURCE(7812, 44)
      {
         word pd95;
         pd95 = (* (( (ptr) (* (( (ptr) gf←c69148)+190)/* var←c63708 */  ))+64) );
         oldOutline←v18544 = (word) ( *( (fPt) ((*  (ptr) pd95 ))))(traj←v18460, pd95);
         };
SOURCE(7859, 266)
      {
         word pd96;
         pd96 = (* (( (ptr) (* (( (ptr) gf←c69148)+189)/* var←c63644 */  ))+26) );
         if ((0 != (word) ( *( (fPt) ((*  (ptr) pd96 ))))(trajParts←v18432, pd96))) {
SOURCE(7902, 11)
            run←v18488 = trajD←v8392;
SOURCE(7915, 20)
            runParts←v18516 = trajParts←v18432;
            }
         else {
SOURCE(7946, 41)
            {
               word pd97;
               pd97 = (* (( (ptr) (* (( (ptr) gf←c69148)+189)/* var←c63644 */  ))+39) );
               runParts←v18516 = (word) ( *( (fPt) ((*  (ptr) pd97 ))))(trajParts←v18432, pd97);
               };
SOURCE(7989, 23)
            if ((runParts←v18516 == 0)) {
SOURCE(8012, 21)
               goto lab←L100012;
               };
SOURCE(8076, 49)
            {
               word pd98;
               pd98 = (* (( (ptr) (* (( (ptr) gf←c69148)+184)/* var←c62588 */  ))+8) );
               run←v18488 = (word) ( *( (fPt) ((*  (ptr) pd98 ))))(traj←v18460, runParts←v18516, pd98);
               };
            };
         };
SOURCE(8131, 288)
      if (((* (( (ptr) runParts←v18516)+3) ) > 0) || (0 == segmentsOnly←v8448)) {
SOURCE(8179, 242)
         {
            word newRun←v18588;
SOURCE(8181, 28)
            newRun←v18588 = (word) ( *( (fPt) ((*  (ptr) runProc←v8420 ))))(run←v18488, runProc←v8420);
SOURCE(8211, 149)
            if ((newRun←v18588 != 0)) {
SOURCE(8232, 39)
               (void) SetSelectionBits←P360(newRun←v18588, 0, 2);
SOURCE(8300, 60)
               if ((0 != selectNewRuns←v8476)) {
SOURCE(8322, 38)
                  (void) SetSelectionBits←P360(newRun←v18588, 1, 0);
                  };
               };
SOURCE(8365, 54)
            {
               word var←c63740;
               var←c63740 = (word) SpliceIn←P1020(run←v18488, newRun←v18588);
               {
                  word pd99;
                  pd99 = (* (( (ptr) (* (( (ptr) gf←c69148)+190)/* var←c63708 */  ))+64) );
                  newOutline←v8520 = (word) ( *( (fPt) ((*  (ptr) pd99 ))))(var←c63740, pd99);
                  };
               };
            };
         }
      else {
SOURCE(8428, 21)
         goto lab←L100012;
         };
      };
   goto lab←L100013;
   lab←L100012: ;
SOURCE(8479, 44)
   (void) SetSelectionBits←P360((*  (ptr) trajD←v8392 ), 0, 2);
SOURCE(8552, 16)
   newOutline←v8520 = 0;
   lab←L100013: ;
SOURCE(7553, 1020)
   return(newOutline←v8520);
   }

static void SegToSegMatchCp←P480(seg←v8580, traj←v8608, makeCurve←v8636, type←v8664)
   word seg←v8580;
   word traj←v8608;
   word makeCurve←v8636;
   word type←v8664;
   {
   register ptr gf←c69180 =  (ptr) &globalframe;
   word tSeg←v18632 = 0;
   word success←v18660 = 0;
   /* SegToSegMatchCp: */ 
SOURCE(8577, 1364)
SOURCE(8714, 1202)
   if (((*  (ptr) (*  (ptr) seg←v8580 ) ) == type←v8664)) {
SOURCE(8790, 216)
      if ((type←v8664 == (* (( (ptr) gf←c69180)+28) ))) {
SOURCE(8814, 43)
         tSeg←v18632 = (word) ( *( (fPt) ((*  (ptr) makeCurve←v8636 ))))((*  (W2Pt) (( (ptr) seg←v8580)+9) ), (*  (W2Pt) (( (ptr) seg←v8580)+11)
             ), (* (( (ptr) seg←v8580)+25) ), makeCurve←v8636);
SOURCE(8859, 71)
         {
            W2 var←c63772;
            {
               word pd100;
               pd100 = (* (( (ptr) (*  (ptr) seg←v8580 ))+16) );
               (void) ( *( (fPt) ((*  (ptr) pd100 ))))((word) &var←c63772, seg←v8580, 0, pd100);
               };
            {
               word pd101;
               pd101 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+13) );
               (void) ( *( (fPt) ((*  (ptr) pd101 ))))(tSeg←v18632, var←c63772, pd101);
               };
            };
SOURCE(8932, 30)
         {
            word pd102;
            pd102 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+18) );
            (void) ( *( (fPt) ((*  (ptr) pd102 ))))(seg←v8580, tSeg←v18632, pd102);
            };
         }
      else {
SOURCE(8973, 33)
         {
            word pd103;
            pd103 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+17) );
            tSeg←v18632 = (word) ( *( (fPt) ((*  (ptr) pd103 ))))(seg←v8580, pd103);
            };
         };
SOURCE(9011, 40)
      success←v18660 = (word) AddSegment←P180(traj←v8608, 1, tSeg←v18632, 0);
      }
   else {
SOURCE(9060, 856)
      {
         word tc104;
         word pd105;
         if ((type←v8664 == (* (( (ptr) gf←c69180)+26) ))) {
            pd105 = (* (( (ptr) (*  (ptr) seg←v8580 ))+17) );
            tc104 =  (word) ((word) ( *( (fPt) ((*  (ptr) pd105 ))))(seg←v8580, pd105) == 1);
            }
         else {
            tc104 =  (word) 0;
            };
         if (tc104) {
SOURCE(9221, 86)
            {
               W2 var←c63804;
               {
                  word pd106;
                  pd106 = (* (( (ptr) (*  (ptr) seg←v8580 ))+16) );
                  (void) ( *( (fPt) ((*  (ptr) pd106 ))))((word) &var←c63804, seg←v8580, 0, pd106);
                  };
               {
                  word pd107;
                  pd107 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+8) );
                  tSeg←v18632 = (word) ( *( (fPt) ((*  (ptr) pd107 ))))((*  (W2Pt) (( (ptr) seg←v8580)+9) ), var←c63804, (*  (W2Pt) (( (ptr) seg←v8580)+11)
                      ), (* (( (ptr) seg←v8580)+25) ), pd107);
                  };
               };
SOURCE(9309, 30)
            {
               word pd108;
               pd108 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+18) );
               (void) ( *( (fPt) ((*  (ptr) pd108 ))))(seg←v8580, tSeg←v18632, pd108);
               };
SOURCE(9341, 42)
            success←v18660 = (word) AddSegment←P180(traj←v8608, 1, tSeg←v18632, 0);
            }
         else {
SOURCE(9390, 526)
            {
               word tc109;
               word pd110;
               if ((type←v8664 == (* (( (ptr) gf←c69180)+28) ))) {
                  pd110 = (* (( (ptr) (*  (ptr) seg←v8580 ))+17) );
                  tc109 =  (word) ((word) ( *( (fPt) ((*  (ptr) pd110 ))))(seg←v8580, pd110) == 1);
                  }
               else {
                  tc109 =  (word) 0;
                  };
               if (tc109) {
SOURCE(9548, 43)
                  tSeg←v18632 = (word) ( *( (fPt) ((*  (ptr) makeCurve←v8636 ))))((*  (W2Pt) (( (ptr) seg←v8580)+9) ), (*  (W2Pt) (( (ptr) seg←v8580)+11)
                      ), (* (( (ptr) seg←v8580)+25) ), makeCurve←v8636);
SOURCE(9593, 71)
                  {
                     W2 var←c63836;
                     {
                        word pd111;
                        pd111 = (* (( (ptr) (*  (ptr) seg←v8580 ))+16) );
                        (void) ( *( (fPt) ((*  (ptr) pd111 ))))((word) &var←c63836, seg←v8580, 0, pd111);
                        };
                     {
                        word pd112;
                        pd112 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+13) );
                        (void) ( *( (fPt) ((*  (ptr) pd112 ))))(tSeg←v18632, var←c63836, pd112);
                        };
                     };
SOURCE(9666, 30)
                  {
                     word pd113;
                     pd113 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+18) );
                     (void) ( *( (fPt) ((*  (ptr) pd113 ))))(seg←v8580, tSeg←v18632, pd113);
                     };
SOURCE(9698, 41)
                  success←v18660 = (word) AddSegment←P180(traj←v8608, 1, tSeg←v18632, 0);
                  }
               else {
SOURCE(9799, 43)
                  tSeg←v18632 = (word) ( *( (fPt) ((*  (ptr) makeCurve←v8636 ))))((*  (W2Pt) (( (ptr) seg←v8580)+9) ), (*  (W2Pt) (( (ptr) seg←v8580)+11)
                      ), (* (( (ptr) seg←v8580)+25) ), makeCurve←v8636);
SOURCE(9844, 30)
                  {
                     word pd114;
                     pd114 = (* (( (ptr) (* (( (ptr) gf←c69180)+187)/* var←c62940 */  ))+18) );
                     (void) ( *( (fPt) ((*  (ptr) pd114 ))))(seg←v8580, tSeg←v18632, pd114);
                     };
SOURCE(9876, 40)
                  success←v18660 = (word) AddSegment←P180(traj←v8608, 1, tSeg←v18632, 0);
                  };
               };
            };
         };
      };
SOURCE(9921, 20)
   if ((0 == success←v18660)) {
SOURCE(9941, 5)
      (void) XR←RaiseUnnamedError();
      };
   }

static void SegAndCpsToSegs←P540(seg←v8724, traj←v8752, makeCurve←v8780, type←v8808)
   word seg←v8724;
   word traj←v8752;
   word makeCurve←v8780;
   word type←v8808;
   {
   register ptr gf←c69212 =  (ptr) &globalframe;
   word success←v18704 = 0;
   /* SegAndCpsToSegs: */ 
SOURCE(9952, 876)
SOURCE(10074, 754)
   if (((*  (ptr) (*  (ptr) seg←v8724 ) ) == type←v8808)) {
SOURCE(10165, 68)
      {
         word var←c63868;
         {
            word pd115;
            pd115 = (* (( (ptr) (* (( (ptr) gf←c69212)+187)/* var←c62940 */  ))+17) );
            var←c63868 = (word) ( *( (fPt) ((*  (ptr) pd115 ))))(seg←v8724, pd115);
            };
         success←v18704 = (word) AddSegment←P180(traj←v8752, 1, var←c63868, 0);
         };
      }
   else {
SOURCE(10233, 602)
      {
         word tSeg←v18748 = 0;
         W2 last←v18776;
         W2 next←v18804;
SOURCE(10329, 26)
         last←v18776 = (*  (W2Pt) (( (ptr) seg←v8724)+9) );
         next←v18804 = last←v18776;
SOURCE(10357, 286)
         {
            register word i←v18848 = 0;
            register word noName←c63900;
            {
               word pd116;
               pd116 = (* (( (ptr) (*  (ptr) seg←v8724 ))+17) );
               noName←c63900 = (word) ( *( (fPt) ((*  (ptr) pd116 ))))(seg←v8724, pd116);
               };
            if (( (int)i←v18848 >=  (int)noName←c63900)) {
               goto lab←L100014;
               };
            lab←L100017: ;
SOURCE(10411, 40)
            {
               word pd117;
               pd117 = (* (( (ptr) (*  (ptr) seg←v8724 ))+16) );
               (void) ( *( (fPt) ((*  (ptr) pd117 ))))((word) &next←v18804, seg←v8724, SGNCK(i←v18848), pd117);
               };
SOURCE(10453, 39)
            tSeg←v18748 = (word) ( *( (fPt) ((*  (ptr) makeCurve←v8780 ))))(last←v18776, next←v18804, (* (( (ptr) seg←v8724)+25) ), makeCurve←v8780)
            ;
SOURCE(10494, 30)
            {
               word pd118;
               pd118 = (* (( (ptr) (* (( (ptr) gf←c69212)+187)/* var←c62940 */  ))+18) );
               (void) ( *( (fPt) ((*  (ptr) pd118 ))))(seg←v8724, tSeg←v18748, pd118);
               };
SOURCE(10563, 40)
            success←v18704 = (word) AddSegment←P180(traj←v8752, 1, tSeg←v18748, 0);
SOURCE(10605, 20)
            if ((0 == success←v18704)) {
SOURCE(10625, 5)
               (void) XR←RaiseUnnamedError();
               };
SOURCE(10632, 11)
            last←v18776 = next←v18804;
            i←v18848 = (i←v18848 + 1);
            if (( (int)i←v18848 <  (int)noName←c63900)) {
               goto lab←L100017;
               };
            lab←L100014: ;
            };
SOURCE(10654, 41)
         tSeg←v18748 = (word) ( *( (fPt) ((*  (ptr) makeCurve←v8780 ))))(last←v18776, (*  (W2Pt) (( (ptr) seg←v8724)+11) ), (* (( (ptr) seg←v8724)+25)
             ), makeCurve←v8780);
SOURCE(10697, 30)
         {
            word pd119;
            pd119 = (* (( (ptr) (* (( (ptr) gf←c69212)+187)/* var←c62940 */  ))+18) );
            (void) ( *( (fPt) ((*  (ptr) pd119 ))))(seg←v8724, tSeg←v18748, pd119);
            };
SOURCE(10766, 40)
         success←v18704 = (word) AddSegment←P180(traj←v8752, 1, tSeg←v18748, 0);
SOURCE(10808, 20)
         if ((0 == success←v18704)) {
SOURCE(10828, 5)
            (void) XR←RaiseUnnamedError();
            };
         };
      };
   }

static word DeleteControlPoints←P600(trajD←v8868, scene←v8896)
   word trajD←v8868;
   word scene←v8896;
   {
   register ptr gf←c69244 =  (ptr) &globalframe;
   word bBox←v8940;
   word trajData←v18892;
   word trajParts←v18920;
   word outlineOfTraj←v18948;
   /* DeleteControlPoints: */ 
SOURCE(10842, 1138)
SOURCE(10842, 1138)
   bBox←v8940 = 0;
SOURCE(10943, 45)
   trajData←v18892 = XR←Narrow((* (( (ptr) (*  (ptr) trajD←v8868 ))+1) ), (* (( (ptr) gf←c69244)+6) ));
SOURCE(10990, 42)
   trajParts←v18920 = XR←Narrow((* (( (ptr) trajD←v8868)+1) ), (* (( (ptr) gf←c69244)+18) ));
SOURCE(11034, 54)
   {
      word pd120;
      pd120 = (* (( (ptr) (* (( (ptr) gf←c69244)+190)/* var←c63708 */  ))+64) );
      outlineOfTraj←v18948 = (word) ( *( (fPt) ((*  (ptr) pd120 ))))((*  (ptr) (trajD←v8868) ), pd120);
      };
SOURCE(11090, 33)
   {
      word pd121;
      pd121 = (* (( (ptr) (* (( (ptr) gf←c69244)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd121 ))))((*  (ptr) (trajD←v8868) ), pd121);
      };
SOURCE(11125, 38)
   (void) SaveSelection←P2760((*  (ptr) trajD←v8868 ), 1, scene←v8896);
SOURCE(11207, 41)
   (void) SaveSelection←P2760((*  (ptr) trajD←v8868 ), 0, scene←v8896);
SOURCE(11250, 644)
   {
      register word i←v18992 = 0;
      register word noName←c63932;
      word var←c63964;
      word var←c64028;
      noName←c63932 = (* (( (ptr) trajData←v18892)+1) );
      if (( (int)i←v18992 >=  (int)noName←c63932)) {
         goto lab←L100018;
         };
      lab←L100021: ;
SOURCE(11290, 604)
      {
         word tc122;
         word pd123;
         word limit124;
         word limit125;
         var←c63964 = (* (( (ptr) trajParts←v18920)+2) );
         pd123 = (* (( (ptr) (* (( (ptr) gf←c69244)+191)/* var←c63996 */  ))+34) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd123 ))))((* (((( (ptr) var←c63964)+1)+(
                  limit124 = (*  (ptr) var←c63964 ),
                  BCK(i←v18992, limit124)
                  ))) ), pd123))) {
            var←c64028 = (*  (ptr) trajParts←v18920 );
            tc122 =  (word)  ! XR←ExtractField(var←c64028, 32 + (word) (
                  limit125 = (*  (ptr) var←c64028 ),
                  BCK(i←v18992, limit125)
                  ), 1);
            }
         else {
            tc122 =  (word) 0;
            };
         if (tc122) {
SOURCE(11379, 520)
            {
               word oldSeg←v19036;
SOURCE(11381, 46)
               oldSeg←v19036 = (word) FetchSegment←P1740((*  (ptr) trajD←v8868 ), SGNCK(i←v18992));
SOURCE(11429, 465)
               if (((*  (ptr) (*  (ptr) oldSeg←v19036 ) ) == (* (( (ptr) gf←c69244)+25) ))) {
SOURCE(11470, 314)
                  {
                     word newSeg←v19080;
                     word newRun←v19108;
SOURCE(11472, 84)
                     {
                        word var←c64060;
                        word var←c0995;
                        var←c64060 = (* (( (ptr) trajParts←v18920)+2) );
                        {
                           word limit126;
                           var←c0995 = (* ((( (ptr) var←c64060)+1)+(
/*1*/      limit126 = (*  (ptr) var←c64060 ),
/*1*/      BCK(i←v18992, limit126)
/*1*/      )) );
                           };
                        {
                           word pd127;
                           pd127 = (* (( (ptr) (* (( (ptr) gf←c69244)+187)/* var←c62940 */  ))+31) );
                           newSeg←v19080 = (word) ( *( (fPt) ((*  (ptr) pd127 ))))(oldSeg←v19036, var←c0995, pd127);
                           };
                        };
SOURCE(11558, 37)
                     newRun←v19108 = (word) CreateTraj←P120((*  (W2Pt) ((( (ptr) newSeg←v19080)+9)) ));
SOURCE(11597, 65)
                     {
                        word pd128;
                        pd128 = (* (( (ptr) (* (( (ptr) gf←c69244)+192)/* var←c64092 */  ))+57) );
                        (void) ( *( (fPt) ((*  (ptr) pd128 ))))(newRun←v19108, 0, (* (( (ptr) trajData←v18892)+6) ), 0, pd128);
                        };
SOURCE(11664, 47)
                     if ((0 == (word) AddSegment←P180(newRun←v19108, 1, newSeg←v19080, 0))) {
SOURCE(11711, 5)
                        (void) XR←RaiseUnnamedError();
                        };
SOURCE(11718, 66)
                     {
                        W2 var←c64156;
                        {
                           word pd129;
                           pd129 = (* (( (ptr) (* (( (ptr) gf←c69244)+193)/* var←c64124 */  ))+23) );
                           (void) ( *( (fPt) ((*  (ptr) pd129 ))))((word) &var←c64156, (*  (ptr) trajD←v8868 ), SGNCK(i←v18992), newRun←v19108, scene←v8896, pd129)
                           ;
                           };
                        };
                     };
                  }
               else {
SOURCE(11793, 101)
                  {
                     word pd130;
                     pd130 = (* (( (ptr) (* (( (ptr) gf←c69244)+194)/* var←c64188 */  ))+4) );
                     (void) ( *( (fPt) ((*  (ptr) pd130 ))))((* (( (ptr) gf←c69244)+22) ), 0, (* (( (ptr) gf←c69244)+23) ), (* (( (ptr) gf←c69244)+24)
                         ), pd130);
                     };
                  };
               };
            };
         };
      i←v18992 = (i←v18992 + 1);
      if (( (int)i←v18992 <  (int)noName←c63932)) {
         goto lab←L100021;
         };
      lab←L100018: ;
      };
SOURCE(11911, 69)
   {
      word var←c64220;
      {
         word pd131;
         pd131 = (* (( (ptr) (* (( (ptr) gf←c69244)+192)/* var←c64092 */  ))+7) );
         var←c64220 = (word) ( *( (fPt) ((*  (ptr) pd131 ))))(outlineOfTraj←v18948, 0, pd131);
         };
      {
         word pd132;
         pd132 = (* (( (ptr) (* (( (ptr) gf←c69244)+185)/* var←c62652 */  ))+7) );
         bBox←v8940 = (word) ( *( (fPt) ((*  (ptr) pd132 ))))(var←c64220, pd132);
         };
      };
SOURCE(10842, 1138)
   return(bBox←v8940);
   }

static void DeleteSequence←P660(formal←c0246, seq←v9000)
   word formal←c0246;
   word seq←v9000;
   {
   register ptr gf←c69276 =  (ptr) &globalframe;
   word smallerOutline←v9044;
   word openTrajOutlines←v9072;
   word traj←v19152;
   word trajData←v19180;
   word trajParts←v19208;
   word oldOutline←v19236;
   /* DeleteSequence: */ 
SOURCE(11986, 582)
SOURCE(11986, 582)
   smallerOutline←v9044 = 0;
SOURCE(11986, 582)
   openTrajOutlines←v9072 = 0;
SOURCE(12106, 23)
   traj←v19152 = (*  (ptr) seq←v9000 );
SOURCE(12131, 38)
   trajData←v19180 = XR←Narrow((* (( (ptr) traj←v19152)+1) ), (* (( (ptr) gf←c69276)+6) ));
SOURCE(12171, 40)
   trajParts←v19208 = XR←Narrow((* (( (ptr) seq←v9000)+1) ), (* (( (ptr) gf←c69276)+18) ));
SOURCE(12213, 44)
   {
      word pd133;
      pd133 = (* (( (ptr) (* (( (ptr) gf←c69276)+190)/* var←c63708 */  ))+64) );
      oldOutline←v19236 = (word) ( *( (fPt) ((*  (ptr) pd133 ))))(traj←v19152, pd133);
      };
SOURCE(12260, 308)
   {
      word var←c64252;
      var←c64252 = (*  (ptr) trajData←v19180 );
      switch (var←c64252) {
         case 0: case 1: 
SOURCE(12303, 51)
            openTrajOutlines←v9072 = (word) OutlinesOfTrajMinusSequence←P720(seq←v9000);
SOURCE(12390, 62)
            {
               word pd134;
               pd134 = (* (( (ptr) (* (( (ptr) gf←c69276)+195)/* var←c64284 */  ))+8) );
               smallerOutline←v9044 = (word) ( *( (fPt) ((*  (ptr) pd134 ))))(oldOutline←v19236, traj←v19152, 0, pd134);
               };
            break;
         case 2: 
SOURCE(12495, 51)
            openTrajOutlines←v9072 = (word) OutlinesOfTrajMinusSequence←P720(seq←v9000);
SOURCE(12548, 20)
            smallerOutline←v9044 = 0;
            break;
         default: 
SOURCE(12584, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
   /* removed tail goto */ 
   (*  (ptr) formal←c0246 ) = smallerOutline←v9044;
   (* (( (ptr) formal←c0246)+1) ) = openTrajOutlines←v9072;
   return;
   }

static word OutlinesOfTrajMinusSequence←P720(seq←v9216)
   word seq←v9216;
   {
   register ptr gf←c69308 =  (ptr) &globalframe;
   word newOutlines←v9260;
   word keepParts←v19280 = 0;
   word wholeTrajParts←v19308 = 0;
   word traj←v19336;
   word trajData←v19364;
   word trajParts←v19392;
   /* OutlinesOfTrajMinusSequence: */ 
SOURCE(12595, 610)
SOURCE(12595, 610)
   newOutlines←v9260 = 0;
SOURCE(12748, 23)
   traj←v19336 = (*  (ptr) seq←v9216 );
SOURCE(12773, 38)
   trajData←v19364 = XR←Narrow((* (( (ptr) traj←v19336)+1) ), (* (( (ptr) gf←c69308)+6) ));
SOURCE(12813, 40)
   trajParts←v19392 = XR←Narrow((* (( (ptr) seq←v9216)+1) ), (* (( (ptr) gf←c69308)+18) ));
SOURCE(12856, 52)
   {
      word pd135;
      pd135 = (* (( (ptr) (* (( (ptr) gf←c69308)+189)/* var←c63644 */  ))+26) );
      if ((0 != (word) ( *( (fPt) ((*  (ptr) pd135 ))))(trajParts←v19392, pd135))) {
SOURCE(12897, 11)
         return(0);
         };
      };
SOURCE(12910, 52)
   {
      word pd136;
      pd136 = (* (( (ptr) (* (( (ptr) gf←c69308)+189)/* var←c63644 */  ))+7) );
      wholeTrajParts←v19308 = (word) ( *( (fPt) ((*  (ptr) pd136 ))))(trajData←v19364, pd136);
      };
SOURCE(12964, 112)
   {
      word tc137;
      word pd138;
      pd138 = (* (( (ptr) (* (( (ptr) gf←c69308)+189)/* var←c63644 */  ))+25) );
      if ((0 == (word) ( *( (fPt) ((*  (ptr) pd138 ))))(trajParts←v19392, pd138))) {
         tc137 =  (word) ((* (( (ptr) trajData←v19364)+1) ) == 1);
         }
      else {
         tc137 =  (word) 0;
         };
      if (tc137) {
SOURCE(13030, 46)
         {
            word var←c64316;
            var←c64316 = (word) FetchSegment←P1740(traj←v19336, 0);
            {
               word pd139;
               pd139 = (* (( (ptr) (* (( (ptr) gf←c69308)+187)/* var←c62940 */  ))+23) );
               (void) ( *( (fPt) ((*  (ptr) pd139 ))))(var←c64316, pd139);
               };
            };
         };
      };
SOURCE(13078, 89)
   {
      word var←c64348;
      {
         word pd140;
         pd140 = (* (( (ptr) (* (( (ptr) gf←c69308)+184)/* var←c62588 */  ))+8) );
         var←c64348 = (word) ( *( (fPt) ((*  (ptr) pd140 ))))(traj←v19336, wholeTrajParts←v19308, pd140);
         };
      {
         word pd141;
         pd141 = (* (( (ptr) (* (( (ptr) gf←c69308)+189)/* var←c63644 */  ))+21) );
         keepParts←v19280 = (word) ( *( (fPt) ((*  (ptr) pd141 ))))(var←c64348, seq←v9216, pd141);
         };
      };
SOURCE(13169, 36)
   newOutlines←v9260 = (word) GroupPieces←P780(keepParts←v19280);
SOURCE(12595, 610)
   return(newOutlines←v9260);
   }

static word GroupPieces←P780(seq←v9404)
   word seq←v9404;
   {
   register ptr gf←c69340 =  (ptr) &globalframe;
   word newOutlines←v9448;
   word seqTraj←v19436;
   word seqData←v19464;
   word seqParts←v19492;
   word seqGen←v19520 = 0;
   word newTraj←v19548 = 0;
   word newTrajData←v19576 = 0;
   word newOutline←v19604 = 0;
   word oldOutline←v19632 = 0;
   word joint←v19660 = 0;
   /* GroupPieces: */ 
SOURCE(13211, 968)
SOURCE(13211, 968)
   newOutlines←v9448 = 0;
SOURCE(13293, 26)
   seqTraj←v19436 = (*  (ptr) seq←v9404 );
SOURCE(13321, 40)
   seqData←v19464 = XR←Narrow((* (( (ptr) seqTraj←v19436)+1) ), (* (( (ptr) gf←c69340)+6) ));
SOURCE(13363, 39)
   seqParts←v19492 = XR←Narrow((* (( (ptr) seq←v9404)+1) ), (* (( (ptr) gf←c69340)+18) ));
SOURCE(13516, 40)
   {
      word pd142;
      pd142 = (* (( (ptr) (* (( (ptr) gf←c69340)+190)/* var←c63708 */  ))+64) );
      oldOutline←v19632 = (word) ( *( (fPt) ((*  (ptr) pd142 ))))(seqTraj←v19436, pd142);
      };
SOURCE(13558, 52)
   {
      W2 var←c64380;
      {
         word pd143;
         pd143 = (* (( (ptr) (* (( (ptr) gf←c69340)+189)/* var←c63644 */  ))+37) );
         (void) ( *( (fPt) ((*  (ptr) pd143 ))))((word) &var←c64380, seqParts←v19492, pd143);
         };
      seqGen←v19520 = var←c64380.f0;
      };
SOURCE(13612, 567)
   {
      register word run←v19704;
      {
         word pd144;
         pd144 = (* (( (ptr) (* (( (ptr) gf←c69340)+189)/* var←c63644 */  ))+38) );
         run←v19704 = (word) ( *( (fPt) ((*  (ptr) pd144 ))))(seqGen←v19520, pd144);
         };
      lab←L100026: ;
      if ((run←v19704 != 0)) {
         }
      else {
         goto lab←L100023;
         };
SOURCE(13717, 23)
      if (((* (( (ptr) run←v19704)+3) ) == 0)) {
SOURCE(13740, 4)
         goto lab←L100025;
         };
SOURCE(13784, 39)
      newTraj←v19548 = (word) CopyTrajFromRun←P840(seqTraj←v19436, run←v19704);
SOURCE(13825, 30)
      joint←v19660 = (word) FetchJoint←P1860(newTraj←v19548, 0);
SOURCE(13857, 36)
      (* (( (ptr) joint←v19660)+4) ) = 0;
SOURCE(13895, 45)
      {
         word var←c64412;
         var←c64412 = (word) HiJoint←P2340(newTraj←v19548);
         joint←v19660 = (word) FetchJoint←P1860(newTraj←v19548, var←c64412);
         };
SOURCE(13942, 36)
      (* (( (ptr) joint←v19660)+4) ) = 0;
SOURCE(13980, 34)
      newTrajData←v19576 = XR←Narrow((* (( (ptr) newTraj←v19548)+1) ), (* (( (ptr) gf←c69340)+6) ));
SOURCE(14016, 23)
      (*  (ptr) newTrajData←v19576 ) = 2;
SOURCE(14041, 93)
      {
         W2 var←c0272;
         word var←c64444;
         {
            word pd145;
            pd145 = (* (( (ptr) (* (( (ptr) gf←c69340)+192)/* var←c64092 */  ))+62) );
            (void) ( *( (fPt) ((*  (ptr) pd145 ))))((word) &var←c0272, oldOutline←v19632, 0, pd145);
            };
         var←c64444 = var←c0272.f0;
         {
            word pd146;
            pd146 = (* (( (ptr) (* (( (ptr) gf←c69340)+195)/* var←c64284 */  ))+5) );
            newOutline←v19604 = (word) ( *( (fPt) ((*  (ptr) pd146 ))))(newTraj←v19548, var←c64444, pd146);
            };
         };
SOURCE(14136, 43)
      {
         word var←c64476;
         var←c64476 = XR←NewObject(8, (* (( (ptr) gf←c69340)+21) ));
         (*  (ptr) var←c64476 ) = newOutline←v19604;
         (* (( (ptr) var←c64476)+1) ) = newOutlines←v9448;
         newOutlines←v9448 = var←c64476;
         };
      lab←L100025: ;
      {
         word pd147;
         pd147 = (* (( (ptr) (* (( (ptr) gf←c69340)+189)/* var←c63644 */  ))+38) );
         run←v19704 = (word) ( *( (fPt) ((*  (ptr) pd147 ))))(seqGen←v19520, pd147);
         };
      goto lab←L100026;
      lab←L100023: ;
      };
SOURCE(13211, 968)
   return(newOutlines←v9448);
   }

static word CopyTrajFromRun←P840(slice←v9592, run←v9620)
   word slice←v9592;
   word run←v9620;
   {
   W14 var←c69372;
   register ptr gf←c69404 =  (ptr) &globalframe;
   word copy←v9664;
   /* declaration of var←c64508 skipped */ 
   /* declaration of var←c64540 skipped */ 
   word trajData←v19748;
   word trajParts←v19776;
   word originalSegments←v19804;
   /* declaration of desiredSegments←v19832 skipped */ 
   word loSegments←v19860 = 0;
   word hiSegments←v19888 = 0;
   word extractedSegments←v19916 = 0;
   word originalJoints←v19944;
   /* declaration of desiredJoints←v19972 skipped */ 
   word loJoints←v20000 = 0;
   word hiJoints←v20028 = 0;
   word extractedJoints←v20056 = 0;
   word segGen←v20084 = 0;
   W2 next←v20112;
   word s1←v20140;
   word len1←v20168;
   word s2←v20196;
   word len2←v20224;
   word jointCount←v20252;
   word newRole←v20280;
   /* CopyTrajFromRun: */ 
SOURCE(14194, 2769)
   {
      word tmpAddr148;
      tmpAddr148 = (word) (( (ptr) &var←c69372)+4)/* var←c64508 */ ;
      (*  (ptr) tmpAddr148 ) = ( ((word)  (fPt) CopyEachJoint←P5028) );
      (* (( (ptr) tmpAddr148) + 1) ) = 1;
      };
   {
      word tmpAddr149;
      tmpAddr149 = (word) (( (ptr) &var←c69372)+6)/* var←c64540 */ ;
      (*  (ptr) tmpAddr149 ) = ( ((word)  (fPt) CopyEachSegment←P4968) );
      (* (( (ptr) tmpAddr149) + 1) ) = 1;
      };
SOURCE(14194, 2769)
   copy←v9664 = 0;
SOURCE(14280, 39)
   trajData←v19748 = XR←Narrow((* (( (ptr) slice←v9592)+1) ), (* (( (ptr) gf←c69404)+6) ));
SOURCE(14321, 26)
   trajParts←v19776 = run←v9620;
SOURCE(14349, 51)
   originalSegments←v19804 = (* (( (ptr) trajData←v19748)+2) );
SOURCE(14402, 31)
   (* (( (ptr) &var←c69372)+8) ) = 0;
   (* (( (ptr) &var←c69372)+9) ) = 0;
   (* (( (ptr) &var←c69372)+10) ) = 2147483647;
SOURCE(14493, 47)
   originalJoints←v19944 = (* (( (ptr) trajData←v19748)+3) );
SOURCE(14542, 29)
   (* (( (ptr) &var←c69372)+11) ) = 0;
   (* (( (ptr) &var←c69372)+12) ) = 0;
   (* (( (ptr) &var←c69372)+13) ) = 2147483647;
SOURCE(14651, 28)
   next←v20112.f0 = 0;
   next←v20112.f1 = 0;
SOURCE(15366, 66)
   {
      word pd150;
      pd150 = (* (( (ptr) (* (( (ptr) gf←c69404)+189)/* var←c63644 */  ))+45) );
      segGen←v20084 = (word) ( *( (fPt) ((*  (ptr) pd150 ))))(trajData←v19748, trajParts←v19776, pd150);
      };
SOURCE(15434, 45)
   {
      word pd151;
      pd151 = (* (( (ptr) (* (( (ptr) gf←c69404)+189)/* var←c63644 */  ))+47) );
      (void) ( *( (fPt) ((*  (ptr) pd151 ))))((word) &next←v20112, segGen←v20084, pd151);
      };
SOURCE(15481, 103)
   {
      W4 var←c64700;
      {
         word pd152;
         pd152 = (* (( (ptr) (* (( (ptr) gf←c69404)+196)/* var←c64668 */  ))+32) );
         (void) ( *( (fPt) ((*  (ptr) pd152 ))))((word) &var←c64700, next←v20112.f1, (* (( (ptr) trajParts←v19776)+3) ), (* (( (ptr) trajData←v19748)+1)
             ), pd152);
         };
      len2←v20224 = var←c64700.f3;
      s2←v20196 = var←c64700.f2;
      len1←v20168 = var←c64700.f1;
      s1←v20140 = var←c64700.f0;
      };
SOURCE(15586, 398)
   if (( (int)s2←v20196 !=  (int) (word) -1)) {
SOURCE(15604, 46)
      (* (( (ptr) &var←c69372)+8) ) = originalSegments←v19804;
      (* (( (ptr) &var←c69372)+9) ) = s1←v20140;
      (* (( (ptr) &var←c69372)+10) ) = len1←v20168;
SOURCE(15652, 45)
      {
         word pd153;
         pd153 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         loSegments←v19860 = (word) ( *( (fPt) ((*  (ptr) pd153 ))))((word) ((( (bPt) &var←c69372)+24)/* var←c64540 */ ), pd153);
         };
SOURCE(15699, 46)
      (* (( (ptr) &var←c69372)+8) ) = originalSegments←v19804;
      (* (( (ptr) &var←c69372)+9) ) = s2←v20196;
      (* (( (ptr) &var←c69372)+10) ) = len2←v20224;
SOURCE(15747, 45)
      {
         word pd154;
         pd154 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         hiSegments←v19888 = (word) ( *( (fPt) ((*  (ptr) pd154 ))))((word) ((( (bPt) &var←c69372)+24)/* var←c64540 */ ), pd154);
         };
SOURCE(15794, 57)
      {
         word pd155;
         pd155 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+8) );
         extractedSegments←v19916 = (word) ( *( (fPt) ((*  (ptr) pd155 ))))(hiSegments←v19888, loSegments←v19860, pd155);
         };
      }
   else {
SOURCE(15862, 68)
      (* (( (ptr) &var←c69372)+8) ) = originalSegments←v19804;
      (* (( (ptr) &var←c69372)+9) ) = next←v20112.f1;
      (* (( (ptr) &var←c69372)+10) ) = (* (( (ptr) trajParts←v19776)+3) );
SOURCE(15932, 52)
      {
         word pd156;
         pd156 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         extractedSegments←v19916 = (word) ( *( (fPt) ((*  (ptr) pd156 ))))((word) ((( (bPt) &var←c69372)+24)/* var←c64540 */ ), pd156)
         ;
         };
      };
SOURCE(15989, 35)
   jointCount←v20252 = ((* (( (ptr) trajParts←v19776)+3) ) + 1);
SOURCE(16244, 94)
   {
      W4 var←c64764;
      {
         word var←c64732;
         var←c64732 = ((word) HiJoint←P2340(slice←v9592) + 1);
         {
            word pd157;
            pd157 = (* (( (ptr) (* (( (ptr) gf←c69404)+196)/* var←c64668 */  ))+32) );
            (void) ( *( (fPt) ((*  (ptr) pd157 ))))((word) &var←c64764, next←v20112.f1, jointCount←v20252, var←c64732, pd157);
            };
         };
      len2←v20224 = var←c64764.f3;
      s2←v20196 = var←c64764.f2;
      len1←v20168 = var←c64764.f1;
      s1←v20140 = var←c64764.f0;
      };
SOURCE(16340, 360)
   if (( (int)s2←v20196 !=  (int) (word) -1)) {
SOURCE(16358, 42)
      (* (( (ptr) &var←c69372)+11) ) = originalJoints←v19944;
      (* (( (ptr) &var←c69372)+12) ) = s1←v20140;
      (* (( (ptr) &var←c69372)+13) ) = len1←v20168;
SOURCE(16402, 41)
      {
         word pd158;
         pd158 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         loJoints←v20000 = (word) ( *( (fPt) ((*  (ptr) pd158 ))))((word) ((( (bPt) &var←c69372)+16)/* var←c64508 */ ), pd158);
         };
SOURCE(16445, 42)
      (* (( (ptr) &var←c69372)+11) ) = originalJoints←v19944;
      (* (( (ptr) &var←c69372)+12) ) = s2←v20196;
      (* (( (ptr) &var←c69372)+13) ) = len2←v20224;
SOURCE(16489, 41)
      {
         word pd159;
         pd159 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         hiJoints←v20028 = (word) ( *( (fPt) ((*  (ptr) pd159 ))))((word) ((( (bPt) &var←c69372)+16)/* var←c64508 */ ), pd159);
         };
SOURCE(16532, 51)
      {
         word pd160;
         pd160 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+8) );
         extractedJoints←v20056 = (word) ( *( (fPt) ((*  (ptr) pd160 ))))(hiJoints←v20028, loJoints←v20000, pd160);
         };
      }
   else {
SOURCE(16594, 56)
      (* (( (ptr) &var←c69372)+11) ) = originalJoints←v19944;
      (* (( (ptr) &var←c69372)+12) ) = next←v20112.f1;
      (* (( (ptr) &var←c69372)+13) ) = jointCount←v20252;
SOURCE(16652, 48)
      {
         word pd161;
         pd161 = (* (( (ptr) (* (( (ptr) gf←c69404)+186)/* var←c62748 */  ))+12) );
         extractedJoints←v20056 = (word) ( *( (fPt) ((*  (ptr) pd161 ))))((word) ((( (bPt) &var←c69372)+16)/* var←c64508 */ ), pd161)
         ;
         };
      };
SOURCE(16705, 89)
   {
      word tc162;
      word pd163;
      pd163 = (* (( (ptr) (* (( (ptr) gf←c69404)+189)/* var←c63644 */  ))+26) );
      if ((0 != (word) ( *( (fPt) ((*  (ptr) pd163 ))))(trajParts←v19776, pd163))) {
         tc162 =  (word) ((*  (ptr) trajData←v19748 ) != 2);
         }
      else {
         tc162 =  (word) 0;
         };
      if (tc162) {
         newRole←v20280 = 0;
         }
      else {
         newRole←v20280 = 2;
         };
      };
SOURCE(16796, 141)
   copy←v9664 = (word) CreateTrajFromData←P60(newRole←v20280, (* (( (ptr) trajParts←v19776)+3) ), extractedSegments←v19916, extractedJoints←v20056, 0, (* (
         ( (ptr) trajData←v19748)+5) )
      , (* (( (ptr) trajData←v19748)+6) ), 0, 0, (*  (W4Pt) (( (ptr) gf←c69404)+179)/* var←c62460 */  ));
SOURCE(16939, 24)
   (* (( (ptr) copy←v9664)+22) ) = (* (( (ptr) slice←v9592)+22) );
SOURCE(14194, 2769)
   return(copy←v9664);
   }

static void CopyEachSegment←P4968(formal←c01021, formal←c69500)
   word formal←c01021;
   word formal←c69500;
   {
   W7 var←c69436;
   /* declaration of q←v20412 skipped */ 
   register ptr gf←c69468 =  (ptr) &globalframe;
   /* declaration of var←c64796 skipped */ 
   formal←c69500 = (formal←c69500 - 24);
   var←c69436.f4/* q←v20412 */  = formal←c01021;
   var←c69436.f0 = formal←c69500;
   /* CopyEachSegment: */ 
SOURCE(14760, 306)
   {
      word tmpAddr164;
      tmpAddr164 = (word) (( (ptr) &var←c69436)+5)/* var←c64796 */ ;
      (*  (ptr) tmpAddr164 ) = ( ((word)  (fPt) CopySegmentAndBuild←P5088) );
      (* (( (ptr) tmpAddr164) + 1) ) = 1;
      };
SOURCE(15013, 53)
   {
      word var←c64828;
      word pd165;
      pd165 = (* (( (ptr) (* (( (ptr) gf←c69468)+186)/* var←c62748 */  ))+13) );
      var←c64828 = (word) ( *( (fPt) ((*  (ptr) pd165 ))))((*  (W3Pt) (( (ptr) formal←c69500)+8) ), (word) (( (bPt) &var←c69436)+20)
         /* var←c64796 */ , pd165);
      };
   }

static word CopySegmentAndBuild←P5088(item←v20752, formal←c69564)
   word item←v20752;
   word formal←c69564;
   {
   register ptr gf←c69532 =  (ptr) &globalframe;
   word quit←v20796;
   word copy←v20824 = 0;
   word oldSeg←v20852 = 0;
   formal←c69564 = (formal←c69564 - 20);
   /* CopySegmentAndBuild: */ 
SOURCE(14832, 176)
SOURCE(14832, 176)
   quit←v20796 = 0;
SOURCE(14937, 21)
   oldSeg←v20852 = XR←Narrow(item←v20752, (* (( (ptr) gf←c69532)+20) ));
SOURCE(14960, 36)
   {
      word pd166;
      pd166 = (* (( (ptr) (* (( (ptr) gf←c69532)+187)/* var←c62940 */  ))+17) );
      copy←v20824 = (word) ( *( (fPt) ((*  (ptr) pd166 ))))(oldSeg←v20852, pd166);
      };
SOURCE(14998, 10)
   {
      word pd167;
      pd167 = (* (( (ptr) formal←c69564)+4) );
      (void) ( *( (fPt) ((*  (ptr) pd167 ))))(copy←v20824, 1, pd167);
      };
SOURCE(14832, 176)
   return(quit←v20796);
   }

static void CopyEachJoint←P5028(formal←c01022, formal←c69660)
   word formal←c01022;
   word formal←c69660;
   {
   W7 var←c69596;
   /* declaration of q←v20560 skipped */ 
   register ptr gf←c69628 =  (ptr) &globalframe;
   /* declaration of var←c64860 skipped */ 
   formal←c69660 = (formal←c69660 - 16);
   var←c69596.f4/* q←v20560 */  = formal←c01022;
   var←c69596.f0 = formal←c69660;
   /* CopyEachJoint: */ 
SOURCE(15071, 290)
   {
      word tmpAddr168;
      tmpAddr168 = (word) (( (ptr) &var←c69596)+5)/* var←c64860 */ ;
      (*  (ptr) tmpAddr168 ) = ( ((word)  (fPt) CopyJointAndBuild←P5148) );
      (* (( (ptr) tmpAddr168) + 1) ) = 1;
      };
SOURCE(15312, 49)
   {
      word var←c64892;
      word pd169;
      pd169 = (* (( (ptr) (* (( (ptr) gf←c69628)+186)/* var←c62748 */  ))+13) );
      var←c64892 = (word) ( *( (fPt) ((*  (ptr) pd169 ))))((*  (W3Pt) (( (ptr) formal←c69660)+11) ), (word) (( (bPt) &var←c69596)+20)
         /* var←c64860 */ , pd169);
      };
   }

static word CopyJointAndBuild←P5148(item←v20972, formal←c69724)
   word item←v20972;
   word formal←c69724;
   {
   register ptr gf←c69692 =  (ptr) &globalframe;
   word quit←v21016;
   word copy←v21044 = 0;
   word oldJoint←v21072 = 0;
   formal←c69724 = (formal←c69724 - 20);
   /* CopyJointAndBuild: */ 
SOURCE(15141, 166)
SOURCE(15141, 166)
   quit←v21016 = 0;
SOURCE(15244, 23)
   oldJoint←v21072 = XR←Narrow(item←v20972, (* (( (ptr) gf←c69692)+13) ));
SOURCE(15269, 26)
   copy←v21044 = (word) CopyJoint←P3480(oldJoint←v21072);
SOURCE(15297, 10)
   {
      word pd170;
      pd170 = (* (( (ptr) formal←c69724)+4) );
      (void) ( *( (fPt) ((*  (ptr) pd170 ))))(copy←v21044, 1, pd170);
      };
SOURCE(15141, 166)
   return(quit←v21016);
   }

static word CopyTrajFromRange←P900(slice←v9724, start←v9752, len←v9780)
   word slice←v9724;
   word start←v9752;
   word len←v9780;
   {
   W14 var←c69756;
   register ptr gf←c69788 =  (ptr) &globalframe;
   word piece←v9824;
   /* declaration of var←c64924 skipped */ 
   /* declaration of var←c64956 skipped */ 
   word original←v21116;
   word originalSegments←v21144;
   /* declaration of desiredSegments←v21172 skipped */ 
   word extractedSegments←v21200 = 0;
   word originalJoints←v21228;
   /* declaration of desiredJoints←v21256 skipped */ 
   word extractedJoints←v21284 = 0;
   /* CopyTrajFromRange: */ 
SOURCE(16969, 1304)
   {
      word tmpAddr171;
      tmpAddr171 = (word) (( (ptr) &var←c69756)+4)/* var←c64924 */ ;
      (*  (ptr) tmpAddr171 ) = ( ((word)  (fPt) CopyEachJoint←P5268) );
      (* (( (ptr) tmpAddr171) + 1) ) = 1;
      };
   {
      word tmpAddr172;
      tmpAddr172 = (word) (( (ptr) &var←c69756)+6)/* var←c64956 */ ;
      (*  (ptr) tmpAddr172 ) = ( ((word)  (fPt) CopyEachSegment←P5208) );
      (* (( (ptr) tmpAddr172) + 1) ) = 1;
      };
SOURCE(16969, 1304)
   piece←v9824 = 0;
SOURCE(17064, 39)
   original←v21116 = XR←Narrow((* (( (ptr) slice←v9724)+1) ), (* (( (ptr) gf←c69788)+6) ));
SOURCE(17142, 51)
   originalSegments←v21144 = (* (( (ptr) original←v21116)+2) );
SOURCE(17195, 64)
   (* (( (ptr) &var←c69756)+8) ) = originalSegments←v21144;
   (* (( (ptr) &var←c69756)+9) ) = start←v9752;
   (* (( (ptr) &var←c69756)+10) ) = len←v9780;
SOURCE(17295, 47)
   originalJoints←v21228 = (* (( (ptr) original←v21116)+3) );
SOURCE(17344, 60)
   (* (( (ptr) &var←c69756)+11) ) = originalJoints←v21228;
   (* (( (ptr) &var←c69756)+12) ) = start←v9752;
   (* (( (ptr) &var←c69756)+13) ) = len←v9780;
SOURCE(18044, 52)
   {
      word pd173;
      pd173 = (* (( (ptr) (* (( (ptr) gf←c69788)+186)/* var←c62748 */  ))+12) );
      extractedSegments←v21200 = (word) ( *( (fPt) ((*  (ptr) pd173 ))))((word) ((( (bPt) &var←c69756)+24)/* var←c64956 */ ), pd173)
      ;
      };
SOURCE(18098, 48)
   {
      word pd174;
      pd174 = (* (( (ptr) (* (( (ptr) gf←c69788)+186)/* var←c62748 */  ))+12) );
      extractedJoints←v21284 = (word) ( *( (fPt) ((*  (ptr) pd174 ))))((word) ((( (bPt) &var←c69756)+16)/* var←c64924 */ ), pd174)
      ;
      };
SOURCE(18148, 125)
   piece←v9824 = (word) CreateTrajFromData←P60(0, SGNCK(len←v9780), extractedSegments←v21200, extractedJoints←v21284, 0, (* (
         ( (ptr) original←v21116)+5) )
      , (* (( (ptr) original←v21116)+6) ), 0, 0, (*  (W4Pt) (( (ptr) gf←c69788)+179)/* var←c62460 */  ));
SOURCE(16969, 1304)
   return(piece←v9824);
   }

static void CopyEachSegment←P5208(formal←c01023, formal←c69884)
   word formal←c01023;
   word formal←c69884;
   {
   W7 var←c69820;
   /* declaration of q←v21416 skipped */ 
   register ptr gf←c69852 =  (ptr) &globalframe;
   /* declaration of var←c65052 skipped */ 
   formal←c69884 = (formal←c69884 - 24);
   var←c69820.f4/* q←v21416 */  = formal←c01023;
   var←c69820.f0 = formal←c69884;
   /* CopyEachSegment: */ 
SOURCE(17438, 306)
   {
      word tmpAddr175;
      tmpAddr175 = (word) (( (ptr) &var←c69820)+5)/* var←c65052 */ ;
      (*  (ptr) tmpAddr175 ) = ( ((word)  (fPt) CopySegmentAndBuild←P5328) );
      (* (( (ptr) tmpAddr175) + 1) ) = 1;
      };
SOURCE(17691, 53)
   {
      word var←c65084;
      word pd176;
      pd176 = (* (( (ptr) (* (( (ptr) gf←c69852)+186)/* var←c62748 */  ))+13) );
      var←c65084 = (word) ( *( (fPt) ((*  (ptr) pd176 ))))((*  (W3Pt) (( (ptr) formal←c69884)+8) ), (word) (( (bPt) &var←c69820)+20)
         /* var←c65052 */ , pd176);
      };
   }

static word CopySegmentAndBuild←P5328(item←v21756, formal←c69948)
   word item←v21756;
   word formal←c69948;
   {
   register ptr gf←c69916 =  (ptr) &globalframe;
   word quit←v21800;
   word copy←v21828 = 0;
   word oldSeg←v21856 = 0;
   formal←c69948 = (formal←c69948 - 20);
   /* CopySegmentAndBuild: */ 
SOURCE(17510, 176)
SOURCE(17510, 176)
   quit←v21800 = 0;
SOURCE(17615, 21)
   oldSeg←v21856 = XR←Narrow(item←v21756, (* (( (ptr) gf←c69916)+20) ));
SOURCE(17638, 36)
   {
      word pd177;
      pd177 = (* (( (ptr) (* (( (ptr) gf←c69916)+187)/* var←c62940 */  ))+17) );
      copy←v21828 = (word) ( *( (fPt) ((*  (ptr) pd177 ))))(oldSeg←v21856, pd177);
      };
SOURCE(17676, 10)
   {
      word pd178;
      pd178 = (* (( (ptr) formal←c69948)+4) );
      (void) ( *( (fPt) ((*  (ptr) pd178 ))))(copy←v21828, 1, pd178);
      };
SOURCE(17510, 176)
   return(quit←v21800);
   }

static void CopyEachJoint←P5268(formal←c01024, formal←c70044)
   word formal←c01024;
   word formal←c70044;
   {
   W7 var←c69980;
   /* declaration of q←v21564 skipped */ 
   register ptr gf←c70012 =  (ptr) &globalframe;
   /* declaration of var←c65116 skipped */ 
   formal←c70044 = (formal←c70044 - 16);
   var←c69980.f4/* q←v21564 */  = formal←c01024;
   var←c69980.f0 = formal←c70044;
   /* CopyEachJoint: */ 
SOURCE(17749, 290)
   {
      word tmpAddr179;
      tmpAddr179 = (word) (( (ptr) &var←c69980)+5)/* var←c65116 */ ;
      (*  (ptr) tmpAddr179 ) = ( ((word)  (fPt) CopyJointAndBuild←P5388) );
      (* (( (ptr) tmpAddr179) + 1) ) = 1;
      };
SOURCE(17990, 49)
   {
      word var←c65148;
      word pd180;
      pd180 = (* (( (ptr) (* (( (ptr) gf←c70012)+186)/* var←c62748 */  ))+13) );
      var←c65148 = (word) ( *( (fPt) ((*  (ptr) pd180 ))))((*  (W3Pt) (( (ptr) formal←c70044)+11) ), (word) (( (bPt) &var←c69980)+20)
         /* var←c65116 */ , pd180);
      };
   }

static word CopyJointAndBuild←P5388(item←v21976, formal←c70108)
   word item←v21976;
   word formal←c70108;
   {
   register ptr gf←c70076 =  (ptr) &globalframe;
   word quit←v22020;
   word copy←v22048 = 0;
   word oldJoint←v22076 = 0;
   formal←c70108 = (formal←c70108 - 20);
   /* CopyJointAndBuild: */ 
SOURCE(17819, 166)
SOURCE(17819, 166)
   quit←v22020 = 0;
SOURCE(17922, 23)
   oldJoint←v22076 = XR←Narrow(item←v21976, (* (( (ptr) gf←c70076)+13) ));
SOURCE(17947, 26)
   copy←v22048 = (word) CopyJoint←P3480(oldJoint←v22076);
SOURCE(17975, 10)
   {
      word pd181;
      pd181 = (* (( (ptr) formal←c70108)+4) );
      (void) ( *( (fPt) ((*  (ptr) pd181 ))))(copy←v22048, 1, pd181);
      };
SOURCE(17819, 166)
   return(quit←v22020);
   }

static word Concat←P960(fixed←v9884, fixedEnd←v9912, moving←v9940, movingEnd←v9968)
   word fixed←v9884;
   word fixedEnd←v9912;
   word moving←v9940;
   word movingEnd←v9968;
   {
   register ptr gf←c70140 =  (ptr) &globalframe;
   word longer←v10012;
   W2 diff←v22120;
   word fixedTraj←v22148 = 0;
   word movingTraj←v22176 = 0;
   /* Concat: */ 
SOURCE(18279, 1461)
SOURCE(18279, 1461)
   longer←v10012 = 0;
SOURCE(18443, 36)
   {
      word pd182;
      pd182 = (* (( (ptr) (* (( (ptr) gf←c70140)+192)/* var←c64092 */  ))+10) );
      fixed←v9884 = (*  (ptr) ( *( (fPt) ((*  (ptr) pd182 ))))(fixed←v9884, 0, pd182) );
      };
SOURCE(18481, 38)
   {
      word pd183;
      pd183 = (* (( (ptr) (* (( (ptr) gf←c70140)+192)/* var←c64092 */  ))+10) );
      moving←v9940 = (*  (ptr) ( *( (fPt) ((*  (ptr) pd183 ))))(moving←v9940, 0, pd183) );
      };
SOURCE(18521, 48)
   if ((fixedEnd←v9912 == movingEnd←v9968)) {
SOURCE(18550, 19)
      (void) ReverseTraj←P1260(moving←v9940);
      };
SOURCE(18571, 1169)
   if ((fixedEnd←v9912 == 1)) {
SOURCE(18595, 84)
      {
         W2 var←c65180;
         W2 var←c65244;
         {
            word var←c65212;
            var←c65212 = (word) HiJoint←P2340(fixed←v9884);
            (void) FetchJointPos←P1920((word) &var←c65180, fixed←v9884, var←c65212);
            };
         (void) FetchJointPos←P1920((word) &var←c65244, moving←v9940, 0);
         {
            W2 var←c0359;
            {
               word pd184;
               pd184 = (* (( (ptr) (* (( (ptr) gf←c70140)+188)/* var←c63004 */  ))+11) );
               (void) ( *( (fPt) ((*  (ptr) pd184 ))))((word) &var←c0359, var←c65180, var←c65244, pd184);
               };
            diff←v22120 = var←c0359;
            };
         };
SOURCE(18681, 27)
      (void) TranslateTraj←P1500(moving←v9940, diff←v22120);
SOURCE(18710, 30)
      fixedTraj←v22148 = XR←Narrow((* (( (ptr) fixed←v9884)+1) ), (* (( (ptr) gf←c70140)+6) ));
SOURCE(18742, 32)
      movingTraj←v22176 = XR←Narrow((* (( (ptr) moving←v9940)+1) ), (* (( (ptr) gf←c70140)+6) ));
SOURCE(18776, 377)
      {
         word var←c65276;
         word var←c65308;
         {
            word pd185;
            pd185 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+8) );
            var←c65276 = (word) ( *( (fPt) ((*  (ptr) pd185 ))))((* (( (ptr) fixedTraj←v22148)+2) ), (* (( (ptr) movingTraj←v22176)+2)
                ), pd185);
            };
         {
            word var←c65340;
            {
               word pd186;
               pd186 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+7) );
               var←c65340 = (word) ( *( (fPt) ((*  (ptr) pd186 ))))((* (( (ptr) movingTraj←v22176)+3) ), 1, 2147483647, pd186);
               };
            {
               word pd187;
               pd187 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+8) );
               var←c65308 = (word) ( *( (fPt) ((*  (ptr) pd187 ))))((* (( (ptr) fixedTraj←v22148)+3) ), var←c65340, pd187);
               };
            };
         {
            word idx188;
            longer←v10012 = (word) CreateTrajFromData←P60(2, (
                  idx188 = (word) ((* (( (ptr) fixedTraj←v22148)+1) ) + (* (( (ptr) movingTraj←v22176)+1) )),
                  SGNCK(idx188)
                  ), var←c65276, var←c65308, 0, (* (( (ptr) fixedTraj←v22148)+5) )
               , (* (( (ptr) fixedTraj←v22148)+6) ), 0, 0, (*  (W4Pt) (( (ptr) gf←c70140)+179)/* var←c62460 */  ));
            };
         };
      }
   else {
SOURCE(19181, 85)
      {
         W2 var←c65372;
         W2 var←c65404;
         (void) FetchJointPos←P1920((word) &var←c65372, fixed←v9884, 0);
         {
            word var←c65436;
            var←c65436 = (word) HiJoint←P2340(moving←v9940);
            (void) FetchJointPos←P1920((word) &var←c65404, moving←v9940, var←c65436);
            };
         {
            W2 var←c0368;
            {
               word pd189;
               pd189 = (* (( (ptr) (* (( (ptr) gf←c70140)+188)/* var←c63004 */  ))+11) );
               (void) ( *( (fPt) ((*  (ptr) pd189 ))))((word) &var←c0368, var←c65372, var←c65404, pd189);
               };
            diff←v22120 = var←c0368;
            };
         };
SOURCE(19268, 27)
      (void) TranslateTraj←P1500(moving←v9940, diff←v22120);
SOURCE(19297, 30)
      fixedTraj←v22148 = XR←Narrow((* (( (ptr) fixed←v9884)+1) ), (* (( (ptr) gf←c70140)+6) ));
SOURCE(19329, 32)
      movingTraj←v22176 = XR←Narrow((* (( (ptr) moving←v9940)+1) ), (* (( (ptr) gf←c70140)+6) ));
SOURCE(19363, 377)
      {
         word var←c65468;
         word var←c65500;
         {
            word pd190;
            pd190 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+8) );
            var←c65468 = (word) ( *( (fPt) ((*  (ptr) pd190 ))))((* (( (ptr) movingTraj←v22176)+2) ), (* (( (ptr) fixedTraj←v22148)+2)
                ), pd190);
            };
         {
            word var←c65532;
            {
               word pd191;
               pd191 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+7) );
               var←c65532 = (word) ( *( (fPt) ((*  (ptr) pd191 ))))((* (( (ptr) fixedTraj←v22148)+3) ), 1, 2147483647, pd191);
               };
            {
               word pd192;
               pd192 = (* (( (ptr) (* (( (ptr) gf←c70140)+186)/* var←c62748 */  ))+8) );
               var←c65500 = (word) ( *( (fPt) ((*  (ptr) pd192 ))))((* (( (ptr) movingTraj←v22176)+3) ), var←c65532, pd192);
               };
            };
         {
            word idx193;
            longer←v10012 = (word) CreateTrajFromData←P60(2, (
                  idx193 = (word) ((* (( (ptr) fixedTraj←v22148)+1) ) + (* (( (ptr) movingTraj←v22176)+1) )),
                  SGNCK(idx193)
                  ), var←c65468, var←c65500, 0, (* (( (ptr) fixedTraj←v22148)+5) )
               , (* (( (ptr) fixedTraj←v22148)+6) ), 0, 0, (*  (W4Pt) (( (ptr) gf←c70140)+179)/* var←c62460 */  ));
            };
         };
      };
SOURCE(18279, 1461)
   return(longer←v10012);
   }

static word SpliceIn←P1020(runDescriptor←v10072, slice←v10100)
   word runDescriptor←v10072;
   word slice←v10100;
   {
   register ptr gf←c70172 =  (ptr) &globalframe;
   word newSlice←v10144;
   word oldTraj←v22220;
   word newOutline←v22248 = 0;
   word oldOutline←v22276;
   /* SpliceIn: */ 
SOURCE(19749, 1252)
SOURCE(19749, 1252)
   newSlice←v10144 = 0;
SOURCE(19848, 52)
   oldTraj←v22220 = XR←Narrow((* (( (ptr) (*  (ptr) runDescriptor←v10072 ))+1) ), (* (( (ptr) gf←c70172)+6) ));
SOURCE(19944, 59)
   {
      word pd194;
      pd194 = (* (( (ptr) (* (( (ptr) gf←c70172)+190)/* var←c63708 */  ))+64) );
      oldOutline←v22276 = (word) ( *( (fPt) ((*  (ptr) pd194 ))))((*  (ptr) (runDescriptor←v10072) ), pd194);
      };
SOURCE(20005, 751)
   {
      word var←c65564;
      var←c65564 = (*  (ptr) oldTraj←v22220 );
      switch (var←c65564) {
         case 1: 
SOURCE(20040, 47)
            newSlice←v10144 = (word) SpliceInClosed←P1200(runDescriptor←v10072, slice←v10100);
SOURCE(20089, 43)
            (*  (ptr) XR←Narrow((* (( (ptr) newSlice←v10144)+1) ), (* (( (ptr) gf←c70172)+6) )) ) = 1;
SOURCE(20134, 78)
            {
               word pd195;
               pd195 = (* (( (ptr) (* (( (ptr) gf←c70172)+195)/* var←c64284 */  ))+8) );
               newOutline←v22248 = (word) ( *( (fPt) ((*  (ptr) pd195 ))))(oldOutline←v22276, (*  (ptr) runDescriptor←v10072 ), newSlice←v10144, pd195)
               ;
               };
SOURCE(20214, 28)
            (* (( (ptr) newSlice←v10144)+2) ) = newOutline←v22248;
            break;
         case 2: 
SOURCE(20297, 45)
            newSlice←v10144 = (word) SpliceInOpen←P1140(runDescriptor←v10072, slice←v10100);
SOURCE(20344, 43)
            (*  (ptr) XR←Narrow((* (( (ptr) newSlice←v10144)+1) ), (* (( (ptr) gf←c70172)+6) )) ) = 2;
SOURCE(20389, 94)
            {
               W2 var←c0380;
               word var←c65596;
               {
                  word pd196;
                  pd196 = (* (( (ptr) (* (( (ptr) gf←c70172)+192)/* var←c64092 */  ))+62) );
                  (void) ( *( (fPt) ((*  (ptr) pd196 ))))((word) &var←c0380, oldOutline←v22276, 0, pd196);
                  };
               var←c65596 = var←c0380.f0;
               {
                  word pd197;
                  pd197 = (* (( (ptr) (* (( (ptr) gf←c70172)+195)/* var←c64284 */  ))+5) );
                  newOutline←v22248 = (word) ( *( (fPt) ((*  (ptr) pd197 ))))(newSlice←v10144, var←c65596, pd197);
                  };
               };
SOURCE(20485, 28)
            (* (( (ptr) newSlice←v10144)+2) ) = newOutline←v22248;
            break;
         case 0: 
SOURCE(20569, 47)
            newSlice←v10144 = (word) SpliceInClosed←P1200(runDescriptor←v10072, slice←v10100);
SOURCE(20618, 44)
            (*  (ptr) XR←Narrow((* (( (ptr) newSlice←v10144)+1) ), (* (( (ptr) gf←c70172)+6) )) ) = 0;
SOURCE(20664, 62)
            {
               word pd198;
               pd198 = (* (( (ptr) (* (( (ptr) gf←c70172)+195)/* var←c64284 */  ))+7) );
               newOutline←v22248 = (word) ( *( (fPt) ((*  (ptr) pd198 ))))(oldOutline←v22276, newSlice←v10144, pd198);
               };
SOURCE(20728, 28)
            (* (( (ptr) newSlice←v10144)+2) ) = newOutline←v22248;
            break;
         default: 
SOURCE(20812, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
SOURCE(20819, 57)
   (* (( (ptr) XR←Narrow((* (( (ptr) newSlice←v10144)+1) ), (* (( (ptr) gf←c70172)+6) )))+7) ) = (* (( (ptr) oldTraj←v22220)+7)
    );
SOURCE(20878, 57)
   (* (( (ptr) XR←Narrow((* (( (ptr) newSlice←v10144)+1) ), (* (( (ptr) gf←c70172)+6) )))+8) ) = (* (( (ptr) oldTraj←v22220)+8)
    );
SOURCE(20937, 32)
   {
      word pd199;
      pd199 = (* (( (ptr) (* (( (ptr) gf←c70172)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd199 ))))(oldOutline←v22276, pd199);
      };
SOURCE(20971, 30)
   {
      word pd200;
      pd200 = (* (( (ptr) (* (( (ptr) gf←c70172)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd200 ))))(newSlice←v10144, pd200);
      };
SOURCE(19749, 1252)
   return(newSlice←v10144);
   }

static void ResetEndSelectionBits←P1080(slice←v10204, lo←v10232, hi←v10260)
   word slice←v10204;
   word lo←v10232;
   word hi←v10260;
   {
   word joint←v22320 = 0;
   /* ResetEndSelectionBits: */ 
SOURCE(21007, 258)
SOURCE(21089, 79)
   if ((0 != lo←v10232)) {
SOURCE(21102, 28)
      joint←v22320 = (word) FetchJoint←P1860(slice←v10204, 0);
SOURCE(21132, 36)
      (* (( (ptr) joint←v22320)+4) ) = 0;
      };
SOURCE(21173, 92)
   if ((0 != hi←v10260)) {
SOURCE(21186, 41)
      {
         word var←c65628;
         var←c65628 = (word) HiJoint←P2340(slice←v10204);
         joint←v22320 = (word) FetchJoint←P1860(slice←v10204, var←c65628);
         };
SOURCE(21229, 36)
      (* (( (ptr) joint←v22320)+4) ) = 0;
      };
   }

static word SpliceInOpen←P1140(runDescriptor←v10320, slice←v10348)
   word runDescriptor←v10320;
   word slice←v10348;
   {
   register ptr gf←c70204 =  (ptr) &globalframe;
   word newSlice←v10392;
   word runSlice←v22364;
   word runData←v22392;
   word runParts←v22420;
   word runGen←v22448 = 0;
   word slice1←v22476 = 0;
   word slice2←v22504 = 0;
   word remainder←v22532 = 0;
   word remainderParts←v22560 = 0;
   word run1←v22588 = 0;
   word run2←v22616 = 0;
   word run3←v22644 = 0;
   word wholeParts←v22672;
   word wholeDescriptor←v22700;
   /* SpliceInOpen: */ 
SOURCE(21274, 1751)
SOURCE(21274, 1751)
   newSlice←v10392 = 0;
SOURCE(21370, 37)
   runSlice←v22364 = (*  (ptr) runDescriptor←v10320 );
SOURCE(21441, 41)
   runData←v22392 = XR←Narrow((* (( (ptr) runSlice←v22364)+1) ), (* (( (ptr) gf←c70204)+6) ));
SOURCE(21522, 49)
   runParts←v22420 = XR←Narrow((* (( (ptr) runDescriptor←v10320)+1) ), (* (( (ptr) gf←c70204)+18) ));
SOURCE(21738, 58)
   {
      word pd201;
      pd201 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+7) );
      wholeParts←v22672 = (word) ( *( (fPt) ((*  (ptr) pd201 ))))(runData←v22392, pd201);
      };
SOURCE(21798, 84)
   {
      word pd202;
      pd202 = (* (( (ptr) (* (( (ptr) gf←c70204)+184)/* var←c62588 */  ))+8) );
      wholeDescriptor←v22700 = (word) ( *( (fPt) ((*  (ptr) pd202 ))))(runSlice←v22364, wholeParts←v22672, pd202);
      };
SOURCE(21884, 65)
   {
      word pd203;
      pd203 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+21) );
      remainder←v22532 = (word) ( *( (fPt) ((*  (ptr) pd203 ))))(wholeDescriptor←v22700, runDescriptor←v10320, pd203);
      };
SOURCE(21951, 40)
   remainderParts←v22560 = XR←Narrow((* (( (ptr) remainder←v22532)+1) ), (* (( (ptr) gf←c70204)+18) ));
SOURCE(21993, 39)
   {
      word pd204;
      pd204 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+14) );
      (void) ( *( (fPt) ((*  (ptr) pd204 ))))(remainderParts←v22560, pd204);
      };
SOURCE(22034, 57)
   {
      W2 var←c65660;
      {
         word pd205;
         pd205 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+37) );
         (void) ( *( (fPt) ((*  (ptr) pd205 ))))((word) &var←c65660, remainderParts←v22560, pd205);
         };
      runGen←v22448 = var←c65660.f0;
      };
SOURCE(22093, 38)
   {
      word pd206;
      pd206 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+38) );
      run1←v22588 = (word) ( *( (fPt) ((*  (ptr) pd206 ))))(runGen←v22448, pd206);
      };
SOURCE(22133, 38)
   {
      word pd207;
      pd207 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+38) );
      run2←v22616 = (word) ( *( (fPt) ((*  (ptr) pd207 ))))(runGen←v22448, pd207);
      };
SOURCE(22173, 38)
   {
      word pd208;
      pd208 = (* (( (ptr) (* (( (ptr) gf←c70204)+189)/* var←c63644 */  ))+38) );
      run3←v22644 = (word) ( *( (fPt) ((*  (ptr) pd208 ))))(runGen←v22448, pd208);
      };
SOURCE(22213, 19)
   if ((run3←v22644 != 0)) {
SOURCE(22232, 5)
      (void) XR←RaiseUnnamedError();
      };
   if ((run1←v22588 == 0)) {
SOURCE(22272, 16)
      newSlice←v10392 = slice←v10348;
      }
   else {
      if ((run2←v22616 == 0)) {
         {
            word var←c65692;
SOURCE(22309, 40)
            slice1←v22476 = (word) CopyTrajFromRun←P840(runSlice←v22364, run1←v22588);
SOURCE(22351, 316)
            {
               word limit209;
               var←c65692 = (*  (ptr) runParts←v22420 );
               if (XR←ExtractField(var←c65692, 32 + (word) (
                     limit209 = (*  (ptr) var←c65692 ),
                     BCK(0, limit209)
                     ), 1)) {
SOURCE(22409, 57)
                  (void) ResetEndSelectionBits←P1080(slice1←v22476, 1, 0);
SOURCE(22468, 40)
                  newSlice←v10392 = (word) Concat←P960(slice←v10348, 1, slice1←v22476, 0);
                  }
               else {
SOURCE(22568, 57)
                  (void) ResetEndSelectionBits←P1080(slice1←v22476, 0, 1);
SOURCE(22627, 40)
                  newSlice←v10392 = (word) Concat←P960(slice←v10348, 0, slice1←v22476, 1);
                  };
               };
            };
         }
      else {
SOURCE(22738, 40)
         slice1←v22476 = (word) CopyTrajFromRun←P840(runSlice←v22364, run1←v22588);
SOURCE(22780, 57)
         (void) ResetEndSelectionBits←P1080(slice1←v22476, 0, 1);
SOURCE(22839, 40)
         slice2←v22504 = (word) CopyTrajFromRun←P840(runSlice←v22364, run2←v22616);
SOURCE(22881, 57)
         (void) ResetEndSelectionBits←P1080(slice2←v22504, 1, 0);
SOURCE(22940, 40)
         newSlice←v10392 = (word) Concat←P960(slice←v10348, 0, slice1←v22476, 1);
SOURCE(22982, 43)
         newSlice←v10392 = (word) Concat←P960(newSlice←v10392, 1, slice2←v22504, 0);
         };
      };
SOURCE(21274, 1751)
   return(newSlice←v10392);
   }

static word SpliceInClosed←P1200(runDescriptor←v10452, slice←v10480)
   word runDescriptor←v10452;
   word slice←v10480;
   {
   register ptr gf←c70236 =  (ptr) &globalframe;
   word newSlice←v10524;
   word runSlice←v22744;
   word runData←v22772;
   word runParts←v22800;
   word runGen←v22828 = 0;
   word slice1←v22856 = 0;
   word remainder←v22884 = 0;
   word wholeParts←v22912 = 0;
   word remainderParts←v22940 = 0;
   word run1←v22968 = 0;
   word run2←v22996 = 0;
   word wholeDescriptor←v23024 = 0;
   /* SpliceInClosed: */ 
SOURCE(23034, 1224)
SOURCE(23034, 1224)
   newSlice←v10524 = 0;
SOURCE(23132, 37)
   runSlice←v22744 = (*  (ptr) runDescriptor←v10452 );
SOURCE(23203, 41)
   runData←v22772 = XR←Narrow((* (( (ptr) runSlice←v22744)+1) ), (* (( (ptr) gf←c70236)+6) ));
SOURCE(23284, 49)
   runParts←v22800 = XR←Narrow((* (( (ptr) runDescriptor←v10452)+1) ), (* (( (ptr) gf←c70236)+18) ));
SOURCE(23532, 53)
   {
      word pd210;
      pd210 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+26) );
      if ((0 != (word) ( *( (fPt) ((*  (ptr) pd210 ))))(runParts←v22800, pd210))) {
SOURCE(23572, 13)
         return(slice←v10480);
         };
      };
SOURCE(23609, 47)
   {
      word pd211;
      pd211 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+7) );
      wholeParts←v22912 = (word) ( *( (fPt) ((*  (ptr) pd211 ))))(runData←v22772, pd211);
      };
SOURCE(23658, 67)
   {
      word pd212;
      pd212 = (* (( (ptr) (* (( (ptr) gf←c70236)+184)/* var←c62588 */  ))+8) );
      wholeDescriptor←v23024 = (word) ( *( (fPt) ((*  (ptr) pd212 ))))(runSlice←v22744, wholeParts←v22912, pd212);
      };
SOURCE(23727, 65)
   {
      word pd213;
      pd213 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+21) );
      remainder←v22884 = (word) ( *( (fPt) ((*  (ptr) pd213 ))))(wholeDescriptor←v23024, runDescriptor←v10452, pd213);
      };
SOURCE(23794, 40)
   remainderParts←v22940 = XR←Narrow((* (( (ptr) remainder←v22884)+1) ), (* (( (ptr) gf←c70236)+18) ));
SOURCE(23836, 39)
   {
      word pd214;
      pd214 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+14) );
      (void) ( *( (fPt) ((*  (ptr) pd214 ))))(remainderParts←v22940, pd214);
      };
SOURCE(23877, 58)
   {
      W2 var←c65724;
      {
         word pd215;
         pd215 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+37) );
         (void) ( *( (fPt) ((*  (ptr) pd215 ))))((word) &var←c65724, remainderParts←v22940, pd215);
         };
      runGen←v22828 = var←c65724.f0;
      };
SOURCE(23937, 38)
   {
      word pd216;
      pd216 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+38) );
      run1←v22968 = (word) ( *( (fPt) ((*  (ptr) pd216 ))))(runGen←v22828, pd216);
      };
SOURCE(23977, 38)
   {
      word pd217;
      pd217 = (* (( (ptr) (* (( (ptr) gf←c70236)+189)/* var←c63644 */  ))+38) );
      run2←v22996 = (word) ( *( (fPt) ((*  (ptr) pd217 ))))(runGen←v22828, pd217);
      };
SOURCE(24017, 33)
   if ((run1←v22968 == 0) || (run2←v22996 != 0)) {
SOURCE(24050, 5)
      (void) XR←RaiseUnnamedError();
      };
SOURCE(24057, 40)
   slice1←v22856 = (word) CopyTrajFromRun←P840(runSlice←v22744, run1←v22968);
SOURCE(24099, 29)
   (void) ResetEndSelectionBits←P1080(slice1←v22856, 1, 1);
SOURCE(24130, 40)
   newSlice←v10524 = (word) Concat←P960(slice←v10480, 0, slice1←v22856, 1);
SOURCE(24227, 31)
   (void) CloseByDistorting←P300(newSlice←v10524, 0);
SOURCE(23034, 1224)
   return(newSlice←v10524);
   }

static void ReverseTraj←P1260(slice←v10584)
   word slice←v10584;
   {
   register ptr gf←c70268 =  (ptr) &globalframe;
   word newSegments←v23068 = 0;
   word newJoints←v23096 = 0;
   word seg←v23124 = 0;
   word joint←v23152 = 0;
   word trajData←v23180;
   /* ReverseTraj: */ 
SOURCE(24265, 619)
SOURCE(24391, 39)
   trajData←v23180 = XR←Narrow((* (( (ptr) slice←v10584)+1) ), (* (( (ptr) gf←c70268)+6) ));
SOURCE(24432, 163)
   {
      register word i←v23224 = 0;
      register word noName←c65756;
      noName←c65756 = (* (( (ptr) trajData←v23180)+1) );
      if ((i←v23224 >= noName←c65756)) {
         goto lab←L100027;
         };
      lab←L100030: ;
SOURCE(24472, 28)
      seg←v23124 = (word) FetchSegment←P1740(slice←v10584, i←v23224);
SOURCE(24502, 29)
      {
         word pd218;
         pd218 = (* (( (ptr) (* (( (ptr) gf←c70268)+187)/* var←c62940 */  ))+22) );
         (void) ( *( (fPt) ((*  (ptr) pd218 ))))(seg←v23124, pd218);
         };
SOURCE(24533, 62)
      {
         word var←c65788;
         {
            word pd219;
            pd219 = (* (( (ptr) (* (( (ptr) gf←c70268)+186)/* var←c62748 */  ))+6) );
            var←c65788 = (word) ( *( (fPt) ((*  (ptr) pd219 ))))(seg←v23124, 1, pd219);
            };
         {
            word pd220;
            pd220 = (* (( (ptr) (* (( (ptr) gf←c70268)+186)/* var←c62748 */  ))+8) );
            newSegments←v23068 = (word) ( *( (fPt) ((*  (ptr) pd220 ))))(var←c65788, newSegments←v23068, pd220);
            };
         };
      i←v23224 = (i←v23224 + 1);
      if ((i←v23224 < noName←c65756)) {
         goto lab←L100030;
         };
      lab←L100027: ;
      };
SOURCE(24606, 207)
   {
      register word i←v23268 = 0;
      register word noName←c65820;
      noName←c65820 = (* (( (ptr) trajData←v23180)+1) );
      if ((i←v23268 > noName←c65820)) {
         goto lab←L100031;
         };
      lab←L100034: ;
SOURCE(24646, 105)
      if (((*  (ptr) trajData←v23180 ) == 2)) {
         joint←v23152 = (word) FetchJoint←P1860(slice←v10584, i←v23268);
         }
      else {
         joint←v23152 = (word) FetchJoint←P1860(slice←v10584, (i←v23268 % (* (( (ptr) trajData←v23180)+1) )));
         };
SOURCE(24753, 60)
      {
         word var←c65852;
         {
            word pd221;
            pd221 = (* (( (ptr) (* (( (ptr) gf←c70268)+186)/* var←c62748 */  ))+6) );
            var←c65852 = (word) ( *( (fPt) ((*  (ptr) pd221 ))))(joint←v23152, 1, pd221);
            };
         {
            word pd222;
            pd222 = (* (( (ptr) (* (( (ptr) gf←c70268)+186)/* var←c62748 */  ))+8) );
            newJoints←v23096 = (word) ( *( (fPt) ((*  (ptr) pd222 ))))(var←c65852, newJoints←v23096, pd222);
            };
         };
      if ((i←v23268 >= noName←c65820)) {
         goto lab←L100031;
         };
      i←v23268 = (i←v23268 + 1);
      goto lab←L100034;
      lab←L100031: ;
      };
SOURCE(24824, 31)
   (* (( (ptr) trajData←v23180)+2) ) = newSegments←v23068;
SOURCE(24857, 27)
   (* (( (ptr) trajData←v23180)+3) ) = newJoints←v23096;
   }

static word IsClockwiseTraj←P1320(slice←v10644)
   word slice←v10644;
   {
   word var←c10688;
   /* IsClockwiseTraj: */ 
SOURCE(24890, 91)
SOURCE(24953, 28)
   {
      word x223;
      word x225;
      return( (unsigned) ((
         x223 = (word) SignedArea←P3960(slice←v10644),  *(float*)&x223
         ) > (
         x225 = (*  (ptr) &fc224 ),  *(float*)&x225
         )));
      };
   }

static word IsClockwiseTrajTransformSeq←P1380(descriptor←v10748, transform←v10776)
   word descriptor←v10748;
   word transform←v10776;
   {
   word var←c10820;
   /* IsClockwiseTrajTransformSeq: */ 
SOURCE(24987, 194)
SOURCE(25125, 56)
   {
      word x226;
      word x227;
      return( (unsigned) ((
         x226 = (word) SignedAreaTransformSeq←P4020(descriptor←v10748, transform←v10776),  *(float*)&x226
         ) > (
         x227 = (*  (ptr) &fc224 ),  *(float*)&x227
         )));
      };
   }

static void DrawPolyline←P1440(dc←v10880, traj←v10908)
   word dc←v10880;
   word traj←v10908;
   {
   W7 var←c70300;
   register ptr gf←c70332 =  (ptr) &globalframe;
   /* declaration of var←c65948 skipped */ 
   word trajData←v23312;
   /* declaration of wholePolyline←v23368 skipped */ 
   word success←v23396 = 0;
   /* DrawPolyline: */ 
SOURCE(25187, 564)
   {
      word tmpAddr228;
      tmpAddr228 = (word) (( (ptr) &var←c70300)+4)/* var←c65948 */ ;
      (*  (ptr) tmpAddr228 ) = ( ((word)  (fPt) PolyPathProc←P5544) );
      (* (( (ptr) tmpAddr228) + 1) ) = 1;
      };
SOURCE(25251, 38)
   trajData←v23312 = XR←Narrow((* (( (ptr) traj←v10908)+1) ), (* (( (ptr) gf←c70332)+6) ));
SOURCE(25433, 42)
   var←c70300.f6/* wholePolyline←v23368 */  = 0;
SOURCE(25501, 33)
   var←c70300.f6/* wholePolyline←v23368 */  = (* (( (ptr) trajData←v23312)+14) );
SOURCE(25536, 34)
   if ((var←c70300.f6/* wholePolyline←v23368 */  == 0)) {
SOURCE(25564, 6)
      return;
      };
SOURCE(25572, 35)
   if (((*  (ptr) trajData←v23312 ) == 2)) {
SOURCE(25601, 6)
      return;
      };
SOURCE(25609, 33)
   {
      word pd229;
      pd229 = (* (( (ptr) (* (( (ptr) gf←c70332)+197)/* var←c65980 */  ))+52) );
      (void) ( *( (fPt) ((*  (ptr) pd229 ))))(dc←v10880, (*  (ptr) (* (( (ptr) (* (( (ptr) gf←c70332)+197)/* var←c65980 */  ))+54)
          ) ), pd229);
      };
SOURCE(25644, 32)
   {
      word pd230;
      pd230 = (* (( (ptr) (* (( (ptr) gf←c70332)+197)/* var←c65980 */  ))+70) );
      (void) ( *( (fPt) ((*  (ptr) pd230 ))))(dc←v10880, 1, pd230);
      };
SOURCE(25678, 30)
   {
      word pd231;
      pd231 = (* (( (ptr) (* (( (ptr) gf←c70332)+197)/* var←c65980 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd231 ))))(dc←v10880, (*  (ptr) &fc232 ), pd231);
      };
SOURCE(25710, 41)
   {
      word pd233;
      pd233 = (* (( (ptr) (* (( (ptr) gf←c70332)+197)/* var←c65980 */  ))+71) );
      (void) ( *( (fPt) ((*  (ptr) pd233 ))))(dc←v10880, (word) (( (bPt) &var←c70300)+16)/* var←c65948 */ , 1, pd233);
      };
   }

static void PolyPathProc←P5544(moveTo←v51472, lineTo←v51500, curveTo←v51528, conicTo←v51556, arcTo←v51584, formal←c70364)
   word moveTo←v51472;
   word lineTo←v51500;
   word curveTo←v51528;
   word conicTo←v51556;
   word arcTo←v51584;
   word formal←c70364;
   {
   formal←c70364 = (formal←c70364 - 16);
   /* PolyPathProc: */ 
SOURCE(25292, 127)
SOURCE(25326, 24)
   {
      word limit234;
      (void) ( *( (fPt) ((*  (ptr) moveTo←v51472 ))))((* ((( (W2Pt) (( (ptr) (* (( (ptr) formal←c70364)+6) ))+2))+(
               limit234 = (* (( (ptr) (* (( (ptr) formal←c70364)+6) ))+1) ),
               BCK(0, limit234)
               ))) ), moveTo←v51472);
      };
SOURCE(25352, 67)
   {
      register word i←v23440 = 1;
      register word noName←c66012;
      noName←c66012 = (*  (ptr) (* (( (ptr) formal←c70364)+6) ) );
      if ((i←v23440 >= noName←c66012)) {
         goto lab←L100035;
         };
      lab←L100038: ;
SOURCE(25395, 24)
      {
         word limit235;
         (void) ( *( (fPt) ((*  (ptr) lineTo←v51500 ))))((* ((( (W2Pt) (( (ptr) (* (( (ptr) formal←c70364)+6) ))+2))+(
                  limit235 = (* (( (ptr) (* (( (ptr) formal←c70364)+6) ))+1) ),
                  BCK(i←v23440, limit235)
                  ))) ), lineTo←v51500);
         };
      i←v23440 = (i←v23440 + 1);
      if ((i←v23440 < noName←c66012)) {
         goto lab←L100038;
         };
      lab←L100035: ;
      };
   }

static void TranslateTraj←P1500(slice←v10968, vector←v10996)
   word slice←v10968;
   W2 vector←v10996;
   {
   register ptr gf←c70396 =  (ptr) &globalframe;
   word transform←v23484;
   word seg←v23512 = 0;
   word joint←v23540 = 0;
   word trajData←v23568;
   word hiSegment←v23596;
   word hiJoint←v23624;
   /* TranslateTraj: */ 
SOURCE(26484, 586)
SOURCE(26540, 101)
   {
      W2 var←c66044;
      var←c66044.f0 = vector←v10996.f0;
      var←c66044.f1 = vector←v10996.f1;
      {
         word pd236;
         pd236 = (* (( (ptr) (* (( (ptr) gf←c70396)+198)/* var←c66076 */  ))+10) );
         transform←v23484 = (word) ( *( (fPt) ((*  (ptr) pd236 ))))(var←c66044, pd236);
         };
      };
SOURCE(26671, 39)
   trajData←v23568 = XR←Narrow((* (( (ptr) slice←v10968)+1) ), (* (( (ptr) gf←c70396)+6) ));
SOURCE(26712, 33)
   hiSegment←v23596 = (word) HiSegment←P2220(slice←v10968);
SOURCE(26747, 29)
   hiJoint←v23624 = (word) HiJoint←P2340(slice←v10968);
SOURCE(26778, 104)
   {
      register word i←v23668 = 0;
      register word noName←c66108;
      noName←c66108 = hiSegment←v23596;
      if ((i←v23668 > noName←c66108)) {
         goto lab←L100039;
         };
      lab←L100042: ;
SOURCE(26810, 28)
      seg←v23512 = (word) FetchSegment←P1740(slice←v10968, i←v23668);
SOURCE(26840, 42)
      {
         word pd237;
         pd237 = (* (( (ptr) (* (( (ptr) gf←c70396)+187)/* var←c62940 */  ))+26) );
         (void) ( *( (fPt) ((*  (ptr) pd237 ))))(seg←v23512, transform←v23484, pd237);
         };
      if ((i←v23668 >= noName←c66108)) {
         goto lab←L100039;
         };
      i←v23668 = (i←v23668 + 1);
      goto lab←L100042;
      lab←L100039: ;
      };
SOURCE(26893, 139)
   {
      register word i←v23712 = 0;
      register word noName←c66140;
      noName←c66140 = hiJoint←v23624;
      if ((i←v23712 > noName←c66140)) {
         goto lab←L100043;
         };
      lab←L100046: ;
SOURCE(26923, 48)
      {
         word pd238;
         pd238 = (* (( (ptr) (* (( (ptr) gf←c70396)+186)/* var←c62748 */  ))+5) );
         joint←v23540 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd238 ))))((* (( (ptr) trajData←v23568)+3) ), i←v23712, pd238), (* (
               ( (ptr) gf←c70396)+13) ));
         };
SOURCE(26973, 59)
      {
         word pd239;
         pd239 = (* (( (ptr) (* (( (ptr) gf←c70396)+199)/* var←c66172 */  ))+5) );
         (void) ( *( (fPt) ((*  (ptr) pd239 ))))((word) joint←v23540, transform←v23484, (*  (W2Pt) joint←v23540 ), pd239);
         };
      if ((i←v23712 >= noName←c66140)) {
         goto lab←L100043;
         };
      i←v23712 = (i←v23712 + 1);
      goto lab←L100046;
      lab←L100043: ;
      };
SOURCE(27043, 27)
   {
      word pd240;
      pd240 = (* (( (ptr) (* (( (ptr) gf←c70396)+184)/* var←c62588 */  ))+68) );
      (void) ( *( (fPt) ((*  (ptr) pd240 ))))(slice←v10968, pd240);
      };
   }

static word ConstrainJoint←P1560(slice←v11056, editConstraints←v11084, jointNum←v11112)
   word slice←v11056;
   word editConstraints←v11084;
   word jointNum←v11112;
   {
   register ptr gf←c70428 =  (ptr) &globalframe;
   word constrained←v11156;
   W2 newPos←v23756;
   word loSeg←v23784 = 0;
   word hiSeg←v23812 = 0;
   W2 cPointLo←v23840;
   W2 cPointHi←v23868;
   word joint←v23896 = 0;
   word trajData←v23924;
   /* ConstrainJoint: */ 
SOURCE(27113, 1029)
SOURCE(27113, 1029)
   constrained←v11156 = 0;
SOURCE(27324, 39)
   trajData←v23924 = XR←Narrow((* (( (ptr) slice←v11056)+1) ), (* (( (ptr) gf←c70428)+6) ));
SOURCE(27365, 777)
   if ((0 == (word) IsEndJoint←P2700(slice←v11056, jointNum←v11112))) {
SOURCE(27407, 35)
      joint←v23896 = (word) FetchJoint←P1860(slice←v11056, jointNum←v11112);
SOURCE(27444, 37)
      hiSeg←v23812 = (word) FetchSegment←P1740(slice←v11056, jointNum←v11112);
SOURCE(27483, 40)
      loSeg←v23784 = (word) PreviousSegment←P2460(slice←v11056, jointNum←v11112);
SOURCE(27525, 617)
      if ( ( ((*  (ptr) (*  (ptr) hiSeg←v23812 ) ) == (* (( (ptr) gf←c70428)+27) )) ? ((*  (ptr) (*  (ptr) loSeg←v23784 ) ) == (* (
         ( (ptr) gf←c70428)+27) )) : 0 ) ) {
SOURCE(27593, 18)
         constrained←v11156 = 1;
SOURCE(27613, 48)
         {
            word pd241;
            pd241 = (* (( (ptr) (*  (ptr) loSeg←v23784 ))+16) );
            (void) ( *( (fPt) ((*  (ptr) pd241 ))))((word) &cPointLo←v23840, loSeg←v23784, 1, pd241);
            };
SOURCE(27663, 48)
         {
            word pd242;
            pd242 = (* (( (ptr) (*  (ptr) hiSeg←v23812 ))+16) );
            (void) ( *( (fPt) ((*  (ptr) pd242 ))))((word) &cPointHi←v23868, hiSeg←v23812, 0, pd242);
            };
SOURCE(27713, 270)
         if ((editConstraints←v11084 == 2)) {
SOURCE(27748, 102)
            {
               W2 var←c66204;
               {
                  W2 var←c66236;
                  {
                     word pd243;
                     pd243 = (* (( (ptr) (* (( (ptr) gf←c70428)+188)/* var←c63004 */  ))+22) );
                     (void) ( *( (fPt) ((*  (ptr) pd243 ))))((word) &var←c66236, cPointLo←v23840, cPointHi←v23868, pd243);
                     };
                  {
                     W2 var←c0481;
                     {
                        word pd244;
                        pd244 = (* (( (ptr) (* (( (ptr) gf←c70428)+188)/* var←c63004 */  ))+12) );
                        (void) ( *( (fPt) ((*  (ptr) pd244 ))))((word) &var←c0481, var←c66236, (*  (ptr) &fc245 ), pd244);
                        };
                     var←c66204 = var←c0481;
                     };
                  };
               {
                  W2 var←c0482;
                  {
                     word pd246;
                     pd246 = (* (( (ptr) (* (( (ptr) gf←c70428)+188)/* var←c63004 */  ))+10) );
                     (void) ( *( (fPt) ((*  (ptr) pd246 ))))((word) &var←c0482, var←c66204, cPointLo←v23840, pd246);
                     };
                  newPos←v23756 = var←c0482;
                  };
               };
            }
         else {
SOURCE(27859, 126)
            {
               word cpLine←v23968;
SOURCE(27872, 53)
               {
                  word pd247;
                  pd247 = (* (( (ptr) (* (( (ptr) gf←c70428)+200)/* var←c66268 */  ))+27) );
                  cpLine←v23968 = (word) ( *( (fPt) ((*  (ptr) pd247 ))))(cPointLo←v23840, cPointHi←v23868, pd247);
                  };
SOURCE(27927, 56)
               {
                  word pd248;
                  pd248 = (* (( (ptr) (* (( (ptr) gf←c70428)+200)/* var←c66268 */  ))+46) );
                  (void) ( *( (fPt) ((*  (ptr) pd248 ))))((word) &newPos←v23756, (*  (W2Pt) joint←v23896 ), cpLine←v23968, pd248);
                  };
               };
            };
SOURCE(27988, 20)
         (*  (W2Pt) joint←v23896 ) = newPos←v23756;
SOURCE(28010, 50)
         {
            word pd249;
            pd249 = (* (( (ptr) (* (( (ptr) gf←c70428)+187)/* var←c62940 */  ))+28) );
            (void) ( *( (fPt) ((*  (ptr) pd249 ))))(hiSeg←v23812, 1, newPos←v23756, pd249);
            };
SOURCE(28062, 51)
         {
            word pd250;
            pd250 = (* (( (ptr) (* (( (ptr) gf←c70428)+187)/* var←c62940 */  ))+28) );
            (void) ( *( (fPt) ((*  (ptr) pd250 ))))(loSeg←v23784, 0, newPos←v23756, pd250);
            };
SOURCE(28115, 27)
         {
            word pd251;
            pd251 = (* (( (ptr) (* (( (ptr) gf←c70428)+184)/* var←c62588 */  ))+68) );
            (void) ( *( (fPt) ((*  (ptr) pd251 ))))(slice←v11056, pd251);
            };
         };
      };
SOURCE(27113, 1029)
   return(constrained←v11156);
   }

static word ConstrainCP←P1620(slice←v11216, editConstraints←v11244, segNum←v11272, cpNum←v11300)
   word slice←v11216;
   word editConstraints←v11244;
   word segNum←v11272;
   word cpNum←v11300;
   {
   register ptr gf←c70460 =  (ptr) &globalframe;
   word constrained←v11344;
   W2 newPos←v24012;
   word thisSeg←v24040 = 0;
   word otherSeg←v24068 = 0;
   W2 thisCP←v24096;
   W2 otherCP←v24124;
   word joint←v24152 = 0;
   word otherSegNum←v24180;
   word otherCPNum←v24208;
   word trajData←v24236;
   /* ConstrainCP: */ 
SOURCE(28154, 1468)
SOURCE(28154, 1468)
   constrained←v11344 = 0;
SOURCE(28404, 39)
   trajData←v24236 = XR←Narrow((* (( (ptr) slice←v11216)+1) ), (* (( (ptr) gf←c70460)+6) ));
SOURCE(28445, 251)
   if ((cpNum←v11300 == 0)) {
SOURCE(28465, 47)
      otherSegNum←v24180 = (word) PreviousSegmentNum←P2520(slice←v11216, segNum←v11272);
SOURCE(28514, 33)
      joint←v24152 = (word) FetchJoint←P1860(slice←v11216, segNum←v11272);
SOURCE(28549, 14)
      otherCPNum←v24208 = 1;
      }
   else {
SOURCE(28574, 48)
      otherSegNum←v24180 = (word) FollowingSegmentNum←P2580(slice←v11216, segNum←v11272);
SOURCE(28624, 56)
      {
         word var←c66300;
         {
            word idx252;
            var←c66300 = (
               idx252 = (word) FollowingJoint←P2640(slice←v11216, segNum←v11272),
               SGNCK(idx252)
               );
            };
         joint←v24152 = (word) FetchJoint←P1860(slice←v11216, var←c66300);
         };
SOURCE(28682, 14)
      otherCPNum←v24208 = 0;
      };
SOURCE(28702, 920)
   if (( (int)otherSegNum←v24180 !=  (int) (word) -1)) {
SOURCE(28729, 37)
      thisSeg←v24040 = (word) FetchSegment←P1740(slice←v11216, segNum←v11272);
SOURCE(28768, 43)
      otherSeg←v24068 = (word) FetchSegment←P1740(slice←v11216, SGNCK(otherSegNum←v24180));
SOURCE(28813, 809)
      if ( ( ((*  (ptr) (*  (ptr) thisSeg←v24040 ) ) == (* (( (ptr) gf←c70460)+27) )) ? ((*  (ptr) (*  (ptr) otherSeg←v24068 ) ) == (* (
         ( (ptr) gf←c70460)+27) )) : 0 ) ) {
SOURCE(28886, 18)
         constrained←v11344 = 1;
SOURCE(28906, 54)
         {
            word pd253;
            pd253 = (* (( (ptr) (*  (ptr) thisSeg←v24040 ))+16) );
            (void) ( *( (fPt) ((*  (ptr) pd253 ))))((word) &thisCP←v24096, thisSeg←v24040, cpNum←v11300, pd253);
            };
SOURCE(28962, 62)
         {
            word pd254;
            pd254 = (* (( (ptr) (*  (ptr) otherSeg←v24068 ))+16) );
            (void) ( *( (fPt) ((*  (ptr) pd254 ))))((word) &otherCP←v24124, otherSeg←v24068, SGNCK(otherCPNum←v24208), pd254);
            };
SOURCE(29026, 507)
         if ((editConstraints←v11244 == 2)) {
SOURCE(29061, 103)
            {
               W2 var←c66332;
               {
                  W2 var←c66364;
                  {
                     word pd255;
                     pd255 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+22) );
                     (void) ( *( (fPt) ((*  (ptr) pd255 ))))((word) &var←c66364, otherCP←v24124, (*  (W2Pt) joint←v24152 ), pd255);
                     };
                  {
                     W2 var←c0505;
                     {
                        word pd256;
                        pd256 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+12) );
                        (void) ( *( (fPt) ((*  (ptr) pd256 ))))((word) &var←c0505, var←c66364, (*  (ptr) &fc257 ), pd256);
                        };
                     var←c66332 = var←c0505;
                     };
                  };
               {
                  W2 var←c0506;
                  {
                     word pd258;
                     pd258 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+10) );
                     (void) ( *( (fPt) ((*  (ptr) pd258 ))))((word) &var←c0506, var←c66332, otherCP←v24124, pd258);
                     };
                  newPos←v24012 = var←c0506;
                  };
               };
            }
         else {
SOURCE(29173, 362)
            {
               W2 dirVec←v24280;
               word distance←v24308;
               W2 var←c66396;
SOURCE(29243, 65)
               {
                  word pd259;
                  pd259 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+22) );
                  (void) ( *( (fPt) ((*  (ptr) pd259 ))))((word) &dirVec←v24280, otherCP←v24124, (*  (W2Pt) joint←v24152 ), pd259);
                  };
SOURCE(29310, 56)
               {
                  word pd260;
                  pd260 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+19) );
                  distance←v24308 = (word) ( *( (fPt) ((*  (ptr) pd260 ))))((*  (W2Pt) joint←v24152 ), thisCP←v24096, pd260);
                  };
SOURCE(29368, 59)
               var←c66396.f0 = (*  (ptr) &fc224 );
               var←c66396.f1 = (*  (ptr) &fc224 );
               if ( ! XR←EqualWords(&dirVec←v24280, &var←c66396, 2)) {
SOURCE(29391, 36)
                  {
                     word pd261;
                     pd261 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+13) );
                     (void) ( *( (fPt) ((*  (ptr) pd261 ))))((word) &dirVec←v24280, dirVec←v24280, pd261);
                     };
                  };
SOURCE(29446, 42)
               {
                  word pd262;
                  pd262 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+12) );
                  (void) ( *( (fPt) ((*  (ptr) pd262 ))))((word) &dirVec←v24280, dirVec←v24280, distance←v24308, pd262);
                  };
SOURCE(29490, 43)
               {
                  word pd263;
                  pd263 = (* (( (ptr) (* (( (ptr) gf←c70460)+188)/* var←c63004 */  ))+10) );
                  (void) ( *( (fPt) ((*  (ptr) pd263 ))))((word) &newPos←v24012, (*  (W2Pt) joint←v24152 ), dirVec←v24280, pd263);
                  };
               };
            };
SOURCE(29538, 55)
         {
            word pd264;
            pd264 = (* (( (ptr) (* (( (ptr) gf←c70460)+187)/* var←c62940 */  ))+33) );
            (void) ( *( (fPt) ((*  (ptr) pd264 ))))(thisSeg←v24040, newPos←v24012, cpNum←v11300, pd264);
            };
SOURCE(29595, 27)
         {
            word pd265;
            pd265 = (* (( (ptr) (* (( (ptr) gf←c70460)+184)/* var←c62588 */  ))+68) );
            (void) ( *( (fPt) ((*  (ptr) pd265 ))))(slice←v11216, pd265);
            };
         };
      };
SOURCE(28154, 1468)
   return(constrained←v11344);
   }

static word MatchShape←P1680(traj1←v11404, traj2←v11432)
   word traj1←v11404;
   word traj2←v11432;
   {
   register ptr gf←c70492 =  (ptr) &globalframe;
   word var←c11476;
   word segCount1←v24352;
   word segCount2←v24380;
   word trajData1←v24408;
   word trajData2←v24436;
   word seg1←v24464 = 0;
   word seg2←v24492 = 0;
   word cpCount1←v24520;
   word closed1←v24548;
   word closed2←v24576;
   /* MatchShape: */ 
SOURCE(29748, 1162)
SOURCE(29813, 33)
   segCount1←v24352 = (word) HiSegment←P2220(traj1←v11404);
SOURCE(29848, 33)
   segCount2←v24380 = (word) HiSegment←P2220(traj2←v11432);
SOURCE(29883, 40)
   trajData1←v24408 = XR←Narrow((* (( (ptr) traj1←v11404)+1) ), (* (( (ptr) gf←c70492)+6) ));
SOURCE(29925, 40)
   trajData2←v24436 = XR←Narrow((* (( (ptr) traj1←v11404)+1) ), (* (( (ptr) gf←c70492)+6) ));
SOURCE(30003, 63)
   closed1←v24548 =  (unsigned)  ( ((*  (ptr) trajData1←v24408 ) == 1) ? 1 : ((*  (ptr) trajData1←v24408 ) == 0) ) ;
SOURCE(30068, 63)
   closed2←v24576 =  (unsigned)  ( ((*  (ptr) trajData2←v24436 ) == 1) ? 1 : ((*  (ptr) trajData2←v24436 ) == 0) ) ;
SOURCE(30134, 43)
   if ((segCount1←v24352 != segCount2←v24380)) {
SOURCE(30164, 13)
      return(0);
      };
SOURCE(30179, 39)
   if ((closed1←v24548 != closed2←v24576)) {
SOURCE(30205, 13)
      return(0);
      };
SOURCE(30220, 658)
   {
      register word i←v24620 = 0;
      register word noName←c66428;
      noName←c66428 = segCount1←v24352;
      if ((i←v24620 > noName←c66428)) {
         goto lab←L100047;
         };
      lab←L100050: ;
SOURCE(30252, 29)
      seg1←v24464 = (word) FetchSegment←P1740(traj1←v11404, i←v24620);
SOURCE(30283, 29)
      seg2←v24492 = (word) FetchSegment←P1740(traj2←v11432, i←v24620);
SOURCE(30314, 45)
      if (((*  (ptr) seg1←v24464 ) != (*  (ptr) seg2←v24492 ))) {
SOURCE(30346, 13)
         return(0);
         };
SOURCE(30361, 57)
      {
         word pd266;
         pd266 = (* (( (ptr) (* (( (ptr) gf←c70492)+187)/* var←c62940 */  ))+20) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd266 ))))(seg1←v24464, seg2←v24492, pd266))) {
SOURCE(30405, 13)
            return(0);
            };
         };
SOURCE(30420, 39)
      if ( ! XR←EqualWords((( (ptr) seg1←v24464)+11), (( (ptr) seg2←v24492)+11), 2)) {
SOURCE(30446, 13)
         return(0);
         };
SOURCE(30461, 45)
      {
         word pd267;
         pd267 = (* (( (ptr) (*  (ptr) seg1←v24464 ))+17) );
         cpCount1←v24520 = (word) ( *( (fPt) ((*  (ptr) pd267 ))))(seg1←v24464, pd267);
         };
SOURCE(30508, 67)
      {
         word pd268;
         pd268 = (* (( (ptr) (*  (ptr) seg2←v24492 ))+17) );
         if ((cpCount1←v24520 != (word) ( *( (fPt) ((*  (ptr) pd268 ))))(seg2←v24492, pd268))) {
SOURCE(30562, 13)
            return(0);
            };
         };
SOURCE(30577, 301)
      {
         register word j←v24664 = 0;
         register word noName←c66460;
         noName←c66460 = cpCount1←v24520;
         if ((j←v24664 >= noName←c66460)) {
            goto lab←L100051;
            };
         lab←L100054: ;
         {
            W2 point1←v24708;
            W2 point2←v24736;
SOURCE(30631, 104)
            {
               word pd269;
               pd269 = (* (( (ptr) (*  (ptr) seg1←v24464 ))+16) );
               (void) ( *( (fPt) ((*  (ptr) pd269 ))))((word) &point1←v24708, seg1←v24464, j←v24664, pd269);
               };
            {
               word pd270;
               pd270 = (* (( (ptr) (*  (ptr) seg2←v24492 ))+16) );
               (void) ( *( (fPt) ((*  (ptr) pd270 ))))((word) &point2←v24736, seg2←v24492, j←v24664, pd270);
               };
            if (XR←EqualWords(&point1←v24708, &point2←v24736, 2)) {
SOURCE(30735, 4)
               goto lab←L100053;
               };
SOURCE(30741, 137)
            {
               word tc271;
               word pd272;
               word idx273;
               word pd274;
               word idx275;
               pd272 = (* (( (ptr) (* (( (ptr) gf←c70492)+201)/* var←c66492 */  ))+39) );
               if ((0 != (word) ( *( (fPt) ((*  (ptr) pd272 ))))(point1←v24708.f0, point2←v24736.f0, (
                     idx273 = (word) ((* (( (ptr) gf←c70492)+5)/* closeness←v5744 */  ) + 126),
                     BCK(idx273, 127)
                     ), pd272))) {
                  pd274 = (* (( (ptr) (* (( (ptr) gf←c70492)+201)/* var←c66492 */  ))+39) );
                  tc271 =  (word) (0 != (word) ( *( (fPt) ((*  (ptr) pd274 ))))(point1←v24708.f1, point2←v24736.f1, (
                        idx275 = (word) ((* (( (ptr) gf←c70492)+5)/* closeness←v5744 */  ) + 126),
                        BCK(idx275, 127)
                        ), pd274));
                  }
               else {
                  tc271 =  (word) 0;
                  };
               if (tc271) {
                  }
               else {
SOURCE(30865, 13)
                  return(0);
                  };
               };
            };
         lab←L100053: ;
         j←v24664 = (j←v24664 + 1);
         if ((j←v24664 < noName←c66460)) {
            goto lab←L100054;
            };
         lab←L100051: ;
         };
      if ((i←v24620 >= noName←c66428)) {
         goto lab←L100047;
         };
      i←v24620 = (i←v24620 + 1);
      goto lab←L100050;
      lab←L100047: ;
      };
SOURCE(30898, 12)
   return(1);
   }

static word FetchSegment←P1740(slice←v11536, index←v11564)
   word slice←v11536;
   word index←v11564;
   {
   register ptr gf←c70524 =  (ptr) &globalframe;
   word seg←v11608;
   word trajData←v24780;
   /* FetchSegment: */ 
SOURCE(30916, 173)
SOURCE(30916, 173)
   seg←v11608 = 0;
SOURCE(30996, 39)
   trajData←v24780 = XR←Narrow((* (( (ptr) slice←v11536)+1) ), (* (( (ptr) gf←c70524)+6) ));
SOURCE(31037, 52)
   {
      word pd276;
      pd276 = (* (( (ptr) (* (( (ptr) gf←c70524)+186)/* var←c62748 */  ))+5) );
      seg←v11608 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd276 ))))((* (( (ptr) trajData←v24780)+2) ), index←v11564, pd276), (* (
            ( (ptr) gf←c70524)+20) ));
      };
SOURCE(30916, 173)
   return(seg←v11608);
   }

static word FetchSegmentTraj←P1800(trajData←v11668, index←v11696)
   word trajData←v11668;
   word index←v11696;
   {
   register ptr gf←c70556 =  (ptr) &globalframe;
   word seg←v11740;
   /* FetchSegmentTraj: */ 
SOURCE(31095, 142)
SOURCE(31095, 142)
   seg←v11740 = 0;
SOURCE(31185, 52)
   {
      word pd277;
      pd277 = (* (( (ptr) (* (( (ptr) gf←c70556)+186)/* var←c62748 */  ))+5) );
      seg←v11740 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd277 ))))((* (( (ptr) trajData←v11668)+2) ), index←v11696, pd277), (* (
            ( (ptr) gf←c70556)+20) ));
      };
SOURCE(31095, 142)
   return(seg←v11740);
   }

static word FetchJoint←P1860(slice←v11800, index←v11828)
   word slice←v11800;
   word index←v11828;
   {
   register ptr gf←c70588 =  (ptr) &globalframe;
   word joint←v11872;
   word trajData←v24824;
   /* FetchJoint: */ 
SOURCE(31243, 171)
SOURCE(31243, 171)
   joint←v11872 = 0;
SOURCE(31321, 39)
   trajData←v24824 = XR←Narrow((* (( (ptr) slice←v11800)+1) ), (* (( (ptr) gf←c70588)+6) ));
SOURCE(31362, 52)
   {
      word pd278;
      pd278 = (* (( (ptr) (* (( (ptr) gf←c70588)+186)/* var←c62748 */  ))+5) );
      joint←v11872 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd278 ))))((* (( (ptr) trajData←v24824)+3) ), index←v11828, pd278), (* (
            ( (ptr) gf←c70588)+13) ));
      };
SOURCE(31243, 171)
   return(joint←v11872);
   }

static void FetchJointPos←P1920(formal←c0552, slice←v11932, index←v11960)
   word formal←c0552;
   word slice←v11932;
   word index←v11960;
   {
   register ptr gf←c70620 =  (ptr) &globalframe;
   W2 point←v12004;
   word trajData←v24868;
   word joint←v24896 = 0;
   word hiJoint←v24924;
   /* FetchJointPos: */ 
SOURCE(31420, 379)
SOURCE(31501, 39)
   trajData←v24868 = XR←Narrow((* (( (ptr) slice←v11932)+1) ), (* (( (ptr) gf←c70620)+6) ));
SOURCE(31556, 123)
   {
      word var←c66524;
      var←c66524 = (*  (ptr) trajData←v24868 );
      switch (var←c66524) {
         case 2: 
            hiJoint←v24924 = (* (( (ptr) trajData←v24868)+1) );
            break;
         case 0: case 1: 
            hiJoint←v24924 = ((* (( (ptr) trajData←v24868)+1) ) - 1);
            break;
         default: 
            hiJoint←v24924 = (
               XR←RaiseUnnamedError(), 0
               );
            break;
         };
      };
SOURCE(31681, 37)
   if ((index←v11960 > hiJoint←v24924)) {
SOURCE(31718, 5)
      (void) XR←RaiseUnnamedError();
      };
SOURCE(31726, 52)
   {
      word pd279;
      pd279 = (* (( (ptr) (* (( (ptr) gf←c70620)+186)/* var←c62748 */  ))+5) );
      joint←v24896 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd279 ))))((* (( (ptr) trajData←v24868)+3) ), index←v11960, pd279), (* (
            ( (ptr) gf←c70620)+13) ));
      };
SOURCE(31780, 19)
   point←v12004 = (*  (W2Pt) joint←v24896 );
   /* removed tail goto */ 
   (*  (W2Pt) formal←c0552 ) = point←v12004;
   return;
   }

static void FetchJointPosTraj←P1980(formal←c0559, trajData←v12064, index←v12092)
   word formal←c0559;
   word trajData←v12064;
   word index←v12092;
   {
   register ptr gf←c70652 =  (ptr) &globalframe;
   W2 point←v12136;
   word joint←v24968 = 0;
   word hiJoint←v24996;
   /* FetchJointPosTraj: */ 
SOURCE(31805, 348)
SOURCE(31910, 123)
   {
      word var←c66556;
      var←c66556 = (*  (ptr) trajData←v12064 );
      switch (var←c66556) {
         case 2: 
            hiJoint←v24996 = (* (( (ptr) trajData←v12064)+1) );
            break;
         case 0: case 1: 
            hiJoint←v24996 = ((* (( (ptr) trajData←v12064)+1) ) - 1);
            break;
         default: 
            hiJoint←v24996 = (
               XR←RaiseUnnamedError(), 0
               );
            break;
         };
      };
SOURCE(32035, 37)
   if ((index←v12092 > hiJoint←v24996)) {
SOURCE(32072, 5)
      (void) XR←RaiseUnnamedError();
      };
SOURCE(32080, 52)
   {
      word pd280;
      pd280 = (* (( (ptr) (* (( (ptr) gf←c70652)+186)/* var←c62748 */  ))+5) );
      joint←v24968 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd280 ))))((* (( (ptr) trajData←v12064)+3) ), index←v12092, pd280), (* (
            ( (ptr) gf←c70652)+13) ));
      };
SOURCE(32134, 19)
   point←v12136 = (*  (W2Pt) joint←v24968 );
   /* removed tail goto */ 
   (*  (W2Pt) formal←c0559 ) = point←v12136;
   return;
   }

static void FetchJointNormal←P2040(formal←c0563, slice←v12196, index←v12224)
   word formal←c0563;
   word slice←v12196;
   word index←v12224;
   {
   W2 normal←v12268;
   /* FetchJointNormal: */ 
SOURCE(32159, 101)
SOURCE(32245, 15)
   normal←v12268.f0 = (*  (ptr) &fc224 );
   normal←v12268.f1 = (*  (ptr) &fc281 );
   /* removed tail goto */ 
   (*  (W2Pt) formal←c0563 ) = normal←v12268;
   return;
   }

static void LastJointPos←P2100(formal←c0568, slice←v12328)
   word formal←c0568;
   word slice←v12328;
   {
   register ptr gf←c70684 =  (ptr) &globalframe;
   W2 point←v12372;
   word trajData←v25040;
   word joint←v25068;
   /* LastJointPos: */ 
SOURCE(32277, 202)
SOURCE(32345, 39)
   trajData←v25040 = XR←Narrow((* (( (ptr) slice←v12328)+1) ), (* (( (ptr) gf←c70684)+6) ));
SOURCE(32386, 71)
   {
      word pd282;
      pd282 = (* (( (ptr) (* (( (ptr) gf←c70684)+186)/* var←c62748 */  ))+5) );
      joint←v25068 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd282 ))))((* (( (ptr) trajData←v25040)+3) ), (* (( (ptr) trajData←v25040)+1)
             ), pd282), (* (( (ptr) gf←c70684)+13) ));
      };
SOURCE(32459, 20)
   point←v12372 = (*  (W2Pt) joint←v25068 );
   /* removed tail goto */ 
   (*  (W2Pt) formal←c0568 ) = point←v12372;
   return;
   }

static void SetJointPos←P2160(slice←v12432, index←v12460, newPos←v12488)
   word slice←v12432;
   word index←v12460;
   W2 newPos←v12488;
   {
   register ptr gf←c70716 =  (ptr) &globalframe;
   word trajData←v25112;
   word joint←v25140;
   word segLeft←v25168 = 0;
   word segRight←v25196 = 0;
   /* SetJointPos: */ 
SOURCE(32483, 402)
SOURCE(32554, 39)
   trajData←v25112 = XR←Narrow((* (( (ptr) slice←v12432)+1) ), (* (( (ptr) gf←c70716)+6) ));
SOURCE(32595, 59)
   {
      word pd283;
      pd283 = (* (( (ptr) (* (( (ptr) gf←c70716)+186)/* var←c62748 */  ))+5) );
      joint←v25140 = XR←Narrow((word) ( *( (fPt) ((*  (ptr) pd283 ))))((* (( (ptr) trajData←v25112)+3) ), index←v12460, pd283), (* (
            ( (ptr) gf←c70716)+13) ));
      };
SOURCE(32684, 20)
   (*  (W2Pt) joint←v25140 ) = newPos←v12488;
SOURCE(32706, 79)
   if ((index←v12460 > 0)) {
SOURCE(32726, 38)
      segLeft←v25168 = (word) FetchSegment←P1740(slice←v12432, SGNCK((index←v12460 - 1)));
SOURCE(32766, 19)
      (*  (W2Pt) (( (ptr) segLeft←v25168)+11) ) = newPos←v12488;
      };
SOURCE(32790, 95)
   if ((index←v12460 < (* (( (ptr) trajData←v25112)+1) ))) {
SOURCE(32826, 37)
      segRight←v25196 = (word) FetchSegment←P1740(slice←v12432, index←v12460);
SOURCE(32865, 20)
      (*  (W2Pt) (( (ptr) segRight←v25196)+9) ) = newPos←v12488;
      };
   }

static word HiSegment←P2220(slice←v12548)
   word slice←v12548;
   {
   register ptr gf←c70748 =  (ptr) &globalframe;
   word highestIndex←v12592;
   word trajData←v25240;
   /* HiSegment: */ 
SOURCE(32894, 147)
SOURCE(32964, 39)
   trajData←v25240 = XR←Narrow((* (( (ptr) slice←v12548)+1) ), (* (( (ptr) gf←c70748)+6) ));
SOURCE(33005, 36)
   {
      word idx284;
      highestIndex←v12592 = (
         idx284 = (word) ((* (( (ptr) trajData←v25240)+1) ) - 1),
         SGNCK(idx284)
         );
      };
SOURCE(32894, 147)
   return(highestIndex←v12592);
   }

static word HiSegmentTraj←P2280(trajData←v12652)
   word trajData←v12652;
   {
   word highestIndex←v12696;
   /* HiSegmentTraj: */ 
SOURCE(33047, 116)
SOURCE(33127, 36)
   {
      word idx285;
      highestIndex←v12696 = (
         idx285 = (word) ((* (( (ptr) trajData←v12652)+1) ) - 1),
         SGNCK(idx285)
         );
      };
SOURCE(33047, 116)
   return(highestIndex←v12696);
   }

static word HiJoint←P2340(slice←v12756)
   word slice←v12756;
   {
   register ptr gf←c70780 =  (ptr) &globalframe;
   word highestIndex←v12800;
   word trajData←v25284;
   /* HiJoint: */ 
SOURCE(33169, 228)
SOURCE(33238, 39)
   trajData←v25284 = XR←Narrow((* (( (ptr) slice←v12756)+1) ), (* (( (ptr) gf←c70780)+6) ));
SOURCE(33279, 118)
   {
      word var←c66588;
      var←c66588 = (*  (ptr) trajData←v25284 );
      switch (var←c66588) {
         case 2: 
SOURCE(33313, 32)
            highestIndex←v12800 = (* (( (ptr) trajData←v25284)+1) );
            break;
         case 0: case 1: 
SOURCE(33362, 35)
            {
               word idx286;
               highestIndex←v12800 = (
                  idx286 = (word) ((* (( (ptr) trajData←v25284)+1) ) - 1),
                  SGNCK(idx286)
                  );
               };
            break;
         default: 
SOURCE(33410, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
SOURCE(33169, 228)
   return(highestIndex←v12800);
   }

static word HiJointTraj←P2400(trajData←v12860)
   word trajData←v12860;
   {
   word highestIndex←v12904;
   /* HiJointTraj: */ 
SOURCE(33421, 197)
SOURCE(33500, 118)
   {
      word var←c66620;
      var←c66620 = (*  (ptr) trajData←v12860 );
      switch (var←c66620) {
         case 2: 
SOURCE(33534, 32)
            highestIndex←v12904 = (* (( (ptr) trajData←v12860)+1) );
            break;
         case 0: case 1: 
SOURCE(33583, 35)
            {
               word idx287;
               highestIndex←v12904 = (
                  idx287 = (word) ((* (( (ptr) trajData←v12860)+1) ) - 1),
                  SGNCK(idx287)
                  );
               };
            break;
         default: 
SOURCE(33631, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
SOURCE(33421, 197)
   return(highestIndex←v12904);
   }

static word PreviousSegment←P2460(slice←v12964, segNum←v12992)
   word slice←v12964;
   word segNum←v12992;
   {
   register ptr gf←c70812 =  (ptr) &globalframe;
   word prev←v13036;
   word trajData←v25328;
   /* PreviousSegment: */ 
SOURCE(33642, 320)
SOURCE(33642, 320)
   prev←v13036 = 0;
SOURCE(33727, 39)
   trajData←v25328 = XR←Narrow((* (( (ptr) slice←v12964)+1) ), (* (( (ptr) gf←c70812)+6) ));
SOURCE(33768, 194)
   if (((*  (ptr) trajData←v25328 ) == 2)) {
SOURCE(33799, 74)
      if ((segNum←v12992 == 0)) {
SOURCE(33818, 17)
         return(0);
         }
      else {
SOURCE(33835, 38)
         prev←v13036 = (word) FetchSegment←P1740(slice←v12964, SGNCK((segNum←v12992 - 1)));
         };
      }
   else {
SOURCE(33884, 78)
      prev←v13036 = (word) FetchSegment←P1740(slice←v12964, IOP2( % ,  (int)((segNum←v12992 - 1) + (* (( (ptr) trajData←v25328)+1)
             )),  (int)(* (( (ptr) trajData←v25328)+1) )));
      };
SOURCE(33642, 320)
   return(prev←v13036);
   }

static word PreviousSegmentNum←P2520(slice←v13096, segNum←v13124)
   word slice←v13096;
   word segNum←v13124;
   {
   register ptr gf←c70844 =  (ptr) &globalframe;
   word prevNum←v13168;
   word trajData←v25372;
   /* PreviousSegmentNum: */ 
SOURCE(33971, 233)
SOURCE(34058, 39)
   trajData←v25372 = XR←Narrow((* (( (ptr) slice←v13096)+1) ), (* (( (ptr) gf←c70844)+6) ));
SOURCE(34099, 105)
   if (((*  (ptr) trajData←v25372 ) == 2)) {
      prevNum←v13168 = (segNum←v13124 - 1);
      }
   else {
      prevNum←v13168 = IOP2( % ,  (int)((segNum←v13124 - 1) + (* (( (ptr) trajData←v25372)+1) )),  (int)(* (( (ptr) trajData←v25372)+1)
          ));
      };
SOURCE(33971, 233)
   return(prevNum←v13168);
   }

static word FollowingSegmentNum←P2580(slice←v13228, segNum←v13256)
   word slice←v13228;
   word segNum←v13256;
   {
   register ptr gf←c70876 =  (ptr) &globalframe;
   word followNum←v13300;
   word trajData←v25416;
   /* FollowingSegmentNum: */ 
SOURCE(34210, 274)
SOURCE(34300, 39)
   trajData←v25416 = XR←Narrow((* (( (ptr) slice←v13228)+1) ), (* (( (ptr) gf←c70876)+6) ));
SOURCE(34341, 143)
   if (((*  (ptr) trajData←v25416 ) == 2)) {
SOURCE(34370, 70)
      if ((segNum←v13256 == (word) HiSegment←P2220(slice←v13228))) {
         followNum←v13300 =  (word) -1;
         }
      else {
         followNum←v13300 = (segNum←v13256 + 1);
         };
      }
   else {
SOURCE(34440, 44)
      followNum←v13300 = ((segNum←v13256 + 1) % (* (( (ptr) trajData←v25416)+1) ));
      };
SOURCE(34210, 274)
   return(followNum←v13300);
   }

static word FollowingJoint←P2640(slice←v13360, index←v13388)
   word slice←v13360;
   word index←v13388;
   {
   register ptr gf←c70908 =  (ptr) &globalframe;
   word nextIndex←v13432;
   word trajData←v25460;
   /* FollowingJoint: */ 
SOURCE(34490, 285)
SOURCE(34575, 39)
   trajData←v25460 = XR←Narrow((* (( (ptr) slice←v13360)+1) ), (* (( (ptr) gf←c70908)+6) ));
SOURCE(34616, 159)
   {
      word var←c66652;
      var←c66652 = (*  (ptr) trajData←v25460 );
      switch (var←c66652) {
         case 2: 
SOURCE(34650, 63)
            if ((index←v13388 == (* (( (ptr) trajData←v25460)+1) ))) {
               nextIndex←v13432 =  (word) -1;
               }
            else {
               nextIndex←v13432 = (index←v13388 + 1);
               };
            break;
         case 0: case 1: 
SOURCE(34730, 45)
            nextIndex←v13432 = ((index←v13388 + 1) % (* (( (ptr) trajData←v25460)+1) ));
            break;
         default: 
SOURCE(34788, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
SOURCE(34490, 285)
   return(nextIndex←v13432);
   }

static word IsEndJoint←P2700(slice←v13492, index←v13520)
   word slice←v13492;
   word index←v13520;
   {
   register ptr gf←c70940 =  (ptr) &globalframe;
   word var←c13564;
   word trajData←v25504;
   /* IsEndJoint: */ 
SOURCE(34799, 222)
SOURCE(34870, 39)
   trajData←v25504 = XR←Narrow((* (( (ptr) slice←v13492)+1) ), (* (( (ptr) gf←c70940)+6) ));
SOURCE(34911, 110)
   {
      word var←c66684;
      var←c66684 = (*  (ptr) trajData←v25504 );
      switch (var←c66684) {
         case 2: 
SOURCE(34945, 46)
            {
               word tc288;
               if ((index←v13520 == 0)) {
                  tc288 =  (word)  (unsigned) 1;
                  }
               else {
                  tc288 =  (word)  (unsigned) (index←v13520 == (* (( (ptr) trajData←v25504)+1) ));
                  };
               return(tc288);
               };
         case 0: case 1: 
SOURCE(35008, 13)
            return(0);
         default: 
SOURCE(35034, 5)
            (void) XR←RaiseUnnamedError();
            break;
         };
      };
   }

static void SaveSelection←P2760(slice←v13624, selectClass←v13652, scene←v13680)
   word slice←v13624;
   word selectClass←v13652;
   word scene←v13680;
   {
   register ptr gf←c70972 =  (ptr) &globalframe;
   word seq←v25548;
   /* SaveSelection: */ 
SOURCE(35044, 257)
SOURCE(35133, 69)
   {
      word pd289;
      pd289 = (* (( (ptr) (* (( (ptr) gf←c70972)+193)/* var←c64124 */  ))+20) );
      seq←v25548 = (word) ( *( (fPt) ((*  (ptr) pd289 ))))(slice←v13624, selectClass←v13652, pd289);
      };
SOURCE(35204, 97)
   if ((seq←v25548 == 0)) {
SOURCE(35220, 40)
      (void) ClearSelection←P2940(slice←v13624, selectClass←v13652);
      }
   else {
SOURCE(35260, 41)
      (void) SaveSelectionInSequence←P2820(seq←v25548, selectClass←v13652);
      };
   }

static void SaveSelectionInSequence←P2820(descriptor←v13740, selectClass←v13768)
   word descriptor←v13740;
   word selectClass←v13768;
   {
   /* SaveSelectionInSequence: */ 
SOURCE(35307, 169)
SOURCE(35407, 69)
   (void) SaveSelectionInParts←P2880((*  (ptr) descriptor←v13740 ), (* (( (ptr) descriptor←v13740)+1) ), selectClass←v13768)
   ;
   }

static void SaveSelectionInParts←P2880(slice←v13828, parts←v13856, selectClass←v13884)
   word slice←v13828;
   word parts←v13856;
   word selectClass←v13884;
   {
   register ptr gf←c71004 =  (ptr) &globalframe;
   word seg←v25592 = 0;
   word joint←v25620 = 0;
   word trajParts←v25648;
   word hiSegment←v25676;
   word hiJoint←v25704;
   /* SaveSelectionInParts: */ 
SOURCE(35482, 614)
SOURCE(35611, 36)
   trajParts←v25648 = XR←Narrow(parts←v13856, (* (( (ptr) gf←c71004)+18) ));
SOURCE(35649, 33)
   hiSegment←v25676 = (word) HiSegment←P2220(slice←v13828);
SOURCE(35684, 29)
   hiJoint←v25704 = (word) HiJoint←P2340(slice←v13828);
SOURCE(35715, 247)
   {
      register word i←v25748 = 0;
      register word noName←c66716;
      noName←c66716 = hiSegment←v25676;
      if ((i←v25748 > noName←c66716)) {
         goto lab←L100059;
         };
      lab←L100062: ;
SOURCE(35747, 28)
      seg←v25592 = (word) FetchSegment←P1740(slice←v13828, i←v25748);
SOURCE(35777, 56)
      {
         word var←c66748;
         word var←c0996;
         var←c66748 = (*  (ptr) trajParts←v25648 );
         {
            word limit290;
            var←c0996 =  (unsigned) XR←ExtractField(var←c66748, 32 + (word) (
                  limit290 = (*  (ptr) var←c66748 ),
                  BCK(i←v25748, limit290)
                  ), 1);
            };
         (void) SetSegmentField←P3420(seg←v25592, var←c0996, selectClass←v13884);
         };
SOURCE(35835, 127)
      {
         register word j←v25792 = 0;
         register word noName←c66780;
         {
            word pd291;
            pd291 = (* (( (ptr) (*  (ptr) seg←v25592 ))+17) );
            noName←c66780 = (word) ( *( (fPt) ((*  (ptr) pd291 ))))(seg←v25592, pd291);
            };
         if ((j←v25792 >= noName←c66780)) {
            goto lab←L100063;
            };
         lab←L100066: ;
SOURCE(35890, 72)
         {
            word var←c66812;
            word var←c66844;
            word var←c0997;
            {
               word limit292;
               var←c66812 = (* (( (ptr) trajParts←v25648)+2) );
               var←c66844 = (* ((( (ptr) var←c66812)+1)+(
                     limit292 = (*  (ptr) var←c66812 ),
                     BCK(i←v25748, limit292)
                     )) );
               };
            {
               word limit293;
               var←c0997 =  (unsigned) XR←ExtractField(var←c66844, 32 + (word) (
                     limit293 = (*  (ptr) var←c66844 ),
                     BCK(j←v25792, limit293)
                     ), 1);
               };
            (void) SetControlPointField←P3120(seg←v25592, j←v25792, var←c0997, selectClass←v13884);
            };
         j←v25792 = (j←v25792 + 1);
         if ((j←v25792 < noName←c66780)) {
            goto lab←L100066;
            };
         lab←L100063: ;
         };
      if ((i←v25748 >= noName←c66716)) {
         goto lab←L100059;
         };
      i←v25748 = (i←v25748 + 1);
      goto lab←L100062;
      lab←L100059: ;
      };
SOURCE(35982, 114)
   {
      register word i←v25836 = 0;
      register word noName←c66876;
      noName←c66876 = hiJoint←v25704;
      if ((i←v25836 > noName←c66876)) {
         goto lab←L100067;
         };
      lab←L100070: ;
SOURCE(36012, 28)
      joint←v25620 = (word) FetchJoint←P1860(slice←v13828, i←v25836);
SOURCE(36042, 54)
      {
         word var←c66908;
         word var←c0998;
         var←c66908 = (* (( (ptr) trajParts←v25648)+1) );
         {
            word limit294;
            var←c0998 =  (unsigned) XR←ExtractField(var←c66908, 32 + (word) (
                  limit294 = (*  (ptr) var←c66908 ),
                  BCK(i←v25836, limit294)
                  ), 1);
            };
         (void) SetJointField←P3360(joint←v25620, var←c0998, selectClass←v13884);
         };
      if ((i←v25836 >= noName←c66876)) {
         goto lab←L100067;
         };
      i←v25836 = (i←v25836 + 1);
      goto lab←L100070;
      lab←L100067: ;
      };
   }

static void ClearSelection←P2940(slice←v13944, selectClass←v13972)
   word slice←v13944;
   word selectClass←v13972;
   {
   word seg←v25880 = 0;
   word joint←v25908 = 0;
   word hiSegment←v25936;
   word hiJoint←v25964;
   /* ClearSelection: */ 
SOURCE(36111, 497)
SOURCE(36215, 33)
   hiSegment←v25936 = (word) HiSegment←P2220(slice←v13944);
SOURCE(36250, 29)
   hiJoint←v25964 = (word) HiJoint←P2340(slice←v13944);
SOURCE(36281, 207)
   {
      register word i←v26008 = 0;
      register word noName←c66940;
      noName←c66940 = hiSegment←v25936;
      if ((i←v26008 > noName←c66940)) {
         goto lab←L100071;
         };
      lab←L100074: ;
SOURCE(36313, 28)
      seg←v25880 = (word) FetchSegment←P1740(slice←v13944, i←v26008);
SOURCE(36343, 40)
      (void) SetSegmentField←P3420(seg←v25880, 0, selectClass←v13972);
SOURCE(36385, 103)
      {
         register word j←v26052 = 0;
         register word noName←c66972;
         {
            word pd295;
            pd295 = (* (( (ptr) (*  (ptr) seg←v25880 ))+17) );
            noName←c66972 = (word) ( *( (fPt) ((*  (ptr) pd295 ))))(seg←v25880, pd295);
            };
         if ((j←v26052 >= noName←c66972)) {
            goto lab←L100075;
            };
         lab←L100078: ;
SOURCE(36440, 48)
         (void) SetControlPointField←P3120(seg←v25880, j←v26052, 0, selectClass←v13972);
         j←v26052 = (j←v26052 + 1);
         if ((j←v26052 < noName←c66972)) {
            goto lab←L100078;
            };
         lab←L100075: ;
         };
      if ((i←v26008 >= noName←c66940)) {
         goto lab←L100071;
         };
      i←v26008 = (i←v26008 + 1);
      goto lab←L100074;
      lab←L100071: ;
      };
SOURCE(36508, 100)
   {
      register word i←v26096 = 0;
      register word noName←c67004;
      noName←c67004 = hiJoint←v25964;
      if ((i←v26096 > noName←c67004)) {
         goto lab←L100079;
         };
      lab←L100082: ;
SOURCE(36538, 28)
      joint←v25908 = (word) FetchJoint←P1860(slice←v13944, i←v26096);
SOURCE(36568, 40)
      (void) SetJointField←P3360(joint←v25908, 0, selectClass←v13972);
      if ((i←v26096 >= noName←c67004)) {
         goto lab←L100079;
         };
      i←v26096 = (i←v26096 + 1);
      goto lab←L100082;
      lab←L100079: ;
      };
   }

static void ClearSelections←P3000(slice←v14032)
   word slice←v14032;
   {
   word seg←v26140 = 0;
   word joint←v26168 = 0;
   word hiSegment←v26196;
   word hiJoint←v26224;
   /* ClearSelections: */ 
SOURCE(36623, 799)
SOURCE(36699, 33)
   hiSegment←v26196 = (word) HiSegment←P2220(slice←v14032);
SOURCE(36734, 29)
   hiJoint←v26224 = (word) HiJoint←P2340(slice←v14032);
SOURCE(36765, 435)
   {
      register word i←v26268 = 0;
      register word noName←c67036;
      noName←c67036 = hiSegment←v26196;
      if ((i←v26268 > noName←c67036)) {
         goto lab←L100083;
         };
      lab←L100086: ;
SOURCE(36797, 28)
      seg←v26140 = (word) FetchSegment←P1740(slice←v14032, i←v26268);
SOURCE(36827, 35)
      (void) SetSegmentField←P3420(seg←v26140, 0, 0);
SOURCE(36864, 32)
      (void) SetSegmentField←P3420(seg←v26140, 0, 1);
SOURCE(36898, 35)
      (void) SetSegmentField←P3420(seg←v26140, 0, 2);
SOURCE(36935, 34)
      (void) SetSegmentField←P3420(seg←v26140, 0, 3);
SOURCE(36971, 229)
      {
         register word j←v26312 = 0;
         register word noName←c67068;
         {
            word pd296;
            pd296 = (* (( (ptr) (*  (ptr) seg←v26140 ))+17) );
            noName←c67068 = (word) ( *( (fPt) ((*  (ptr) pd296 ))))(seg←v26140, pd296);
            };
         if ((j←v26312 >= noName←c67068)) {
            goto lab←L100087;
            };
         lab←L100090: ;
SOURCE(37026, 43)
         (void) SetControlPointField←P3120(seg←v26140, j←v26312, 0, 0);
SOURCE(37071, 40)
         (void) SetControlPointField←P3120(seg←v26140, j←v26312, 0, 1);
SOURCE(37113, 43)
         (void) SetControlPointField←P3120(seg←v26140, j←v26312, 0, 2);
SOURCE(37158, 42)
         (void) SetControlPointField←P3120(seg←v26140, j←v26312, 0, 3);
         j←v26312 = (j←v26312 + 1);
         if ((j←v26312 < noName←c67068)) {
            goto lab←L100090;
            };
         lab←L100087: ;
         };
      if ((i←v26268 >= noName←c67036)) {
         goto lab←L100083;
         };
      i←v26268 = (i←v26268 + 1);
      goto lab←L100086;
      lab←L100083: ;
      };
SOURCE(37220, 202)
   {
      register word i←v26356 = 0;
      register word noName←c67100;
      noName←c67100 = hiJoint←v26224;
      if ((i←v26356 > noName←c67100)) {
         goto lab←L100091;
         };
      lab←L100094: ;
SOURCE(37250, 28)
      joint←v26168 = (word) FetchJoint←P1860(slice←v14032, i←v26356);
SOURCE(37280, 35)
      (void) SetJointField←P3360(joint←v26168, 0, 0);
SOURCE(37317, 32)
      (void) SetJointField←P3360(joint←v26168, 0, 1);
SOURCE(37351, 35)
      (void) SetJointField←P3360(joint←v26168, 0, 2);
SOURCE(37388, 34)
      (void) SetJointField←P3360(joint←v26168, 0, 3);
      if ((i←v26356 >= noName←c67100)) {
         goto lab←L100091;
         };
      i←v26356 = (i←v26356 + 1);
      goto lab←L100094;
      lab←L100091: ;
      };
   }

static word RemakeSelection←P3060(slice←v14092, selectClass←v14120)
   word slice←v14092;
   word selectClass←v14120;
   {
   register ptr gf←c71036 =  (ptr) &globalframe;
   word parts←v14164;
   word trajData←v26400;
   word trajParts←v26428;
   word seg←v26456 = 0;
   word joint←v26484 = 0;
   word hiSegment←v26512;
   word hiJoint←v26540;
   /* RemakeSelection: */ 
SOURCE(37437, 1045)
SOURCE(37437, 1045)
   parts←v14164 = 0;
SOURCE(37542, 39)
   trajData←v26400 = XR←Narrow((* (( (ptr) slice←v14092)+1) ), (* (( (ptr) gf←c71036)+6) ));
SOURCE(37611, 63)
   {
      word pd297;
      pd297 = (* (( (ptr) (* (( (ptr) gf←c71036)+189)/* var←c63644 */  ))+6) );
      trajParts←v26428 = (word) ( *( (fPt) ((*  (ptr) pd297 ))))(trajData←v26400, pd297);
      };
SOURCE(37704, 33)
   hiSegment←v26512 = (word) HiSegment←P2220(slice←v14092);
SOURCE(37739, 29)
   hiJoint←v26540 = (word) HiJoint←P2340(slice←v14092);
SOURCE(37770, 425)
   {
      register word i←v26584 = 0;
      register word noName←c67132;
      noName←c67132 = hiSegment←v26512;
      if ((i←v26584 > noName←c67132)) {
         goto lab←L100095;
         };
      lab←L100098: ;
      {
         word var←c67228;
SOURCE(37802, 28)
         seg←v26456 = (word) FetchSegment←P1740(slice←v14092, i←v26584);
SOURCE(37832, 57)
         {
            word var←c67164;
            var←c67164 = (word) GetSegmentField←P3300(seg←v26456, selectClass←v14120);
            {
               word var←c67196;
               var←c67196 = (*  (ptr) trajParts←v26428 );
               {
                  word limit298;
                  word xs299;
                  word x300;
                  xs299 = (word) (
                     limit298 = (*  (ptr) var←c67196 ),
                     BCK(i←v26584, limit298)
                     );
                  x300 = (word) ((( (bPt) var←c67196)+4) + ((word) xs299 >> 3));
                  xs299 = 8 - ((word) (xs299 & 7)+1);
                  (*  (bPt) x300 ) = ((*  (bPt) x300 ) & ( ~ ((unsigned) 1 << xs299))) | (((var←c67164 & 1)) << xs299);
                  };
               };
            };
SOURCE(37891, 73)
         {
            word limit301;
            var←c67228 = (*  (ptr) trajParts←v26428 );
            if (XR←ExtractField(var←c67228, 32 + (word) (
                  limit301 = (*  (ptr) var←c67228 ),
                  BCK(i←v26584, limit301)
                  ), 1)) {
SOURCE(37921, 43)
               (* (( (ptr) trajParts←v26428)+3) ) = ((* (( (ptr) trajParts←v26428)+3) ) + 1);
               };
            };
SOURCE(37966, 229)
         {
            register word j←v26628 = 0;
            register word noName←c67260;
            {
               word pd302;
               pd302 = (* (( (ptr) (*  (ptr) seg←v26456 ))+17) );
               noName←c67260 = (word) ( *( (fPt) ((*  (ptr) pd302 ))))(seg←v26456, pd302);
               };
            if ((j←v26628 >= noName←c67260)) {
               goto lab←L100099;
               };
            lab←L100102: ;
            {
               word var←c67420;
SOURCE(38021, 73)
               {
                  word var←c67292;
                  var←c67292 = (word) GetControlPointField←P3180(seg←v26456, j←v26628, selectClass←v14120);
                  {
                     word var←c67356;
                     {
                        word var←c67324;
                        var←c67324 = (* (( (ptr) trajParts←v26428)+2) );
                        {
                           word limit303;
                           var←c67356 = (* ((( (ptr) var←c67324)+1)+(
/*1*/      limit303 = (*  (ptr) var←c67324 ),
/*1*/      BCK(i←v26584, limit303)
/*1*/      )) );
                           };
                        };
                     {
                        word limit304;
                        word xs305;
                        word x306;
                        xs305 = (word) (
                           limit304 = (*  (ptr) var←c67356 ),
                           BCK(j←v26628, limit304)
                           );
                        x306 = (word) ((( (bPt) var←c67356)+4) + ((word) xs305 >> 3));
                        xs305 = 8 - ((word) (xs305 & 7)+1);
                        (*  (bPt) x306 ) = ((*  (bPt) x306 ) & ( ~ ((unsigned) 1 << xs305))) | (((var←c67292 & 1)) << xs305);
                        };
                     };
                  };
SOURCE(38096, 99)
               {
                  word limit308;
                  {
                     word var←c67388;
                     var←c67388 = (* (( (ptr) trajParts←v26428)+2) );
                     {
                        word limit307;
                        var←c67420 = (* ((( (ptr) var←c67388)+1)+(
/*1*/   limit307 = (*  (ptr) var←c67388 ),
/*1*/   BCK(i←v26584, limit307)
/*1*/   )) );
                        };
                     };
                  if (XR←ExtractField(var←c67420, 32 + (word) (
                        limit308 = (*  (ptr) var←c67420 ),
                        BCK(j←v26628, limit308)
                        ), 1)) {
SOURCE(38134, 61)
                     (* (( (ptr) trajParts←v26428)+5) ) = ((* (( (ptr) trajParts←v26428)+5) ) + 1);
                     };
                  };
               };
            j←v26628 = (j←v26628 + 1);
            if ((j←v26628 < noName←c67260)) {
               goto lab←L100102;
               };
            lab←L100099: ;
            };
         };
      if ((i←v26584 >= noName←c67132)) {
         goto lab←L100095;
         };
      i←v26584 = (i←v26584 + 1);
      goto lab←L100098;
      lab←L100095: ;
      };
SOURCE(38215, 192)
   {
      register word i←v26672 = 0;
      register word noName←c67452;
      noName←c67452 = hiJoint←v26540;
      if ((i←v26672 > noName←c67452)) {
         goto lab←L100103;
         };
      lab←L100106: ;
      {
         word var←c67548;
SOURCE(38245, 28)
         joint←v26484 = (word) FetchJoint←P1860(slice←v14092, i←v26672);
SOURCE(38275, 55)
         {
            word var←c67484;
            var←c67484 = (word) GetJointField←P3240(joint←v26484, selectClass←v14120);
            {
               word var←c67516;
               var←c67516 = (* (( (ptr) trajParts←v26428)+1) );
               {
                  word limit309;
                  word xs310;
                  word x311;
                  xs310 = (word) (
                     limit309 = (*  (ptr) var←c67516 ),
                     BCK(i←v26672, limit309)
                     );
                  x311 = (word) ((( (bPt) var←c67516)+4) + ((word) xs310 >> 3));
                  xs310 = 8 - ((word) (xs310 & 7)+1);
                  (*  (bPt) x311 ) = ((*  (bPt) x311 ) & ( ~ ((unsigned) 1 << xs310))) | (((var←c67484 & 1)) << xs310);
                  };
               };
            };
SOURCE(38332, 75)
         {
            word limit312;
            var←c67548 = (* (( (ptr) trajParts←v26428)+1) );
            if (XR←ExtractField(var←c67548, 32 + (word) (
                  limit312 = (*  (ptr) var←c67548 ),
                  BCK(i←v26672, limit312)
                  ), 1)) {
SOURCE(38360, 47)
               (* (( (ptr) trajParts←v26428)+4) ) = ((* (( (ptr) trajParts←v26428)+4) ) + 1);
               };
            };
         };
      if ((i←v26672 >= noName←c67452)) {
         goto lab←L100103;
         };
      i←v26672 = (i←v26672 + 1);
      goto lab←L100106;
      lab←L100103: ;
      };
SOURCE(38418, 64)
   {
      word pd313;
      pd313 = (* (( (ptr) (* (( (ptr) gf←c71036)+189)/* var←c63644 */  ))+25) );
      if ((0 != (word) ( *( (fPt) ((*  (ptr) pd313 ))))(trajParts←v26428, pd313))) {
         parts←v14164 = 0;
         }
      else {
         parts←v14164 = trajParts←v26428;
         };
      };
SOURCE(37437, 1045)
   return(parts←v14164);
   }

static void SetControlPointField←P3120(seg←v14224, cpNum←v14252, selected←v14280, selectClass←v14308)
   word seg←v14224;
   word cpNum←v14252;
   word selected←v14280;
   word selectClass←v14308;
   {
   /* SetControlPointField: */ 
SOURCE(38488, 169)
SOURCE(38592, 65)
   {
      word pd314;
      pd314 = (* (( (ptr) (*  (ptr) seg←v14224 ))+14) );
      (void) ( *( (fPt) ((*  (ptr) pd314 ))))(seg←v14224, cpNum←v14252, selected←v14280, selectClass←v14308, pd314);
      };
   }

static word GetControlPointField←P3180(seg←v14368, cpNum←v14396, selectClass←v14424)
   word seg←v14368;
   word cpNum←v14396;
   word selectClass←v14424;
   {
   word selected←v14468;
   /* GetControlPointField: */ 
SOURCE(38663, 179)
SOURCE(38776, 66)
   {
      word pd315;
      pd315 = (* (( (ptr) (*  (ptr) seg←v14368 ))+15) );
      selected←v14468 = (word) ( *( (fPt) ((*  (ptr) pd315 ))))(seg←v14368, cpNum←v14396, selectClass←v14424, pd315);
      };
SOURCE(38663, 179)
   return(selected←v14468);
   }

static word GetJointField←P3240(joint←v14528, selectClass←v14556)
   word joint←v14528;
   word selectClass←v14556;
   {
   word selected←v14600;
   /* GetJointField: */ 
SOURCE(38848, 311)
SOURCE(38941, 218)
   {
      word var←c67580;
      var←c67580 = selectClass←v14556;
      switch (var←c67580) {
         case 0: 
SOURCE(38975, 39)
            selected←v14600 = (* (( (ptr) joint←v14528)+2) );
            break;
         case 1: 
SOURCE(39023, 36)
            selected←v14600 = (* (( (ptr) joint←v14528)+3) );
            break;
         case 2: 
SOURCE(39071, 39)
            selected←v14600 = (* (( (ptr) joint←v14528)+4) );
            break;
         case 3: 
SOURCE(39121, 38)
            selected←v14600 = (* (( (ptr) joint←v14528)+5) );
            break;
         };
      };
SOURCE(38848, 311)
   return(selected←v14600);
   }

static word GetSegmentField←P3300(seg←v14660, selectClass←v14688)
   word seg←v14660;
   word selectClass←v14688;
   {
   word selected←v14732;
   /* GetSegmentField: */ 
SOURCE(39174, 305)
SOURCE(39269, 210)
   {
      word var←c67612;
      var←c67612 = selectClass←v14688;
      switch (var←c67612) {
         case 0: 
SOURCE(39303, 37)
            selected←v14732 = (* (( (ptr) seg←v14660)+17) );
            break;
         case 1: 
SOURCE(39349, 34)
            selected←v14732 = (* (( (ptr) seg←v14660)+18) );
            break;
         case 2: 
SOURCE(39395, 37)
            selected←v14732 = (* (( (ptr) seg←v14660)+19) );
            break;
         case 3: 
SOURCE(39443, 36)
            selected←v14732 = (* (( (ptr) seg←v14660)+20) );
            break;
         };
      };
SOURCE(39174, 305)
   return(selected←v14732);
   }

static void SetJointField←P3360(joint←v14792, selected←v14820, selectClass←v14848)
   word joint←v14792;
   word selected←v14820;
   word selectClass←v14848;
   {
   /* SetJointField: */ 
SOURCE(39494, 303)
SOURCE(39579, 218)
   {
      word var←c67644;
      var←c67644 = selectClass←v14848;
      switch (var←c67644) {
         case 0: 
SOURCE(39613, 39)
            (* (( (ptr) joint←v14792)+2) ) = selected←v14820;
            break;
         case 1: 
SOURCE(39661, 36)
            (* (( (ptr) joint←v14792)+3) ) = selected←v14820;
            break;
         case 2: 
SOURCE(39709, 39)
            (* (( (ptr) joint←v14792)+4) ) = selected←v14820;
            break;
         case 3: 
SOURCE(39759, 38)
            (* (( (ptr) joint←v14792)+5) ) = selected←v14820;
            break;
         };
      };
   }

static void SetSegmentField←P3420(seg←v14908, selected←v14936, selectClass←v14964)
   word seg←v14908;
   word selected←v14936;
   word selectClass←v14964;
   {
   /* SetSegmentField: */ 
SOURCE(39812, 297)
SOURCE(39899, 210)
   {
      word var←c67676;
      var←c67676 = selectClass←v14964;
      switch (var←c67676) {
         case 0: 
SOURCE(39933, 37)
            (* (( (ptr) seg←v14908)+17) ) = selected←v14936;
            break;
         case 1: 
SOURCE(39979, 34)
            (* (( (ptr) seg←v14908)+18) ) = selected←v14936;
            break;
         case 2: 
SOURCE(40025, 37)
            (* (( (ptr) seg←v14908)+19) ) = selected←v14936;
            break;
         case 3: 
SOURCE(40073, 36)
            (* (( (ptr) seg←v14908)+20) ) = selected←v14936;
            break;
         };
      };
   }

static word CopyJoint←P3480(joint←v15024)
   word joint←v15024;
   {
   register ptr gf←c71068 =  (ptr) &globalframe;
   word copy←v15068;
   /* CopyJoint: */ 
SOURCE(40124, 141)
SOURCE(40124, 141)
   copy←v15068 = 0;
SOURCE(40181, 84)
   {
      word var←c67708;
      var←c67708 = XR←NewObject(28, (* (( (ptr) gf←c71068)+13) ));
      (*  (W2Pt) var←c67708 ) = (*  (W2Pt) joint←v15024 );
      (*  (W4Pt) (( (ptr) var←c67708)+2) ) = (*  (W4Pt) (( (ptr) joint←v15024)+2) );
      copy←v15068 = var←c67708;
      };
SOURCE(40124, 141)
   return(copy←v15068);
   }

static void SetTrajRole←P3540(traj←v15128, role←v15156)
   word traj←v15128;
   word role←v15156;
   {
   register ptr gf←c71100 =  (ptr) &globalframe;
   /* SetTrajRole: */ 
SOURCE(40271, 142)
SOURCE(40335, 78)
   {
      word pd316;
      pd316 = (* (( (ptr) (* (( (ptr) gf←c71100)+192)/* var←c64092 */  ))+6) );
      if (((word) ( *( (fPt) ((*  (ptr) pd316 ))))(traj←v15128, pd316) == (* (( (ptr) gf←c71100)+30) ))) {
SOURCE(40374, 39)
         (*  (ptr) XR←Narrow((* (( (ptr) traj←v15128)+1) ), (* (( (ptr) gf←c71100)+6) )) ) = role←v15156;
         };
      };
   }

static word GetTrajRole←P3600(traj←v15216)
   word traj←v15216;
   {
   register ptr gf←c71132 =  (ptr) &globalframe;
   word role←v15260;
   /* GetTrajRole: */ 
SOURCE(40419, 112)
SOURCE(40492, 39)
   role←v15260 = (*  (ptr) XR←Narrow((* (( (ptr) traj←v15216)+1) ), (* (( (ptr) gf←c71132)+6) )) );
SOURCE(40419, 112)
   return(role←v15260);
   }

static void UnpackSimpleDescriptor←P3660(formal←c0727, traj←v15320, parts←v15348)
   word formal←c0727;
   word traj←v15320;
   word parts←v15348;
   {
   register ptr gf←c71164 =  (ptr) &globalframe;
   word success←v15392;
   word partType←v15420;
   word trajData←v15448;
   word joint←v15476;
   word jointNum←v15504;
   W2 cp←v15532;
   word cpNum←v15560;
   word seg←v15588;
   word segNum←v15616;
   /* UnpackSimpleDescriptor: */ 
SOURCE(40537, 451)
SOURCE(40537, 451)
   success←v15392 = 0;
SOURCE(40537, 451)
   partType←v15420 = 0;
SOURCE(40537, 451)
   trajData←v15448 = 0;
SOURCE(40537, 451)
   joint←v15476 = 0;
SOURCE(40537, 451)
   jointNum←v15504 = 999;
SOURCE(40537, 451)
   cp←v15532.f0 = (*  (ptr) &fc224 );
   cp←v15532.f1 = (*  (ptr) &fc224 );
SOURCE(40537, 451)
   cpNum←v15560 = 999;
SOURCE(40537, 451)
   seg←v15588 = 0;
SOURCE(40537, 451)
   segNum←v15616 = 999;
SOURCE(40810, 59)
   {
      word pd318;
      if ((traj←v15320 == 0)) { goto then0317;};
      pd318 = (* (( (ptr) (* (( (ptr) gf←c71164)+192)/* var←c64092 */  ))+6) );
      if (((word) ( *( (fPt) ((*  (ptr) pd318 ))))(traj←v15320, pd318) != (* (( (ptr) gf←c71164)+30) ))) {
         then0317: ;
SOURCE(40863, 6)
         goto lab←L100107;
         };
      };
SOURCE(40871, 117)
   {
      W10 var←c67740;
      {
         word pd319;
         pd319 = (* (( (ptr) (* (( (ptr) gf←c71164)+189)/* var←c63644 */  ))+36) );
         (void) ( *( (fPt) ((*  (ptr) pd319 ))))((word) &var←c67740, traj←v15320, parts←v15348, pd319);
         };
      segNum←v15616 = (* (( (ptr) &var←c67740)+9) );
      seg←v15588 = (* (( (ptr) &var←c67740)+8) );
      cpNum←v15560 = (* (( (ptr) &var←c67740)+7) );
      cp←v15532 = (*  (W2Pt) (( (ptr) &var←c67740)+5) );
      jointNum←v15504 = (* (( (ptr) &var←c67740)+4) );
      joint←v15476 = (* (( (ptr) &var←c67740)+3) );
      trajData←v15448 = (* (( (ptr) &var←c67740)+2) );
      partType←v15420 = (* (( (ptr) &var←c67740)+1) );
      success←v15392 = (*  (ptr) &var←c67740 );
      };
   /* removed tail goto */ 
   lab←L100107: ;
   (*  (ptr) formal←c0727 ) = success←v15392;
   (* (( (ptr) formal←c0727)+1) ) = partType←v15420;
   (* (( (ptr) formal←c0727)+2) ) = trajData←v15448;
   (* (( (ptr) formal←c0727)+3) ) = joint←v15476;
   (* (( (ptr) formal←c0727)+4) ) = jointNum←v15504;
   (*  (W2Pt) (( (ptr) formal←c0727)+5) ) = cp←v15532;
   (* (( (ptr) formal←c0727)+7) ) = cpNum←v15560;
   (* (( (ptr) formal←c0727)+8) ) = seg←v15588;
   (* (( (ptr) formal←c0727)+9) ) = segNum←v15616;
   return;
   }

static void UnpackHitData←P3720(formal←c0735, hitData←v15676)
   word formal←c0735;
   word hitData←v15676;
   {
   register ptr gf←c71196 =  (ptr) &globalframe;
   word hitType←v15736;
   word segNum←v15764;
   word cpNum←v15792;
   word jointNum←v15820;
   W2 hitPoint←v15848;
   word trajHitData←v26716;
   /* UnpackHitData: */ 
SOURCE(40994, 319)
SOURCE(41118, 42)
   trajHitData←v26716 = XR←Narrow(hitData←v15676, (* (( (ptr) gf←c71196)+19) ));
SOURCE(41162, 29)
   hitType←v15736 = (*  (ptr) trajHitData←v26716 );
SOURCE(41193, 27)
   segNum←v15764 = (* (( (ptr) trajHitData←v26716)+1) );
SOURCE(41222, 25)
   cpNum←v15792 = (* (( (ptr) trajHitData←v26716)+2) );
SOURCE(41249, 31)
   jointNum←v15820 = (* (( (ptr) trajHitData←v26716)+3) );
SOURCE(41282, 31)
   hitPoint←v15848 = (*  (W2Pt) (( (ptr) trajHitData←v26716)+4) );
   /* removed tail goto */ 
   (*  (ptr) formal←c0735 ) = hitType←v15736;
   (* (( (ptr) formal←c0735)+1) ) = segNum←v15764;
   (* (( (ptr) formal←c0735)+2) ) = cpNum←v15792;
   (* (( (ptr) formal←c0735)+3) ) = jointNum←v15820;
   (*  (W2Pt) (( (ptr) formal←c0735)+4) ) = hitPoint←v15848;
   return;
   }

static void PointToVector←P3780(formal←c0738, point←v15944)
   word formal←c0738;
   W2 point←v15944;
   {
   W3 vector←v15988;
   /* PointToVector: */ 
SOURCE(41358, 121)
SOURCE(41424, 19)
   vector←v15988.f0 = point←v15944.f0;
SOURCE(41445, 19)
   vector←v15988.f1 = point←v15944.f1;
SOURCE(41466, 13)
   vector←v15988.f2 = (*  (ptr) &fc224 );
   /* removed tail goto */ 
   (*  (W3Pt) formal←c0738 ) = vector←v15988;
   return;
   }

static void CrossProduct←P3840(formal←c0742, v1←v16048, v2←v16076)
   word formal←c0742;
   W3 v1←v16048;
   W3 v2←v16076;
   {
   W3 prodV←v16120;
   /* CrossProduct: */ 
SOURCE(41484, 190)
SOURCE(41562, 36)
   {
      word x320;
      word x321;
      word x322;
      word x323;
      *(float*)&prodV←v16120.f0 = ((
         x320 = v1←v16048.f1,  *(float*)&x320
         ) * (
         x321 = v2←v16076.f2,  *(float*)&x321
         )) - ((
         x322 = v1←v16048.f2,  *(float*)&x322
         ) * (
         x323 = v2←v16076.f1,  *(float*)&x323
         ));
      };
SOURCE(41600, 36)
   {
      word x324;
      word x325;
      word x326;
      word x327;
      *(float*)&prodV←v16120.f1 = ((
         x324 = v1←v16048.f2,  *(float*)&x324
         ) * (
         x325 = v2←v16076.f0,  *(float*)&x325
         )) - ((
         x326 = v1←v16048.f0,  *(float*)&x326
         ) * (
         x327 = v2←v16076.f2,  *(float*)&x327
         ));
      };
SOURCE(41638, 36)
   {
      word x328;
      word x329;
      word x330;
      word x331;
      *(float*)&prodV←v16120.f2 = ((
         x328 = v1←v16048.f0,  *(float*)&x328
         ) * (
         x329 = v2←v16076.f1,  *(float*)&x329
         )) - ((
         x330 = v1←v16048.f1,  *(float*)&x330
         ) * (
         x331 = v2←v16076.f0,  *(float*)&x331
         ));
      };
   /* removed tail goto */ 
   (*  (W3Pt) formal←c0742 ) = prodV←v16120;
   return;
   }

static word GetPartialArea←P3900(pt1←v16180, pt2←v16208)
   W2 pt1←v16180;
   W2 pt2←v16208;
   {
   word partial←v16252;
   W3 D1←v26760;
   W3 D2←v26788;
   W3 areaVector←v26816;
   /* GetPartialArea: */ 
SOURCE(41680, 242)
SOURCE(41754, 33)
   (void) PointToVector←P3780((word) &D1←v26760, pt1←v16180);
SOURCE(41789, 33)
   (void) PointToVector←P3780((word) &D2←v26788, pt2←v16208);
SOURCE(41824, 43)
   (void) CrossProduct←P3840((word) &areaVector←v26816, D2←v26788, D1←v26760);
SOURCE(41900, 22)
   return(areaVector←v26816.f2);
   }

static word SignedArea←P3960(slice←v16312)
   word slice←v16312;
   {
   word area←v16356;
   W2 lastPoint←v26860;
   W2 thisPoint←v26888;
   word hiSeg←v26916;
   word thisSeg←v26944 = 0;
   /* SignedArea: */ 
SOURCE(41928, 577)
SOURCE(41928, 577)
   area←v16356 = (*  (ptr) &fc224 );
SOURCE(41991, 53)
   (void) FetchJointPos←P1920((word) &lastPoint←v26860, slice←v16312, 0);
   thisPoint←v26888 = lastPoint←v26860;
SOURCE(42046, 29)
   hiSeg←v26916 = (word) HiSegment←P2220(slice←v16312);
SOURCE(42095, 410)
   {
      register word index←v26988 = 0;
      register word noName←c67772;
      noName←c67772 = hiSeg←v26916;
      if ((index←v26988 > noName←c67772)) {
         goto lab←L100111;
         };
      lab←L100114: ;
SOURCE(42127, 36)
      thisSeg←v26944 = (word) FetchSegment←P1740(slice←v16312, index←v26988);
SOURCE(42165, 194)
      {
         register word cpIndex←v27032 = 0;
         register word noName←c67804;
         {
            word pd332;
            pd332 = (* (( (ptr) (*  (ptr) thisSeg←v26944 ))+17) );
            noName←c67804 = (word) ( *( (fPt) ((*  (ptr) pd332 ))))(thisSeg←v26944, pd332);
            };
         if ((cpIndex←v27032 >= noName←c67804)) {
            goto lab←L100115;
            };
         lab←L100118: ;
SOURCE(42234, 102)
         {
            W2 var←c67836;
            word var←c0999;
            {
               W2 var←c67868;
               {
                  word pd333;
                  pd333 = (* (( (ptr) (*  (ptr) thisSeg←v26944 ))+16) );
                  (void) ( *( (fPt) ((*  (ptr) pd333 ))))((word) &var←c67868, thisSeg←v26944, cpIndex←v27032, pd333);
                  };
               thisPoint←v26888 = var←c67868;
               var←c67836 = var←c67868;
               };
            var←c0999 = (word) GetPartialArea←P3900(lastPoint←v26860, var←c67836);
            {
               word x334;
               word x335;
               *(float*)&area←v16356 = (
                  x334 = area←v16356,  *(float*)&x334
                  ) + (
                  x335 = var←c0999,  *(float*)&x335
                  );
               };
            };
SOURCE(42338, 21)
         lastPoint←v26860 = thisPoint←v26888;
         cpIndex←v27032 = (cpIndex←v27032 + 1);
         if ((cpIndex←v27032 < noName←c67804)) {
            goto lab←L100118;
            };
         lab←L100115: ;
         };
SOURCE(42370, 111)
      {
         W2 var←c67900;
         word var←c01000;
         {
            W2 var←c67932;
            (void) FetchJointPos←P1920((word) &var←c67932, slice←v16312,  ( (index←v26988 == hiSeg←v26916) ? 0 : (index←v26988 + 1) ) )
            ;
            thisPoint←v26888 = var←c67932;
            var←c67900 = var←c67932;
            };
         var←c01000 = (word) GetPartialArea←P3900(lastPoint←v26860, var←c67900);
         {
            word x336;
            word x337;
            *(float*)&area←v16356 = (
               x336 = area←v16356,  *(float*)&x336
               ) + (
               x337 = var←c01000,  *(float*)&x337
               );
            };
         };
SOURCE(42484, 21)
      lastPoint←v26860 = thisPoint←v26888;
      if ((index←v26988 >= noName←c67772)) {
         goto lab←L100111;
         };
      index←v26988 = (index←v26988 + 1);
      goto lab←L100114;
      lab←L100111: ;
      };
SOURCE(41928, 577)
   return(area←v16356);
   }

static word SignedAreaTransformSeq←P4020(descriptor←v16416, transform←v16444)
   word descriptor←v16416;
   word transform←v16444;
   {
   register ptr gf←c71228 =  (ptr) &globalframe;
   word area←v16488;
   W2 lastPoint←v27076;
   W2 thisPoint←v27104;
   word trajParts←v27132;
   word hiSeg←v27160;
   word thisSeg←v27188 = 0;
   /* SignedAreaTransformSeq: */ 
SOURCE(42541, 1109)
SOURCE(42541, 1109)
   area←v16488 = (*  (ptr) &fc224 );
SOURCE(42708, 47)
   trajParts←v27132 = XR←Narrow((* (( (ptr) descriptor←v16416)+1) ), (* (( (ptr) gf←c71228)+18) ));
SOURCE(42757, 40)
   hiSeg←v27160 = (word) HiSegment←P2220((*  (ptr) (descriptor←v16416) ));
   {
      word var←c67964;
SOURCE(42817, 46)
      (void) FetchJointPos←P1920((word) &lastPoint←v27076, (*  (ptr) descriptor←v16416 ), 0);
SOURCE(42865, 92)
      {
         word limit338;
         var←c67964 = (* (( (ptr) trajParts←v27132)+1) );
         if (XR←ExtractField(var←c67964, 32 + (word) (
               limit338 = (*  (ptr) var←c67964 ),
               BCK(0, limit338)
               ), 1)) {
SOURCE(42893, 64)
            {
               word pd339;
               pd339 = (* (( (ptr) (* (( (ptr) gf←c71228)+198)/* var←c66076 */  ))+39) );
               (void) ( *( (fPt) ((*  (ptr) pd339 ))))((word) &lastPoint←v27076, transform←v16444, lastPoint←v27076, pd339);
               };
            };
         };
SOURCE(42959, 691)
      {
         register word index←v27232 = 0;
         register word noName←c67996;
         noName←c67996 = hiSeg←v27160;
         if ((index←v27232 > noName←c67996)) {
            goto lab←L100119;
            };
         lab←L100122: ;
         {
            word var←c68124;
            word var←c68156;
SOURCE(42991, 47)
            thisSeg←v27188 = (word) FetchSegment←P1740((*  (ptr) descriptor←v16416 ), index←v27232);
SOURCE(43040, 317)
            {
               register word cpIndex←v27276 = 0;
               register word noName←c68028;
               {
                  word pd340;
                  pd340 = (* (( (ptr) (*  (ptr) thisSeg←v27188 ))+17) );
                  noName←c68028 = (word) ( *( (fPt) ((*  (ptr) pd340 ))))(thisSeg←v27188, pd340);
                  };
               if ((cpIndex←v27276 >= noName←c68028)) {
                  goto lab←L100123;
                  };
               lab←L100126: ;
               {
                  word var←c68092;
SOURCE(43109, 59)
                  {
                     word pd341;
                     pd341 = (* (( (ptr) (*  (ptr) thisSeg←v27188 ))+16) );
                     (void) ( *( (fPt) ((*  (ptr) pd341 ))))((word) &thisPoint←v27104, thisSeg←v27188, cpIndex←v27276, pd341);
                     };
SOURCE(43170, 112)
                  {
                     word limit343;
                     {
                        word var←c68060;
                        var←c68060 = (* (( (ptr) trajParts←v27132)+2) );
                        {
                           word limit342;
                           var←c68092 = (* ((( (ptr) var←c68060)+1)+(
/*1*/      limit342 = (*  (ptr) var←c68060 ),
/*1*/      BCK(index←v27232, limit342)
/*1*/      )) );
                           };
                        };
                     if (XR←ExtractField(var←c68092, 32 + (word) (
                           limit343 = (*  (ptr) var←c68092 ),
                           BCK(cpIndex←v27276, limit343)
                           ), 1)) {
SOURCE(43218, 64)
                        {
                           word pd344;
                           pd344 = (* (( (ptr) (* (( (ptr) gf←c71228)+198)/* var←c66076 */  ))+39) );
                           (void) ( *( (fPt) ((*  (ptr) pd344 ))))((word) &thisPoint←v27104, transform←v16444, thisPoint←v27104, pd344);
                           };
                        };
                     };
SOURCE(43284, 50)
                  {
                     word x345;
                     word x346;
                     *(float*)&area←v16488 = (
                        x345 = area←v16488,  *(float*)&x345
                        ) + (
                        x346 = (word) GetPartialArea←P3900(lastPoint←v27076, thisPoint←v27104),  *(float*)&x346
                        );
                     };
SOURCE(43336, 21)
                  lastPoint←v27076 = thisPoint←v27104;
                  };
               cpIndex←v27276 = (cpIndex←v27276 + 1);
               if ((cpIndex←v27276 < noName←c68028)) {
                  goto lab←L100126;
                  };
               lab←L100123: ;
               };
SOURCE(43368, 79)
            (void) FetchJointPos←P1920((word) &thisPoint←v27104, (*  (ptr) descriptor←v16416 ),  ( (index←v27232 == hiSeg←v27160) ? 0 : (index←v27232 + 
               1) ) );
SOURCE(43449, 125)
            {
               word limit347;
               var←c68124 =  ( (index←v27232 == hiSeg←v27160) ? 0 : (index←v27232 + 1) ) ;
               var←c68156 = (* (( (ptr) trajParts←v27132)+1) );
               if (XR←ExtractField(var←c68156, 32 + (word) (
                     limit347 = (*  (ptr) var←c68156 ),
                     BCK(var←c68124, limit347)
                     ), 1)) {
SOURCE(43510, 64)
                  {
                     word pd348;
                     pd348 = (* (( (ptr) (* (( (ptr) gf←c71228)+198)/* var←c66076 */  ))+39) );
                     (void) ( *( (fPt) ((*  (ptr) pd348 ))))((word) &thisPoint←v27104, transform←v16444, thisPoint←v27104, pd348);
                     };
                  };
               };
SOURCE(43576, 50)
            {
               word x349;
               word x350;
               *(float*)&area←v16488 = (
                  x349 = area←v16488,  *(float*)&x349
                  ) + (
                  x350 = (word) GetPartialArea←P3900(lastPoint←v27076, thisPoint←v27104),  *(float*)&x350
                  );
               };
SOURCE(43629, 21)
            lastPoint←v27076 = thisPoint←v27104;
            };
         if ((index←v27232 >= noName←c67996)) {
            goto lab←L100119;
            };
         index←v27232 = (index←v27232 + 1);
         goto lab←L100122;
         lab←L100119: ;
         };
      };
SOURCE(42541, 1109)
   return(area←v16488);
   }

static word OnlyChild←P4080(slice←v16548)
   word slice←v16548;
   {
   register ptr gf←c71260 =  (ptr) &globalframe;
   word var←c16592;
   word trajData←v27320;
   word outline←v27348;
   word outlineData←v27376;
   /* OnlyChild: */ 
SOURCE(43807, 254)
SOURCE(43864, 39)
   trajData←v27320 = XR←Narrow((* (( (ptr) slice←v16548)+1) ), (* (( (ptr) gf←c71260)+6) ));
SOURCE(43942, 29)
   outline←v27348 = (* (( (ptr) slice←v16548)+2) );
SOURCE(43973, 47)
   outlineData←v27376 = XR←Narrow((* (( (ptr) outline←v27348)+1) ), (* (( (ptr) gf←c71260)+17) ));
SOURCE(44022, 39)
   return( (unsigned) ((* (( (ptr) (* (( (ptr) outlineData←v27376)+4) ))+1) ) == 0));
   }

static void NearestSegment←P4140(formal←c0823, formal←c01025, descriptor←v16680, formal←c01026)
   word formal←c0823;
   W2 formal←c01025;
   word descriptor←v16680;
   word formal←c01026;
   {
   W18 var←c71292;
   /* declaration of testPoint←v16652 skipped */ 
   /* declaration of tolerance←v16708 skipped */ 
   register ptr gf←c71324 =  (ptr) &globalframe;
   word bestDist←v16752;
   /* declaration of bestSeg←v16780 skipped */ 
   /* declaration of bestPoint←v16808 skipped */ 
   W2 bestNormal←v16836;
   /* declaration of success←v16864 skipped */ 
   /* declaration of var←c68188 skipped */ 
   word traj←v27420;
   word trajData←v27448;
   word trajParts←v27476;
   /* declaration of thisDist2←v27504 skipped */ 
   /* declaration of bestDist2←v27532 skipped */ 
   /* declaration of thisPoint←v27560 skipped */ 
   /* declaration of thisSuccess←v27588 skipped */ 
   word tolerance2←v27616;
   (*  (W2Pt) (( (ptr) &var←c71292)+4)/* testPoint←v16652 */  ) = formal←c01025;
   (* (( (ptr) &var←c71292)+6)/* tolerance←v16708 */  ) = formal←c01026;
   /* NearestSegment: */ 
SOURCE(46129, 1641)
   {
      word tmpAddr351;
      tmpAddr351 = (word) (( (ptr) &var←c71292)+11)/* var←c68188 */ ;
      (*  (ptr) tmpAddr351 ) = ( ((word)  (fPt) ProcessSegment←P6756) );
      (* (( (ptr) tmpAddr351) + 1) ) = 1;
      };
SOURCE(46129, 1641)
   bestDist←v16752 = (*  (ptr) &fc224 );
SOURCE(46129, 1641)
   (* (( (ptr) &var←c71292)+7)/* bestSeg←v16780 */  ) = 0;
SOURCE(46129, 1641)
   (* (( (ptr) &var←c71292)+8) ) = (*  (ptr) &fc224 );
   (* (( (ptr) &var←c71292)+9) ) = (*  (ptr) &fc224 );
SOURCE(46129, 1641)
   bestNormal←v16836.f0 = (*  (ptr) &fc224 );
   bestNormal←v16836.f1 = (*  (ptr) &fc281 );
SOURCE(46129, 1641)
   (* (( (ptr) &var←c71292)+10)/* success←v16864 */  ) = 0;
SOURCE(46358, 30)
   traj←v27420 = (*  (ptr) descriptor←v16680 );
SOURCE(46390, 38)
   trajData←v27448 = XR←Narrow((* (( (ptr) traj←v27420)+1) ), (* (( (ptr) gf←c71324)+6) ));
SOURCE(46430, 47)
   trajParts←v27476 = XR←Narrow((* (( (ptr) descriptor←v16680)+1) ), (* (( (ptr) gf←c71324)+18) ));
SOURCE(46525, 25)
   (* (( (ptr) &var←c71292)+17)/* thisSuccess←v27588 */  ) = 0;
SOURCE(46552, 38)
   {
      word x352;
      word x353;
      *(float*)&tolerance2←v27616 = (
         x352 = (* (( (ptr) &var←c71292)+6)/* tolerance←v16708 */  ),  *(float*)&x352
         ) * (
         x353 = (* (( (ptr) &var←c71292)+6)/* tolerance←v16708 */  ),  *(float*)&x353
         );
      };
   {
      word var←c68220;
SOURCE(46939, 99)
      {
         word pd355;
         {
            word pd354;
            pd354 = (* (( (ptr) (* (( (ptr) gf←c71324)+192)/* var←c64092 */  ))+9) );
            var←c68220 = (word) ( *( (fPt) ((*  (ptr) pd354 ))))(traj←v27420, 0, pd354);
            };
         pd355 = (* (( (ptr) (* (( (ptr) gf←c71324)+185)/* var←c62652 */  ))+22) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd355 ))))((*  (W2Pt) (( (ptr) &var←c71292)+4)/* testPoint←v16652 */  ), var←c68220, (* (
               ( (ptr) &var←c71292)+6)/* tolerance←v16708 */  ), pd355))) {
SOURCE(47032, 6)
            goto lab←L100127;
            };
         };
SOURCE(47060, 20)
      bestDist←v16752 = (* (( (ptr) &var←c71292)+6)/* tolerance←v16708 */  );
SOURCE(47082, 22)
      (* (( (ptr) &var←c71292)+14)/* bestDist2←v27532 */  ) = tolerance2←v27616;
SOURCE(47106, 15)
      (* (( (ptr) &var←c71292)+7)/* bestSeg←v16780 */  ) = 7777;
SOURCE(47159, 24)
      (* (( (ptr) &var←c71292)+8) ) = (*  (ptr) &fc281 );
      (* (( (ptr) &var←c71292)+9) ) = (*  (ptr) &fc281 );
SOURCE(47185, 75)
      {
         word var←c68252;
         word pd356;
         pd356 = (* (( (ptr) (* (( (ptr) gf←c71324)+189)/* var←c63644 */  ))+43) );
         var←c68252 = (word) ( *( (fPt) ((*  (ptr) pd356 ))))(trajData←v27448, trajParts←v27476, (word) (( (bPt) &var←c71292)+44)/* var←c68188 */ , pd356)
         ;
         };
SOURCE(47263, 507)
      if ((0 != (* (( (ptr) &var←c71292)+10)/* success←v16864 */  ))) {
SOURCE(47279, 496)
         {
            W2 jointPoint←v27688;
            word diffX←v27716;
            word diffY←v27744;
SOURCE(47350, 34)
            {
               word pd357;
               pd357 = (* (( (ptr) (* (( (ptr) gf←c71324)+201)/* var←c66492 */  ))+9) );
               bestDist←v16752 = (word) ( *( (fPt) ((*  (ptr) pd357 ))))((* ((( (ptr) &var←c71292)+14)/* bestDist2←v27532 */ ) ), pd357)
               ;
               };
SOURCE(47386, 48)
            {
               word pd358;
               pd358 = (* (( (ptr) (* (( (ptr) gf←c71324)+188)/* var←c63004 */  ))+11) );
               (void) ( *( (fPt) ((*  (ptr) pd358 ))))((word) &bestNormal←v16836, (*  (W2Pt) (( (ptr) &var←c71292)+4)/* testPoint←v16652 */  ), (*  (W2Pt) (
                     ( (ptr) &var←c71292)+8)/* bestPoint←v16808 */  ), pd358);
               };
SOURCE(47436, 41)
            (void) FetchJointPos←P1920((word) &jointPoint←v27688, traj←v27420, (* (( (ptr) &var←c71292)+7)/* bestSeg←v16780 */  ));
SOURCE(47479, 39)
            {
               float tf359;
               word x360;
               word x361;
               float tf362;
               diffX←v27716 = (
                  tf362 = FABS(((
                        x360 = jointPoint←v27688.f0,  *(float*)&x360
                        ) - (
                        x361 = (* (( (ptr) &var←c71292)+8) ),  *(float*)&x361
                        )), tf359),  *(word*)&tf362
                  );
               };
SOURCE(47520, 39)
            {
               float tf363;
               word x364;
               word x365;
               float tf366;
               diffY←v27744 = (
                  tf366 = FABS(((
                        x364 = jointPoint←v27688.f1,  *(float*)&x364
                        ) - (
                        x365 = (* (( (ptr) &var←c71292)+9) ),  *(float*)&x365
                        )), tf363),  *(word*)&tf366
                  );
               };
SOURCE(47561, 209)
            {
               word x367;
               word x369;
               word x370;
               word x371;
               if ( (  ( ((*  (ptr) trajData←v27448 ) == 2) ? ((
                  x367 = diffX←v27716,  *(float*)&x367
                  ) < (
                  x369 = (*  (ptr) &fc368 ),  *(float*)&x369
                  )) : 0 )  ? ((
                  x370 = diffY←v27744,  *(float*)&x370
                  ) < (
                  x371 = (*  (ptr) &fc368 ),  *(float*)&x371
                  )) : 0 ) ) {
SOURCE(47624, 148)
                  {
                     word bestSegment←v27788;
                     W4 var←c0822;
SOURCE(47626, 50)
                     bestSegment←v27788 = (word) FetchSegment←P1740(traj←v27420, (* (( (ptr) &var←c71292)+7)/* bestSeg←v16780 */  ));
SOURCE(47678, 92)
                     {
                        word pd372;
                        pd372 = (* (( (ptr) (*  (ptr) bestSegment←v27788 ))+26) );
                        (void) ( *( (fPt) ((*  (ptr) pd372 ))))((word) &var←c0822, bestSegment←v27788, jointPoint←v27688, (*  (W2Pt) (( (ptr) &var←c71292)+4)
                           /* testPoint←v16652 */  ), 0, pd372);
                        };
                     bestNormal←v16836 = (*  (W2Pt) &var←c0822 );
                     };
                  };
               };
            };
         };
      };
   /* removed tail goto */ 
   lab←L100127: ;
   (*  (ptr) formal←c0823 ) = bestDist←v16752;
   (* (( (ptr) formal←c0823)+1) ) = (* (( (ptr) &var←c71292)+7)/* bestSeg←v16780 */  );
   (*  (W2Pt) (( (ptr) formal←c0823)+2) ) = (*  (W2Pt) (( (ptr) &var←c71292)+8)/* bestPoint←v16808 */  );
   (*  (W2Pt) (( (ptr) formal←c0823)+4) ) = bestNormal←v16836;
   (* (( (ptr) formal←c0823)+6) ) = (* (( (ptr) &var←c71292)+10)/* success←v16864 */  );
   return;
   }

static word ProcessSegment←P6756(traj←v57492, seg←v57520, index←v57548, formal←c71388)
   word traj←v57492;
   word seg←v57520;
   word index←v57548;
   word formal←c71388;
   {
   register ptr gf←c71356 =  (ptr) &globalframe;
   word done←v57592;
   formal←c71388 = (formal←c71388 - 44);
   /* ProcessSegment: */ 
SOURCE(46592, 317)
SOURCE(46592, 317)
   done←v57592 = 0;
SOURCE(46639, 76)
   {
      W3 var←c68284;
      {
         word pd373;
         pd373 = (* (( (ptr) (*  (ptr) seg←v57520 ))+18) );
         (void) ( *( (fPt) ((*  (ptr) pd373 ))))((word) &var←c68284, seg←v57520, (*  (W2Pt) (( (ptr) formal←c71388)+4) ), (* (( (ptr) formal←c71388)+6)
             ), pd373);
         };
      (* (( (ptr) formal←c71388)+17) ) = var←c68284.f2;
      (*  (W2Pt) (( (ptr) formal←c71388)+15) ) = (*  (W2Pt) &var←c68284 );
      };
SOURCE(46717, 192)
   if ((0 != (* (( (ptr) formal←c71388)+17) ))) {
SOURCE(46739, 59)
      {
         word pd374;
         pd374 = (* (( (ptr) (* (( (ptr) gf←c71356)+188)/* var←c63004 */  ))+21) );
         (* (( (ptr) formal←c71388)+13) ) = (word) ( *( (fPt) ((*  (ptr) pd374 ))))((*  (W2Pt) (( (ptr) formal←c71388)+15) ), (*  (W2Pt) (
               ( (ptr) formal←c71388)+4) ), pd374);
         };
SOURCE(46800, 109)
      {
         word x375;
         word x376;
         if (((
            x375 = (* (( (ptr) formal←c71388)+13) ),  *(float*)&x375
            ) < (
            x376 = (* (( (ptr) formal←c71388)+14) ),  *(float*)&x376
            ))) {
SOURCE(46832, 21)
            (* (( (ptr) formal←c71388)+14) ) = (* (( (ptr) formal←c71388)+13) );
SOURCE(46855, 15)
            (* (( (ptr) formal←c71388)+7) ) = index←v57548;
SOURCE(46872, 21)
            (*  (W2Pt) (( (ptr) formal←c71388)+8) ) = (*  (W2Pt) (( (ptr) formal←c71388)+15) );
SOURCE(46895, 14)
            (* (( (ptr) formal←c71388)+10) ) = 1;
            };
         };
      };
SOURCE(46592, 317)
   return(done←v57592);
   }

static void NearestJoint←P4200(formal←c0862, formal←c01027, descriptor←v16952, tolerance←v16980)
   word formal←c0862;
   W2 formal←c01027;
   word descriptor←v16952;
   word tolerance←v16980;
   {
   W14 var←c71420;
   /* declaration of testPoint←v16924 skipped */ 
   register ptr gf←c71452 =  (ptr) &globalframe;
   word bestDist←v17024;
   /* declaration of bestJoint←v17052 skipped */ 
   /* declaration of bestPoint←v17080 skipped */ 
   W2 bestNormal←v17108;
   /* declaration of success←v17136 skipped */ 
   /* declaration of var←c68316 skipped */ 
   word traj←v27832;
   word trajData←v27860;
   word trajParts←v27888;
   word tolerance2←v27916;
   /* declaration of thisDist2←v27944 skipped */ 
   /* declaration of bestDist2←v27972 skipped */ 
   word seg1←v28000 = 0;
   word seg2←v28028 = 0;
   W2 normal1←v28056;
   W2 normal2←v28084;
   W2 tangent1←v28112;
   W2 tangent2←v28140;
   W2 direction←v28168;
   (*  (W2Pt) (( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ) = formal←c01027;
   /* NearestJoint: */ 
SOURCE(47782, 1984)
   {
      word tmpAddr377;
      tmpAddr377 = (word) (( (ptr) &var←c71420)+10)/* var←c68316 */ ;
      (*  (ptr) tmpAddr377 ) = ( ((word)  (fPt) ProcessJoint←P6912) );
      (* (( (ptr) tmpAddr377) + 1) ) = 1;
      };
SOURCE(47782, 1984)
   bestDist←v17024 = (*  (ptr) &fc224 );
SOURCE(47782, 1984)
   (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  ) = 0;
SOURCE(47782, 1984)
   (* (( (ptr) &var←c71420)+7) ) = (*  (ptr) &fc224 );
   (* (( (ptr) &var←c71420)+8) ) = (*  (ptr) &fc224 );
SOURCE(47782, 1984)
   bestNormal←v17108.f0 = (*  (ptr) &fc224 );
   bestNormal←v17108.f1 = (*  (ptr) &fc281 );
SOURCE(47782, 1984)
   (* (( (ptr) &var←c71420)+9)/* success←v17136 */  ) = 0;
SOURCE(48011, 30)
   traj←v27832 = (*  (ptr) descriptor←v16952 );
SOURCE(48043, 38)
   trajData←v27860 = XR←Narrow((* (( (ptr) traj←v27832)+1) ), (* (( (ptr) gf←c71452)+6) ));
SOURCE(48083, 47)
   trajParts←v27888 = XR←Narrow((* (( (ptr) descriptor←v16952)+1) ), (* (( (ptr) gf←c71452)+18) ));
SOURCE(48132, 38)
   {
      word x378;
      word x379;
      *(float*)&tolerance2←v27916 = (
         x378 = tolerance←v16980,  *(float*)&x378
         ) * (
         x379 = tolerance←v16980,  *(float*)&x379
         );
      };
   {
      word var←c68348;
SOURCE(48572, 99)
      {
         word pd381;
         {
            word pd380;
            pd380 = (* (( (ptr) (* (( (ptr) gf←c71452)+192)/* var←c64092 */  ))+9) );
            var←c68348 = (word) ( *( (fPt) ((*  (ptr) pd380 ))))(traj←v27832, 0, pd380);
            };
         pd381 = (* (( (ptr) (* (( (ptr) gf←c71452)+185)/* var←c62652 */  ))+22) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd381 ))))((*  (W2Pt) (( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), var←c68348, tolerance←v16980, pd381)
         )) {
SOURCE(48665, 6)
            goto lab←L100128;
            };
         };
SOURCE(48693, 20)
      bestDist←v17024 = tolerance←v16980;
SOURCE(48715, 22)
      (* (( (ptr) &var←c71420)+13)/* bestDist2←v27972 */  ) = tolerance2←v27916;
SOURCE(48739, 19)
      (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  ) = 9999;
SOURCE(48760, 24)
      (* (( (ptr) &var←c71420)+7) ) = (*  (ptr) &fc281 );
      (* (( (ptr) &var←c71420)+8) ) = (*  (ptr) &fc281 );
SOURCE(48786, 74)
      {
         word pd382;
         pd382 = (* (( (ptr) (* (( (ptr) gf←c71452)+189)/* var←c63644 */  ))+55) );
         (void) ( *( (fPt) ((*  (ptr) pd382 ))))(trajData←v27860, trajParts←v27888, (word) (( (bPt) &var←c71420)+40)/* var←c68316 */ , pd382)
         ;
         };
SOURCE(48863, 903)
      if ((0 != (* (( (ptr) &var←c71420)+9)/* success←v17136 */  ))) {
SOURCE(48903, 34)
         {
            word pd383;
            pd383 = (* (( (ptr) (* (( (ptr) gf←c71452)+201)/* var←c66492 */  ))+9) );
            bestDist←v17024 = (word) ( *( (fPt) ((*  (ptr) pd383 ))))((* ((( (ptr) &var←c71420)+13)/* bestDist2←v27972 */ ) ), pd383)
            ;
            };
SOURCE(48939, 145)
         if (((word) HiSegment←P2220(traj←v27832) < (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  ))) {
SOURCE(48975, 73)
            if (((*  (ptr) trajData←v27860 ) == 2)) {
               seg2←v28028 = 0;
               }
            else {
               seg2←v28028 = (word) FetchSegment←P1740(traj←v27832, 0);
               };
            }
         else {
SOURCE(49048, 36)
            seg2←v28028 = (word) FetchSegment←P1740(traj←v27832, (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  ));
            };
SOURCE(49086, 39)
         seg1←v28000 = (word) PreviousSegment←P2460(traj←v27832, (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  ));
SOURCE(49127, 639)
         if ( ( (seg1←v28000 != 0) ? (seg2←v28028 != 0) : 0 ) ) {
SOURCE(49163, 80)
            {
               W4 var←c68380;
               {
                  word pd384;
                  pd384 = (* (( (ptr) (*  (ptr) seg2←v28028 ))+26) );
                  (void) ( *( (fPt) ((*  (ptr) pd384 ))))((word) &var←c68380, seg2←v28028, (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  ), (*  (W2Pt) (
                        ( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), 0, pd384);
                  };
               tangent2←v28140 = (*  (W2Pt) (( (ptr) &var←c68380)+2) );
               normal2←v28084 = (*  (W2Pt) &var←c68380 );
               };
SOURCE(49245, 78)
            {
               W4 var←c68412;
               {
                  word pd385;
                  pd385 = (* (( (ptr) (*  (ptr) seg1←v28000 ))+26) );
                  (void) ( *( (fPt) ((*  (ptr) pd385 ))))((word) &var←c68412, seg1←v28000, (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  ), (*  (W2Pt) (
                        ( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), 1, pd385);
                  };
               tangent1←v28112 = (*  (W2Pt) (( (ptr) &var←c68412)+2) );
               normal1←v28056 = (*  (W2Pt) &var←c68412 );
               };
SOURCE(49325, 60)
            {
               word pd386;
               pd386 = (* (( (ptr) (* (( (ptr) gf←c71452)+188)/* var←c63004 */  ))+22) );
               (void) ( *( (fPt) ((*  (ptr) pd386 ))))((word) &direction←v28168, (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  ), (*  (W2Pt) (
                     ( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), pd386);
               };
SOURCE(49387, 173)
            {
               float tf387;
               word pd388;
               word x389;
               float tf390;
               word pd391;
               word x392;
               pd388 = (* (( (ptr) (* (( (ptr) gf←c71452)+188)/* var←c63004 */  ))+9) );
               pd391 = (* (( (ptr) (* (( (ptr) gf←c71452)+188)/* var←c63004 */  ))+9) );
               if ((FABS((
                     x389 = (word) ( *( (fPt) ((*  (ptr) pd388 ))))(tangent1←v28112, direction←v28168, pd388),  *(float*)&x389
                     ), tf387) < FABS((
                     x392 = (word) ( *( (fPt) ((*  (ptr) pd391 ))))(tangent2←v28140, direction←v28168, pd391),  *(float*)&x392
                     ), tf390))) {
                  bestNormal←v17108 = normal1←v28056;
                  }
               else {
                  bestNormal←v17108 = normal2←v28084;
                  };
               };
            }
         else {
SOURCE(49571, 96)
            if ((seg1←v28000 != 0)) {
SOURCE(49590, 77)
               {
                  W4 var←c68444;
                  {
                     word pd393;
                     pd393 = (* (( (ptr) (*  (ptr) seg1←v28000 ))+26) );
                     (void) ( *( (fPt) ((*  (ptr) pd393 ))))((word) &var←c68444, seg1←v28000, (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  ), (*  (W2Pt) (
                           ( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), 1, pd393);
                     };
                  bestNormal←v17108 = (*  (W2Pt) &var←c68444 );
                  };
               };
SOURCE(49669, 97)
            if ((seg2←v28028 != 0)) {
SOURCE(49688, 78)
               {
                  W4 var←c68476;
                  {
                     word pd394;
                     pd394 = (* (( (ptr) (*  (ptr) seg2←v28028 ))+26) );
                     (void) ( *( (fPt) ((*  (ptr) pd394 ))))((word) &var←c68476, seg2←v28028, (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  ), (*  (W2Pt) (
                           ( (ptr) &var←c71420)+4)/* testPoint←v16924 */  ), 0, pd394);
                     };
                  bestNormal←v17108 = (*  (W2Pt) &var←c68476 );
                  };
               };
            };
         };
      };
   /* removed tail goto */ 
   lab←L100128: ;
   (*  (ptr) formal←c0862 ) = bestDist←v17024;
   (* (( (ptr) formal←c0862)+1) ) = (* (( (ptr) &var←c71420)+6)/* bestJoint←v17052 */  );
   (*  (W2Pt) (( (ptr) formal←c0862)+2) ) = (*  (W2Pt) (( (ptr) &var←c71420)+7)/* bestPoint←v17080 */  );
   (*  (W2Pt) (( (ptr) formal←c0862)+4) ) = bestNormal←v17108;
   (* (( (ptr) formal←c0862)+6) ) = (* (( (ptr) &var←c71420)+9)/* success←v17136 */  );
   return;
   }

static word ProcessJoint←P6912(traj←v28272, jointPos←v28300, index←v28328, formal←c71516)
   word traj←v28272;
   W2 jointPos←v28300;
   word index←v28328;
   word formal←c71516;
   {
   register ptr gf←c71484 =  (ptr) &globalframe;
   word done←v28372;
   formal←c71516 = (formal←c71516 - 40);
   /* ProcessJoint: */ 
SOURCE(48278, 268)
SOURCE(48278, 268)
   done←v28372 = 0;
SOURCE(48376, 58)
   {
      word pd395;
      pd395 = (* (( (ptr) (* (( (ptr) gf←c71484)+188)/* var←c63004 */  ))+21) );
      (* (( (ptr) formal←c71516)+12) ) = (word) ( *( (fPt) ((*  (ptr) pd395 ))))(jointPos←v28300, (*  (W2Pt) (( (ptr) formal←c71516)+4)
          ), pd395);
      };
SOURCE(48436, 110)
   {
      word x396;
      word x397;
      if (((
         x396 = (* (( (ptr) formal←c71516)+12) ),  *(float*)&x396
         ) < (
         x397 = (* (( (ptr) formal←c71516)+13) ),  *(float*)&x397
         ))) {
SOURCE(48468, 21)
         (* (( (ptr) formal←c71516)+13) ) = (* (( (ptr) formal←c71516)+12) );
SOURCE(48491, 17)
         (* (( (ptr) formal←c71516)+6) ) = index←v28328;
SOURCE(48510, 20)
         (*  (W2Pt) (( (ptr) formal←c71516)+7) ) = jointPos←v28300;
SOURCE(48532, 14)
         (* (( (ptr) formal←c71516)+9) ) = 1;
         };
      };
SOURCE(48278, 268)
   return(done←v28372);
   }

static void NearestControlPoint←P4260(formal←c0890, formal←c01028, descriptor←v17224, formal←c01029)
   word formal←c0890;
   W2 formal←c01028;
   word descriptor←v17224;
   word formal←c01029;
   {
   W27 var←c71548;
   /* declaration of testPoint←v17196 skipped */ 
   /* declaration of tolerance←v17252 skipped */ 
   register ptr gf←c71580 =  (ptr) &globalframe;
   word bestDist←v17296;
   /* declaration of bestSeg←v17324 skipped */ 
   /* declaration of bestControlPoint←v17352 skipped */ 
   /* declaration of bestPoint←v17380 skipped */ 
   /* declaration of bestNormal←v17408 skipped */ 
   /* declaration of success←v17436 skipped */ 
   /* declaration of var←c68508 skipped */ 
   /* declaration of var←c68540 skipped */ 
   word traj←v28428;
   word trajData←v28456;
   /* declaration of trajParts←v28484 skipped */ 
   word tolerance2←v28512;
   /* declaration of thisDist2←v28540 skipped */ 
   /* declaration of bestDist2←v28568 skipped */ 
   /* declaration of thisControlPoint←v28596 skipped */ 
   /* declaration of thisPoint←v28624 skipped */ 
   /* declaration of thisNormal←v28652 skipped */ 
   /* declaration of thisSuccess←v28680 skipped */ 
   (*  (W2Pt) (( (ptr) &var←c71548)+4)/* testPoint←v17196 */  ) = formal←c01028;
   (* (( (ptr) &var←c71548)+6)/* tolerance←v17252 */  ) = formal←c01029;
   /* NearestControlPoint: */ 
SOURCE(49778, 1657)
   {
      word tmpAddr398;
      tmpAddr398 = (word) (( (ptr) &var←c71548)+14)/* var←c68508 */ ;
      (*  (ptr) tmpAddr398 ) = ( ((word)  (fPt) ProcessSegment←P7032) );
      (* (( (ptr) tmpAddr398) + 1) ) = 1;
      };
   {
      word tmpAddr399;
      tmpAddr399 = (word) (( (ptr) &var←c71548)+16)/* var←c68540 */ ;
      (*  (ptr) tmpAddr399 ) = ( ((word)  (fPt) SomeCP←P6972) );
      (* (( (ptr) tmpAddr399) + 1) ) = 1;
      };
SOURCE(49778, 1657)
   bestDist←v17296 = (*  (ptr) &fc224 );
SOURCE(49778, 1657)
   (* (( (ptr) &var←c71548)+7)/* bestSeg←v17324 */  ) = 0;
SOURCE(49778, 1657)
   (* (( (ptr) &var←c71548)+8)/* bestControlPoint←v17352 */  ) = 0;
SOURCE(49778, 1657)
   (* (( (ptr) &var←c71548)+9) ) = (*  (ptr) &fc224 );
   (* (( (ptr) &var←c71548)+10) ) = (*  (ptr) &fc224 );
SOURCE(49778, 1657)
   (* (( (ptr) &var←c71548)+11) ) = (*  (ptr) &fc224 );
   (* (( (ptr) &var←c71548)+12) ) = (*  (ptr) &fc281 );
SOURCE(49778, 1657)
   (* (( (ptr) &var←c71548)+13)/* success←v17436 */  ) = 0;
SOURCE(50236, 30)
   traj←v28428 = (*  (ptr) descriptor←v17224 );
SOURCE(50268, 38)
   trajData←v28456 = XR←Narrow((* (( (ptr) traj←v28428)+1) ), (* (( (ptr) gf←c71580)+6) ));
SOURCE(50308, 47)
   (* (( (ptr) &var←c71548)+18)/* trajParts←v28484 */  ) = XR←Narrow((* (( (ptr) descriptor←v17224)+1) ), (* (( (ptr) gf←c71580)+18)
       ));
SOURCE(50357, 38)
   {
      word x400;
      word x401;
      *(float*)&tolerance2←v28512 = (
         x400 = (* (( (ptr) &var←c71548)+6)/* tolerance←v17252 */  ),  *(float*)&x400
         ) * (
         x401 = (* (( (ptr) &var←c71548)+6)/* tolerance←v17252 */  ),  *(float*)&x401
         );
      };
SOURCE(50486, 25)
   (* (( (ptr) &var←c71548)+26)/* thisSuccess←v28680 */  ) = 0;
   {
      word var←c68572;
SOURCE(51042, 99)
      {
         word pd403;
         {
            word pd402;
            pd402 = (* (( (ptr) (* (( (ptr) gf←c71580)+192)/* var←c64092 */  ))+9) );
            var←c68572 = (word) ( *( (fPt) ((*  (ptr) pd402 ))))(traj←v28428, 0, pd402);
            };
         pd403 = (* (( (ptr) (* (( (ptr) gf←c71580)+185)/* var←c62652 */  ))+22) );
         if ((0 == (word) ( *( (fPt) ((*  (ptr) pd403 ))))((*  (W2Pt) (( (ptr) &var←c71548)+4)/* testPoint←v17196 */  ), var←c68572, (* (
               ( (ptr) &var←c71548)+6)/* tolerance←v17252 */  ), pd403))) {
SOURCE(51135, 6)
            goto lab←L100129;
            };
         };
SOURCE(51163, 20)
      bestDist←v17296 = (* (( (ptr) &var←c71548)+6)/* tolerance←v17252 */  );
SOURCE(51185, 22)
      (* (( (ptr) &var←c71548)+20)/* bestDist2←v28568 */  ) = tolerance2←v28512;
SOURCE(51209, 15)
      (* (( (ptr) &var←c71548)+7)/* bestSeg←v17324 */  ) = 7777;
SOURCE(51226, 23)
      (* (( (ptr) &var←c71548)+8)/* bestControlPoint←v17352 */  ) = 8888;
SOURCE(51282, 24)
      (* (( (ptr) &var←c71548)+9) ) = (*  (ptr) &fc281 );
      (* (( (ptr) &var←c71548)+10) ) = (*  (ptr) &fc281 );
SOURCE(51308, 75)
      {
         word var←c68604;
         word pd404;
         pd404 = (* (( (ptr) (* (( (ptr) gf←c71580)+189)/* var←c63644 */  ))+43) );
         var←c68604 = (word) ( *( (fPt) ((*  (ptr) pd404 ))))(trajData←v28456, (* (( (ptr) &var←c71548)+18)/* trajParts←v28484 */  ), (word) (
               ( (bPt) &var←c71548)+56)/* var←c68508 */ , pd404);
         };
SOURCE(51385, 50)
      if ((0 != (* (( (ptr) &var←c71548)+13)/* success←v17436 */  ))) {
SOURCE(51401, 34)
         {
            word pd405;
            pd405 = (* (( (ptr) (* (( (ptr) gf←c71580)+201)/* var←c66492 */  ))+9) );
            bestDist←v17296 = (word) ( *( (fPt) ((*  (ptr) pd405 ))))((* ((( (ptr) &var←c71548)+20)/* bestDist2←v28568 */ ) ), pd405)
            ;
            };
         };
      };
   /* removed tail goto */ 
   lab←L100129: ;
   (*  (ptr) formal←c0890 ) = bestDist←v17296;
   (* (( (ptr) formal←c0890)+1) ) = (* (( (ptr) &var←c71548)+7)/* bestSeg←v17324 */  );
   (* (( (ptr) formal←c0890)+2) ) = (* (( (ptr) &var←c71548)+8)/* bestControlPoint←v17352 */  );
   (*  (W2Pt) (( (ptr) formal←c0890)+3) ) = (*  (W2Pt) (( (ptr) &var←c71548)+9)/* bestPoint←v17380 */  );
   (*  (W2Pt) (( (ptr) formal←c0890)+5) ) = (*  (W2Pt) (( (ptr) &var←c71548)+11)/* bestNormal←v17408 */  );
   (* (( (ptr) formal←c0890)+7) ) = (* (( (ptr) &var←c71548)+13)/* success←v17436 */  );
   return;
   }

static word SomeCP←P6972(i←v28784, formal←c71612)
   word i←v28784;
   word formal←c71612;
   {
   word var←c28828;
   word cpCount←v29016;
   word var←c68636;
   formal←c71612 = (formal←c71612 - 64);
   /* SomeCP: */ 
SOURCE(50039, 192)
SOURCE(50080, 45)
   {
      word limit406;
      var←c68636 = (* (( (ptr) (* (( (ptr) formal←c71612)+18) ))+2) );
      cpCount←v29016 = (*  (ptr) (* ((( (ptr) var←c68636)+1)+(
            limit406 = (*  (ptr) var←c68636 ),
            BCK(i←v28784, limit406)
            )) ) );
      };
SOURCE(50127, 80)
   {
      register word j←v29060 = 0;
      register word noName←c68668;
      word var←c68732;
      noName←c68668 = cpCount←v29016;
      if ((j←v29060 >= noName←c68668)) {
         goto lab←L100130;
         };
      lab←L100133: ;
SOURCE(50157, 50)
      {
         word limit408;
         {
            word var←c68700;
            var←c68700 = (* (( (ptr) (* (( (ptr) formal←c71612)+18) ))+2) );
            {
               word limit407;
               var←c68732 = (* ((( (ptr) var←c68700)+1)+(
                     limit407 = (*  (ptr) var←c68700 ),
                     BCK(i←v28784, limit407)
                     )) );
               };
            };
         if (XR←ExtractField(var←c68732, 32 + (word) (
               limit408 = (*  (ptr) var←c68732 ),
               BCK(j←v29060, limit408)
               ), 1)) {
SOURCE(50195, 12)
            return(1);
            };
         };
      j←v29060 = (j←v29060 + 1);
      if ((j←v29060 < noName←c68668)) {
         goto lab←L100133;
         };
      lab←L100130: ;
      };
SOURCE(50218, 13)
   return(0);
   }

static word ProcessSegment←P7032(traj←v28888, seg←v28916, index←v28944, formal←c71676)
   word traj←v28888;
   word seg←v28916;
   word index←v28944;
   word formal←c71676;
   {
   register ptr gf←c71644 =  (ptr) &globalframe;
   word done←v28988;
   formal←c71676 = (formal←c71676 - 56);
   /* ProcessSegment: */ 
SOURCE(50513, 500)
SOURCE(50513, 500)
   done←v28988 = 0;
SOURCE(50610, 32)
   if ((0 == (word) SomeCP←P6972(index←v28944, (word) (( (bPt) formal←c71676)+64)))) {
SOURCE(50636, 6)
      return(done←v28988);
      };
SOURCE(50644, 113)
   {
      W6 var←c68764;
      {
         word pd409;
         pd409 = (* (( (ptr) (*  (ptr) seg←v28916 ))+19) );
         (void) ( *( (fPt) ((*  (ptr) pd409 ))))((word) &var←c68764, seg←v28916, (*  (W2Pt) (( (ptr) formal←c71676)+4) ), (* (( (ptr) formal←c71676)+6)
             ), pd409);
         };
      (* (( (ptr) formal←c71676)+26) ) = var←c68764.f5;
      (* (( (ptr) formal←c71676)+21) ) = var←c68764.f4;
      (*  (W2Pt) (( (ptr) formal←c71676)+24) ) = (*  (W2Pt) (( (ptr) &var←c68764)+2) );
      (*  (W2Pt) (( (ptr) formal←c71676)+22) ) = (*  (W2Pt) &var←c68764 );
      };
SOURCE(50759, 254)
   if ((0 != (* (( (ptr) formal←c71676)+26) ))) {
SOURCE(50781, 59)
      {
         word pd410;
         pd410 = (* (( (ptr) (* (( (ptr) gf←c71644)+188)/* var←c63004 */  ))+21) );
         (* (( (ptr) formal←c71676)+19) ) = (word) ( *( (fPt) ((*  (ptr) pd410 ))))((*  (W2Pt) (( (ptr) formal←c71676)+22) ), (*  (W2Pt) (
               ( (ptr) formal←c71676)+4) ), pd410);
         };
SOURCE(50842, 171)
      {
         word x411;
         word x412;
         if (((
            x411 = (* (( (ptr) formal←c71676)+19) ),  *(float*)&x411
            ) < (
            x412 = (* (( (ptr) formal←c71676)+20) ),  *(float*)&x412
            ))) {
SOURCE(50874, 21)
            (* (( (ptr) formal←c71676)+20) ) = (* (( (ptr) formal←c71676)+19) );
SOURCE(50897, 15)
            (* (( (ptr) formal←c71676)+7) ) = index←v28944;
SOURCE(50914, 35)
            (* (( (ptr) formal←c71676)+8) ) = (* (( (ptr) formal←c71676)+21) );
SOURCE(50951, 21)
            (*  (W2Pt) (( (ptr) formal←c71676)+9) ) = (*  (W2Pt) (( (ptr) formal←c71676)+22) );
SOURCE(50974, 23)
            (*  (W2Pt) (( (ptr) formal←c71676)+11) ) = (*  (W2Pt) (( (ptr) formal←c71676)+24) );
SOURCE(50999, 14)
            (* (( (ptr) formal←c71676)+13) ) = 1;
            };
         };
      };
SOURCE(50513, 500)
   return(done←v28988);
   }

static word IndexOfJoint←P4320(joint←v17496, slice←v17524)
   word joint←v17496;
   word slice←v17524;
   {
   word index←v17568;
   word thisJoint←v29104 = 0;
   /* IndexOfJoint: */ 
SOURCE(51441, 225)
SOURCE(51539, 106)
   {
      register word i←v29148 = 0;
      register word noName←c68796;
      noName←c68796 = (word) HiJoint←P2340(slice←v17524);
      if ((i←v29148 > noName←c68796)) {
         goto lab←L100134;
         };
      lab←L100137: ;
SOURCE(51576, 32)
      thisJoint←v29104 = (word) FetchJoint←P1860(slice←v17524, i←v29148);
SOURCE(51610, 35)
      if ((thisJoint←v29104 == joint←v17496)) {
SOURCE(51636, 9)
         return(i←v29148);
         };
      if ((i←v29148 >= noName←c68796)) {
         goto lab←L100134;
         };
      i←v29148 = (i←v29148 + 1);
      goto lab←L100137;
      lab←L100134: ;
      };
SOURCE(51656, 10)
   return( (word) -1);
   }

static word IndexOfSegment←P4380(segment←v17628, slice←v17656)
   word segment←v17628;
   word slice←v17656;
   {
   word index←v17700;
   word thisSeg←v29192 = 0;
   /* IndexOfSegment: */ 
SOURCE(51672, 233)
SOURCE(51776, 108)
   {
      register word i←v29236 = 0;
      register word noName←c68828;
      noName←c68828 = (word) HiSegment←P2220(slice←v17656);
      if ((i←v29236 > noName←c68828)) {
         goto lab←L100138;
         };
      lab←L100141: ;
SOURCE(51815, 32)
      thisSeg←v29192 = (word) FetchSegment←P1740(slice←v17656, i←v29236);
SOURCE(51849, 35)
      if ((thisSeg←v29192 == segment←v17628)) {
SOURCE(51875, 9)
         return(i←v29236);
         };
      if ((i←v29236 >= noName←c68828)) {
         goto lab←L100138;
         };
      i←v29236 = (i←v29236 + 1);
      goto lab←L100141;
      lab←L100138: ;
      };
SOURCE(51895, 10)
   return( (word) -1);
   }

/* file: GGTrajImpl, module: GGTrajImpl, compiled at: July 11, 1993 8:14:50 pm PDT */ 
extern void XR←install←GGTrajImpl() {
   NoName←Q7236();
   }
extern void XR←run←GGTrajImpl() { XR←Start(&globalframe); }