// File: DavidLBruce[P]sim3dof/build/../src/SimExec.cpp
// Function: SimExec::Execute(int, char**)
void SimExec::Execute( int argc, char *argv[] )
{
  double angA;      // rad Angle between relative position and velocity vectors.
  double dummy;     // na  Throw away variable
  int    idx;       // na  Loop variable
  double overShoot; // m   Distance of travel beyond the closest point of
                    //     approach.

  strcpy( fileStub, argv[0] );

  process_command_line(argc, argv);

  //
  // Set up all the sim modules
  //

  //
  // Target
  //
  AddModel( &tgt, "Target" );
  tgt.SetSimExec( this );

  //
  // Fire Control Radar
  //
  AddModel( &fcRdr, "FcRdr" );
  fcRdr.SetSimExec( this );
  fcRdr.SetTarget( &tgt );

  //
  // Fire Control Target State Estimator
  //
  AddModel( &fcTseO, "fcTseO" );
  fcTseO.SetSimExec( this );
  fcTseO.SetRadar( &fcRdr );

  //
  // Fire Control six state Target State Estimator
  //
  AddModel( &fcTse6, "fcTse6" );
  fcTse6.SetSimExec( this );
  fcTse6.SetRadar( &fcRdr );
  fcTse6.SetTarget( &tgt ); 

  //
  // Projectile
  //
  AddModel( &msl, "madFires" );
  msl.SetSimExec( this );
  msl.SetAutopilot( &ap );

  //
  // Seeker
  //
  AddModel( &skr, "Seeker" );
  skr.SetMissile( &msl );
  skr.SetSimExec( this );
  skr.SetTarget( &tgt );

  //
  // Projectile MSC TSE
  //
  AddModel( &mslTse6, "mslTse6" );
  mslTse6.SetSimExec( this );
  mslTse6.SetFcTse6( &fcTse6 );
  mslTse6.SetFcTseO( &fcTseO );
  mslTse6.SetMissile( &msl );
  mslTse6.SetFcRadar( &fcRdr );
  mslTse6.SetSeeker( &skr );
  mslTse6.SetTarget( &tgt );

  //
  // Guidance
  //
  AddModel( &gdn, "guidance" );
  gdn.SetSimExec( this );
  gdn.SetMissile( &msl );
  gdn.SetRadar( &fcRdr );
  gdn.SetTarget( &tgt );
  gdn.SetTse6( &fcTse6 ); 
  gdn.SetMslTse( &mslTse6 ); 
  gdn.SetAutopilot( &ap ); 

  AddModel( &ap, "autopilot" );
  ap.SetSimExec( this );
  ap.SetMissile( &msl );
  ap.SetGuidance( &gdn ); 

  //
  //
  // 
  nonFlyerCnt  = 0;
  avgMissMag   = 0.0;
  avgMissX     = 0.0;
  avgMissY     = 0.0;
  avgXang      = 0.0;
  hitCnt       = 0;
  runIdx       = 0;

  //
  // Set size of vector containers.  Hopefully this is faster than push_back()
  //
  missVec.insert(missVec.end(), runs, 0.0);
  missNonFlyers.insert(missNonFlyers.end(), runs, 0.0);
  missXvec.insert(missXvec.end(), runs, 0.0);
  missYvec.insert(missYvec.end(), runs, 0.0);

  if ( printAll )  
  {
    printf( "%5s", "run" );
    printf( "%10s", "miss" );
    printf( "%10s", "tof" );
    printf( "%10s", "seed" );
    printf( "\n" );

    fflush( NULL );
  }

  for ( run = runStart; run < runStart + runs; run++ )
  {
    //
    // Initialize random number generator
    //
    seed = -abs(2 * run - 1) * 13579;
    runSeed = seed;

    //
    // "Warm up" random number seed
    //
    for ( idx = 0; idx < 500; ++idx )
    {
      uniform( 0.0, 1.0, &seed );
    }

    //
    // Run simulation
    //

    //
    // Initialize the modules
    //
    Initialize();

    sprintf( filename, "%s", fileStub );

    sprintf( filename, "%s-%05d.dat", filename, run );

    if ( outputRate > 0.0 )
    {
      pOutFile = fopen( filename, "w" );
    }

    //
    // Print the output file header if necessary
    //
    if ( pOutFile != NULL )
    {
      Output( true, pOutFile );
    }

    deltaTime = timeStep;

    //
    // Main simulation loop
    //
    done = false;
    while ( !done )
    {
      //
      // Update variables in preparation for derivative calculations.
      //
      Update();
    
      Integrate();

      //
      // Update variables with the resultes of integration.
      //
      Update();

      //
      // Frame updates can run asynchrously with respect to eash other and the
      // base simulation run rate.  Dynamics integration will be current at the
      // time of any frame update.
      //
      FrameUpdate();

      relPxf = tgt.pxf - msl.pxf;
      relPyf = tgt.pyf - msl.pyf;

      range = sqrt( SQ(relPxf) + SQ(relPyf) );

      relVxf = tgt.vxf - msl.vxf;
      relVyf = tgt.vyf - msl.vyf;

      relVmag = sqrt( SQ(relVxf) + SQ(relVyf) );

      rDot = ( relVxf * relPxf + relVyf * relPyf ) / range;

      if ( rDot >= 0.0 )
      {
        done = true;
     
        //
        // Calculate the miss distance
        //

        //
        // Use dot product to calculate the angle between relative position and
        // velocity vectors.
        //
        if ( range == 0.0 )
        {
          angA = 0.0;
          miss = 0.0;
          overShoot = 0.0;
          missX = 0.0;
          missY = 0.0;
        }
        else
        {
          angA = acos( (relPxf * relVxf + relPyf * relVyf) / (range * relVmag) );
          miss = range * sin( angA );

          overShoot = range * cos(angA);

          missX = relPxf - overShoot * relVxf / relVmag;
          missY = relPyf - overShoot * relVyf / relVmag;
        }
      }  // end if ( rDot >= 0.0 )
      else if ( simTime >= maxTime )
      {
        done = true;
        
        miss = missX = missY = LARGE;
      }

      if ( !done )
      {
        simTime += deltaTime;
      }
    
    }  // end while ( !done )
    
    //
    // Do final dump of data
    //
    if ( pOutFile != NULL ) 
    {
      Output( false, pOutFile );

      fclose( pOutFile );
    }

    //
    // Collect miss data
    //
    missVec[runIdx] = miss;
    if ( miss < flyerThld )
    {
      ++nonFlyerCnt;
      missNonFlyers[nonFlyerCnt-1] = miss;
      missXvec[nonFlyerCnt-1] = missX;
      missYvec[nonFlyerCnt-1] = missY;

      avgMissMag = ( avgMissMag * static_cast<double>(nonFlyerCnt - 1) +
                                                  fabs(miss) ) /  nonFlyerCnt;
      avgMissX = ( avgMissX * static_cast<double>(nonFlyerCnt - 1) + missX ) /
                                                                  nonFlyerCnt;
      avgMissY = ( avgMissY * static_cast<double>(nonFlyerCnt - 1) + missY ) /
                                                                  nonFlyerCnt;

      //
      // Crossing angle. Supplement of angle between tgt & msl velocity vectors.
      //
      Xang = acos( (msl.vxf * tgt.vxf + msl.vyf * tgt.vyf) /
              sqrt((msl.vxf*msl.vxf + msl.vyf*msl.vyf) *
                   (tgt.vxf*tgt.vxf + tgt.vyf*tgt.vyf)) );

      Xang = PI - Xang;

      avgXang = ( avgXang * static_cast<double>(nonFlyerCnt - 1) + Xang ) /
                                                                  nonFlyerCnt;

    }

    //
    // Count hits for pHit calculation
    //
    if ( miss < pHitThld )
    {
      ++hitCnt;
    }

    if ( printAll )  
    {
      if ( miss < flyerThld )
      {
        printf( "%5d",    run );
        printf( "%10.3f", miss );
        printf( "%10.3f", simTime );
        printf( "%10d",   runSeed );
        printf( "\n" );
        fflush( NULL );
      }
      else
      {
        printf( "%5d",    run );
        printf( "%10.3e", miss );
        printf( "%10.3f", simTime );
        printf( "%10d",   runSeed );
        printf( "\n" );
        fflush( NULL );
      }
    }
    
    if ( runIdx < runs - 1 )
    {
      ++runIdx;
    }

  }  // end for ( run = runStart; run < runStart + runs; run++ )

  pHit = static_cast<double>( hitCnt ) / static_cast<double>( runs );

  sort( missVec.begin(), missVec.end() );
  if ( modf(static_cast<double>(runs) / 2.0, &dummy) < SMALL )
  {
    medMiss = ( missVec[runs/2] + missVec[runs/2+1] ) / 2.0;
  }
  else
  {
    medMiss = missVec[(int)((runs-1)/2)];
  }

  if ( runs > 1 )
  {
    miss70 = missVec[(int)(runs*0.7)-1];
    miss20 = missVec[(int)(runs*0.2)-1];
    miss35 = missVec[(int)(runs*0.35)-1];
  }
  else
  {
    miss70 = missVec[0];
    miss20 = missVec[0];
    miss35 = missVec[0];
  }

  minMiss = missVec[0];
  maxMiss = missVec[runs-1];

  stdMissX = CalcStdDev( missXvec );
  stdMissY = CalcStdDev( missYvec );

  qtyFly = runs - nonFlyerCnt;

  printf( "%10s ", "runs" );
  printf( "%10s ", "pHit" );
  printf( "%10s ", "pHitThld" );
  printf( "%10s ", "miss70" );
  printf( "%10s ", "medMiss" );
  printf( "%10s ", "miss35" );
  printf( "%10s ", "miss20" );
  printf( "%10s ", "avgMissMag" );
  printf( "%10s ", "minMiss" );
  printf( "%10s ", "maxMiss" );
  printf( "%10s ", "avgMissX" );
  printf( "%10s ", "avgMissY" );
  printf( "%10s ", "stdMissX" );
  printf( "%10s ", "stdMissY" );
  printf( "%10s ", "avgXang" );
  printf( "%10s ", "qtyFly" );
  printf( "\n" );

  printf( "%10d ",   runs );  
  printf( "%10.3f",  pHit );
  printf( "%10.3f ", pHitThld );
  printf( "%10.3f ", miss70 );
  printf( "%10.3f ", medMiss );
  printf( "%10.3f ", miss35 );
  printf( "%10.3f ", miss20 );
  printf( "%10.3f ", avgMissMag );
  printf( "%10.3f ", minMiss );
  printf( "%10.3f ", maxMiss );
  printf( "%10.3f ", avgMissX );
  printf( "%10.3f ", avgMissY );
  printf( "%10.3f ", stdMissX );
  printf( "%10.3f ", stdMissY );
  printf( "%10.3f ", avgXang );
  printf( "%10d ",   qtyFly );
  printf( "\n " );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x288(%rbp)
addq $0xf1, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x31f0
movq -0x288(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1a0d0
movq -0x288(%rbp), %rax
addq $0x1750, %rax           # imm = 0x1750
movq %rax, -0x280(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x33e0
movq -0x278(%rbp), %rdx
leaq 0xc8f7(%rip), %rsi      # 0x24ca0
leaq -0x58(%rbp), %rdi
callq 0x1bf70
jmp 0x183b4
movq -0x280(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x17d60
jmp 0x183cd
leaq -0x58(%rbp), %rdi
callq 0x3140
leaq -0x59(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x1750, %rdi           # imm = 0x1750
callq 0x1c020
movq -0x288(%rbp), %rax
addq $0x548, %rax            # imm = 0x548
movq %rax, -0x298(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x33e0
movq -0x290(%rbp), %rdx
leaq 0xc87d(%rip), %rsi      # 0x24ca7
leaq -0x90(%rbp), %rdi
callq 0x1bf70
jmp 0x18438
movq -0x298(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x17d60
jmp 0x18454
leaq -0x90(%rbp), %rdi
callq 0x3140
leaq -0x91(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x548, %rdi            # imm = 0x548
movq %rdi, -0x2b0(%rbp)
callq 0x1c040
movq -0x2b0(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x1750, %rsi           # imm = 0x1750
callq 0x1c060
movq -0x288(%rbp), %rax
addq $0x720, %rax            # imm = 0x720
movq %rax, -0x2a8(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x33e0
movq -0x2a0(%rbp), %rdx
leaq 0xc7d5(%rip), %rsi      # 0x24cad
leaq -0xb8(%rbp), %rdi
callq 0x1bf70
jmp 0x184e6
movq -0x2a8(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x17d60
jmp 0x18502
leaq -0xb8(%rbp), %rdi
callq 0x3140
leaq -0xb9(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x720, %rdi            # imm = 0x720
movq %rdi, -0x2c8(%rbp)
callq 0x1c080
movq -0x2c8(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x548, %rsi            # imm = 0x548
callq 0x1c0a0
movq -0x288(%rbp), %rax
addq $0x990, %rax            # imm = 0x990
movq %rax, -0x2c0(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x33e0
movq -0x2b8(%rbp), %rdx
leaq 0xc72e(%rip), %rsi      # 0x24cb4
leaq -0xe0(%rbp), %rdi
callq 0x1bf70
jmp 0x18594
movq -0x2c0(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x17d60
jmp 0x185b0
leaq -0xe0(%rbp), %rdi
callq 0x3140
leaq -0xe1(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x990, %rdi            # imm = 0x990
movq %rdi, -0x2e0(%rbp)
callq 0x1c0c0
movq -0x2e0(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x548, %rsi            # imm = 0x548
callq 0x1c0e0
movq -0x2e0(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x1750, %rsi           # imm = 0x1750
callq 0x1c100
movq -0x288(%rbp), %rax
addq $0xeb8, %rax            # imm = 0xEB8
movq %rax, -0x2d8(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x33e0
movq -0x2d0(%rbp), %rdx
leaq 0xc66d(%rip), %rsi      # 0x24cbb
leaq -0x108(%rbp), %rdi
callq 0x1bf70
jmp 0x1865c
movq -0x2d8(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x17d60
jmp 0x18678
leaq -0x108(%rbp), %rdi
callq 0x3140
leaq -0x109(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0xeb8, %rdi            # imm = 0xEB8
movq %rdi, -0x2f8(%rbp)
callq 0x1c120
movq -0x2f8(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x3c8, %rsi            # imm = 0x3C8
callq 0x1c140
movq -0x288(%rbp), %rax
addq $0x1588, %rax           # imm = 0x1588
movq %rax, -0x2f0(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x33e0
movq -0x2e8(%rbp), %rdx
leaq 0xc5c8(%rip), %rsi      # 0x24cc4
leaq -0x130(%rbp), %rdi
callq 0x1bf70
jmp 0x1870a
movq -0x2f0(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x130(%rbp), %rdx
callq 0x17d60
jmp 0x18726
leaq -0x130(%rbp), %rdi
callq 0x3140
leaq -0x131(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x1588, %rdi           # imm = 0x1588
movq %rdi, -0x310(%rbp)
addq $0xeb8, %rsi            # imm = 0xEB8
callq 0x1c160
movq -0x310(%rbp), %rdi
movq -0x288(%rbp), %rsi
callq 0x1c180
movq -0x310(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x1750, %rsi           # imm = 0x1750
callq 0x1c1a0
movq -0x288(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x308(%rbp)
leaq -0x159(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x33e0
movq -0x300(%rbp), %rdx
leaq 0xc507(%rip), %rsi      # 0x24ccb
leaq -0x158(%rbp), %rdi
callq 0x1bf70
jmp 0x187d2
movq -0x308(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x17d60
jmp 0x187ee
leaq -0x158(%rbp), %rdi
callq 0x3140
leaq -0x159(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x1040, %rdi           # imm = 0x1040
movq %rdi, -0x328(%rbp)
callq 0x1c1c0
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x990, %rsi            # imm = 0x990
callq 0x1c1e0
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x720, %rsi            # imm = 0x720
callq 0x1c200
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0xeb8, %rsi            # imm = 0xEB8
callq 0x1c220
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x548, %rsi            # imm = 0x548
callq 0x1c240
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x1588, %rsi           # imm = 0x1588
callq 0x1c260
movq -0x328(%rbp), %rdi
movq -0x288(%rbp), %rsi
addq $0x1750, %rsi           # imm = 0x1750
callq 0x1c280
movq -0x288(%rbp), %rax
addq $0xca8, %rax            # imm = 0xCA8
movq %rax, -0x320(%rbp)
leaq -0x181(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x33e0
movq -0x318(%rbp), %rdx
leaq 0xc3df(%rip), %rsi      # 0x24cd3
leaq -0x180(%rbp), %rdi
callq 0x1bf70
jmp 0x18902
movq -0x320(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x17d60
jmp 0x1891e
leaq -0x180(%rbp), %rdi
callq 0x3140
leaq -0x181(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0xca8, %rdi            # imm = 0xCA8
movq %rdi, -0x340(%rbp)
callq 0x1c2a0
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0xeb8, %rsi            # imm = 0xEB8
callq 0x1c2c0
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0x548, %rsi            # imm = 0x548
callq 0x1c2e0
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0x1750, %rsi           # imm = 0x1750
callq 0x1c300
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0x990, %rsi            # imm = 0x990
callq 0x1c320
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0x1040, %rsi           # imm = 0x1040
callq 0x1c340
movq -0x288(%rbp), %rsi
movq -0x340(%rbp), %rdi
addq $0x3c8, %rsi            # imm = 0x3C8
movq %rsi, -0x338(%rbp)
callq 0x1c360
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x33e0
movq -0x330(%rbp), %rdx
leaq 0xc2c5(%rip), %rsi      # 0x24cdc
leaq -0x1a8(%rbp), %rdi
callq 0x1bf70
jmp 0x18a25
movq -0x338(%rbp), %rsi
movq -0x288(%rbp), %rdi
leaq -0x1a8(%rbp), %rdx
callq 0x17d60
jmp 0x18a41
leaq -0x1a8(%rbp), %rdi
callq 0x3140
leaq -0x1a9(%rbp), %rdi
callq 0x3270
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x3c8, %rdi            # imm = 0x3C8
callq 0x1c380
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x3c8, %rdi            # imm = 0x3C8
addq $0xeb8, %rsi            # imm = 0xEB8
callq 0x1c3a0
movq -0x288(%rbp), %rsi
movq %rsi, %rdi
addq $0x3c8, %rdi            # imm = 0x3C8
addq $0xca8, %rsi            # imm = 0xCA8
callq 0x1c3c0
movq -0x288(%rbp), %rdi
movl $0x0, 0x380(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x238(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x240(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x248(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x250(%rdi)
movl $0x0, 0x304(%rdi)
movl $0x0, 0x3a8(%rdi)
movq %rdi, %rax
addq $0x320, %rax            # imm = 0x320
movq %rax, -0x360(%rbp)
addq $0x320, %rdi            # imm = 0x320
callq 0xe8a0
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xe8d0
movq -0x360(%rbp), %rdi
movq -0x288(%rbp), %rax
movslq 0x16c(%rax), %rdx
xorps %xmm0, %xmm0
movsd %xmm0, -0x1c8(%rbp)
movq -0x1b8(%rbp), %rsi
leaq -0x1c8(%rbp), %rcx
callq 0xe800
movq -0x288(%rbp), %rdi
movq %rax, -0x1d0(%rbp)
movq %rdi, %rax
addq $0x338, %rax            # imm = 0x338
movq %rax, -0x358(%rbp)
addq $0x338, %rdi            # imm = 0x338
callq 0xe8a0
movq %rax, -0x1e0(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xe8d0
movq -0x358(%rbp), %rdi
movq -0x288(%rbp), %rax
movslq 0x16c(%rax), %rdx
xorps %xmm0, %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq -0x1d8(%rbp), %rsi
leaq -0x1e8(%rbp), %rcx
callq 0xe800
movq -0x288(%rbp), %rdi
movq %rax, -0x1f0(%rbp)
movq %rdi, %rax
addq $0x350, %rax            # imm = 0x350
movq %rax, -0x350(%rbp)
addq $0x350, %rdi            # imm = 0x350
callq 0xe8a0
movq %rax, -0x200(%rbp)
leaq -0x1f8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xe8d0
movq -0x350(%rbp), %rdi
movq -0x288(%rbp), %rax
movslq 0x16c(%rax), %rdx
xorps %xmm0, %xmm0
movsd %xmm0, -0x208(%rbp)
movq -0x1f8(%rbp), %rsi
leaq -0x208(%rbp), %rcx
callq 0xe800
movq -0x288(%rbp), %rdi
movq %rax, -0x210(%rbp)
movq %rdi, %rax
addq $0x368, %rax            # imm = 0x368
movq %rax, -0x348(%rbp)
addq $0x368, %rdi            # imm = 0x368
callq 0xe8a0
movq %rax, -0x220(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0xe8d0
movq -0x348(%rbp), %rdi
movq -0x288(%rbp), %rax
movslq 0x16c(%rax), %rdx
xorps %xmm0, %xmm0
movsd %xmm0, -0x228(%rbp)
movq -0x218(%rbp), %rsi
leaq -0x228(%rbp), %rcx
callq 0xe800
movq %rax, %rcx
movq -0x288(%rbp), %rax
movq %rcx, -0x230(%rbp)
testb $0x1, 0x168(%rax)
je 0x18f3f
leaq 0xbff9(%rip), %rdi      # 0x24ce6
leaq 0xbff6(%rip), %rsi      # 0x24cea
movb $0x0, %al
callq 0x3050
leaq 0xbfec(%rip), %rdi      # 0x24cee
leaq 0xbfea(%rip), %rsi      # 0x24cf3
movb $0x0, %al
callq 0x3050
leaq 0xbfd7(%rip), %rdi      # 0x24cee
leaq 0xbfda(%rip), %rsi      # 0x24cf8
movb $0x0, %al
callq 0x3050
leaq 0xbfc2(%rip), %rdi      # 0x24cee
leaq 0xbfc9(%rip), %rsi      # 0x24cfc
movb $0x0, %al
callq 0x3050
leaq 0xc4c4(%rip), %rdi      # 0x25205
movb $0x0, %al
callq 0x3050
xorl %eax, %eax
movl %eax, %edi
callq 0x32a0
jmp 0x18f3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18d79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3140
leaq -0x59(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18dad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3140
leaq -0x91(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18de4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3140
leaq -0xb9(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18e1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3140
leaq -0xe1(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18e52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3140
leaq -0x109(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18e89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3140
leaq -0x131(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18ec0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x3140
leaq -0x159(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18ef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x3140
leaq -0x181(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x18f2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x3140
leaq -0x1a9(%rbp), %rdi
callq 0x3270
jmp 0x1a0bd
movq -0x288(%rbp), %rax
movl 0x170(%rax), %ecx
movl %ecx, 0x3a4(%rax)
movq -0x288(%rbp), %rdx
movl 0x3a4(%rdx), %eax
movl 0x170(%rdx), %ecx
addl 0x16c(%rdx), %ecx
cmpl %ecx, %eax
jge 0x19957
movq -0x288(%rbp), %rax
movl 0x3a4(%rax), %edx
shll %edx
subl $0x1, %edx
movl %edx, %ecx
negl %ecx
cmovnsl %ecx, %edx
xorl %ecx, %ecx
subl %edx, %ecx
imull $0x350b, %ecx, %ecx     # imm = 0x350B
movslq %ecx, %rcx
movq %rcx, 0x200(%rax)
movq 0x200(%rax), %rcx
movl %ecx, 0x3ac(%rax)
movl $0x0, -0x2c(%rbp)
cmpl $0x1f4, -0x2c(%rbp)     # imm = 0x1F4
jge 0x18fe6
movq -0x288(%rbp), %rdi
addq $0x200, %rdi            # imm = 0x200
xorps %xmm0, %xmm0
movsd 0xb032(%rip), %xmm1     # 0x24008
callq 0xcc50
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x18fb4
movq -0x288(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x288(%rbp), %rdx
movq %rdx, %rdi
addq $0x261, %rdi            # imm = 0x261
addq $0xf1, %rdx
leaq 0xbcef(%rip), %rsi      # 0x24d01
movb $0x0, %al
callq 0x3090
movq -0x288(%rbp), %rax
movq %rax, %rdi
addq $0x261, %rdi            # imm = 0x261
movq %rax, %rdx
addq $0x261, %rdx            # imm = 0x261
movl 0x3a4(%rax), %ecx
leaq 0xbcc3(%rip), %rsi      # 0x24d04
movb $0x0, %al
callq 0x3090
movq -0x288(%rbp), %rax
movsd 0x158(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1908b
movq -0x288(%rbp), %rdi
addq $0x261, %rdi            # imm = 0x261
leaq 0xbc9b(%rip), %rsi      # 0x24d10
callq 0x32b0
movq %rax, %rcx
movq -0x288(%rbp), %rax
movq %rcx, 0x210(%rax)
movq -0x288(%rbp), %rax
cmpq $0x0, 0x210(%rax)
je 0x190b5
movq -0x288(%rbp), %rdi
movq 0x210(%rdi), %rdx
movq (%rdi), %rax
movl $0x1, %esi
callq *0x30(%rax)
movq -0x288(%rbp), %rax
movsd 0x180(%rax), %xmm0
movsd %xmm0, 0x258(%rax)
movb $0x0, 0x260(%rax)
movq -0x288(%rbp), %rax
movb 0x260(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x190eb
jmp 0x1946a
movq -0x288(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x288(%rbp), %rdi
callq 0x17f70
movq -0x288(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x288(%rbp), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movq -0x288(%rbp), %rax
movsd 0x18b0(%rax), %xmm0
subsd 0xfe8(%rax), %xmm0
movsd %xmm0, 0x1d8(%rax)
movsd 0x18b8(%rax), %xmm0
subsd 0xff0(%rax), %xmm0
movsd %xmm0, 0x1e0(%rax)
movsd 0x1d8(%rax), %xmm0
callq 0x4450
movq -0x288(%rbp), %rax
movsd %xmm0, -0x370(%rbp)
movsd 0x1e0(%rax), %xmm0
callq 0x4450
movaps %xmm0, %xmm1
movsd -0x370(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x3190
movq -0x288(%rbp), %rax
movsd %xmm0, 0x1c8(%rax)
movsd 0x18d0(%rax), %xmm0
subsd 0x1008(%rax), %xmm0
movsd %xmm0, 0x1f0(%rax)
movsd 0x18e0(%rax), %xmm0
subsd 0x1018(%rax), %xmm0
movsd %xmm0, 0x1f8(%rax)
movsd 0x1f0(%rax), %xmm0
callq 0x4450
movq -0x288(%rbp), %rax
movsd %xmm0, -0x368(%rbp)
movsd 0x1f8(%rax), %xmm0
callq 0x4450
movaps %xmm0, %xmm1
movsd -0x368(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x3190
movq -0x288(%rbp), %rax
movsd %xmm0, 0x1e8(%rax)
movsd 0x1f0(%rax), %xmm0
movsd 0x1d8(%rax), %xmm2
movsd 0x1f8(%rax), %xmm1
mulsd 0x1e0(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd 0x1c8(%rax), %xmm0
movsd %xmm0, 0x1d0(%rax)
movsd 0x1d0(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x193dd
movq -0x288(%rbp), %rax
movb $0x1, 0x260(%rax)
movsd 0x1c8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x192c8
jp 0x192c8
movq -0x288(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x190(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x1b0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x1b8(%rax)
jmp 0x193db
movq -0x288(%rbp), %rax
movsd 0x1d8(%rax), %xmm0
movsd 0x1f0(%rax), %xmm2
movsd 0x1e0(%rax), %xmm1
mulsd 0x1f8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x1c8(%rax), %xmm1
mulsd 0x1e8(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x3200
movq -0x288(%rbp), %rax
movsd %xmm0, -0x20(%rbp)
movsd 0x1c8(%rax), %xmm0
movsd %xmm0, -0x380(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x30a0
movq -0x288(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x380(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x190(%rax)
movsd 0x1c8(%rax), %xmm0
movsd %xmm0, -0x378(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x3430
movq -0x288(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x378(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x1d8(%rax), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd 0x1f0(%rax), %xmm1
divsd 0x1e8(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x1b0(%rax)
movsd 0x1e0(%rax), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd 0x1f8(%rax), %xmm1
divsd 0x1e8(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x1b8(%rax)
jmp 0x19436
movq -0x288(%rbp), %rax
movsd 0x208(%rax), %xmm0
ucomisd 0x150(%rax), %xmm0
jb 0x19434
movq -0x288(%rbp), %rax
movb $0x1, 0x260(%rax)
movsd 0xb874(%rip), %xmm0     # 0x24c80
movsd %xmm0, 0x1b8(%rax)
movsd 0xb864(%rip), %xmm0     # 0x24c80
movsd %xmm0, 0x1b0(%rax)
movsd 0xb854(%rip), %xmm0     # 0x24c80
movsd %xmm0, 0x190(%rax)
jmp 0x19436
movq -0x288(%rbp), %rax
testb $0x1, 0x260(%rax)
jne 0x19465
movq -0x288(%rbp), %rax
movsd 0x258(%rax), %xmm0
addsd 0x208(%rax), %xmm0
movsd %xmm0, 0x208(%rax)
jmp 0x190d3
movq -0x288(%rbp), %rax
cmpq $0x0, 0x210(%rax)
je 0x194a4
movq -0x288(%rbp), %rdi
movq 0x210(%rdi), %rdx
movq (%rdi), %rax
xorl %esi, %esi
callq *0x30(%rax)
movq -0x288(%rbp), %rax
movq 0x210(%rax), %rdi
callq 0x3220
movq -0x288(%rbp), %rax
movsd 0x190(%rax), %xmm0
movsd %xmm0, -0x388(%rbp)
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
movslq 0x3a8(%rax), %rsi
callq 0xe910
movsd -0x388(%rbp), %xmm0
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd %xmm0, (%rcx)
movsd 0x190(%rax), %xmm1
movsd 0x148(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1978d
movq -0x288(%rbp), %rax
movl 0x380(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x380(%rax)
movsd 0x190(%rax), %xmm0
movsd %xmm0, -0x3a8(%rbp)
movq %rax, %rdi
addq $0x338, %rdi            # imm = 0x338
movl 0x380(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movsd -0x3a8(%rbp), %xmm0
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd %xmm0, (%rcx)
movsd 0x1b0(%rax), %xmm0
movsd %xmm0, -0x3a0(%rbp)
movq %rax, %rdi
addq $0x350, %rdi            # imm = 0x350
movl 0x380(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movsd -0x3a0(%rbp), %xmm0
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd %xmm0, (%rcx)
movsd 0x1b8(%rax), %xmm0
movsd %xmm0, -0x398(%rbp)
movq %rax, %rdi
addq $0x368, %rdi            # imm = 0x368
movl 0x380(%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movsd -0x398(%rbp), %xmm0
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd %xmm0, (%rcx)
movsd 0x238(%rax), %xmm0
movl 0x380(%rax), %ecx
subl $0x1, %ecx
cvtsi2sd %ecx, %xmm2
movsd 0x190(%rax), %xmm1
movaps 0xaff2(%rip), %xmm3     # 0x245f0
pand %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl 0x380(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x238(%rax)
movsd 0x240(%rax), %xmm0
movl 0x380(%rax), %ecx
subl $0x1, %ecx
cvtsi2sd %ecx, %xmm2
movsd 0x1b0(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl 0x380(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x240(%rax)
movsd 0x248(%rax), %xmm0
movl 0x380(%rax), %ecx
subl $0x1, %ecx
cvtsi2sd %ecx, %xmm2
movsd 0x1b8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl 0x380(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x248(%rax)
movsd 0x1008(%rax), %xmm0
movsd 0x18d0(%rax), %xmm2
movsd 0x1018(%rax), %xmm1
mulsd 0x18e0(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x390(%rbp)
movsd 0x1008(%rax), %xmm0
movsd 0x1008(%rax), %xmm2
movsd 0x1018(%rax), %xmm1
mulsd 0x1018(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x18d0(%rax), %xmm1
movsd 0x18d0(%rax), %xmm3
movsd 0x18e0(%rax), %xmm2
mulsd 0x18e0(%rax), %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x3190
movaps %xmm0, %xmm1
movsd -0x390(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x3200
movq -0x288(%rbp), %rax
movsd %xmm0, 0x3c0(%rax)
movsd 0xb534(%rip), %xmm0     # 0x24c78
subsd 0x3c0(%rax), %xmm0
movsd %xmm0, 0x3c0(%rax)
movsd 0x250(%rax), %xmm0
movl 0x380(%rax), %ecx
subl $0x1, %ecx
cvtsi2sd %ecx, %xmm2
movsd 0x3c0(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl 0x380(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x250(%rax)
movq -0x288(%rbp), %rax
movsd 0x190(%rax), %xmm1
movsd 0x160(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x197c0
movq -0x288(%rbp), %rax
movl 0x304(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x304(%rax)
movq -0x288(%rbp), %rax
testb $0x1, 0x168(%rax)
je 0x1990a
movq -0x288(%rbp), %rax
movsd 0x190(%rax), %xmm1
movsd 0x148(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x19881
movq -0x288(%rbp), %rax
movl 0x3a4(%rax), %esi
leaq 0xb509(%rip), %rdi      # 0x24d12
movb $0x0, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x190(%rax), %xmm0
leaq 0xb4f0(%rip), %rdi      # 0x24d16
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x208(%rax), %xmm0
leaq 0xb4d3(%rip), %rdi      # 0x24d16
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movl 0x3ac(%rax), %esi
leaq 0xb4bf(%rip), %rdi      # 0x24d1d
movb $0x0, %al
callq 0x3050
leaq 0xb999(%rip), %rdi      # 0x25205
movb $0x0, %al
callq 0x3050
xorl %eax, %eax
movl %eax, %edi
callq 0x32a0
jmp 0x19908
movq -0x288(%rbp), %rax
movl 0x3a4(%rax), %esi
leaq 0xb47d(%rip), %rdi      # 0x24d12
movb $0x0, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x190(%rax), %xmm0
leaq 0xb470(%rip), %rdi      # 0x24d22
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x208(%rax), %xmm0
leaq 0xb447(%rip), %rdi      # 0x24d16
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movl 0x3ac(%rax), %esi
leaq 0xb433(%rip), %rdi      # 0x24d1d
movb $0x0, %al
callq 0x3050
leaq 0xb90d(%rip), %rdi      # 0x25205
movb $0x0, %al
callq 0x3050
xorl %eax, %eax
movl %eax, %edi
callq 0x32a0
jmp 0x1990a
movq -0x288(%rbp), %rcx
movl 0x3a8(%rcx), %eax
movl 0x16c(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1993a
movq -0x288(%rbp), %rax
movl 0x3a8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x3a8(%rax)
jmp 0x1993c
movq -0x288(%rbp), %rax
movl 0x3a4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x3a4(%rax)
jmp 0x18f52
movq -0x288(%rbp), %rdi
cvtsi2sdl 0x304(%rdi), %xmm0
cvtsi2sdl 0x16c(%rdi), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x398(%rdi)
addq $0x320, %rdi            # imm = 0x320
callq 0x103a0
movq -0x288(%rbp), %rdi
movq %rax, -0x238(%rbp)
addq $0x320, %rdi            # imm = 0x320
callq 0xe8a0
movq %rax, -0x240(%rbp)
movq -0x238(%rbp), %rdi
movq -0x240(%rbp), %rsi
callq 0x1c3e0
movq -0x288(%rbp), %rax
cvtsi2sdl 0x16c(%rax), %xmm0
movsd 0xac87(%rip), %xmm1     # 0x24658
divsd %xmm1, %xmm0
leaq -0x28(%rbp), %rdi
callq 0x33f0
movaps %xmm0, %xmm1
movsd 0xad27(%rip), %xmm0     # 0x24710
ucomisd %xmm1, %xmm0
jbe 0x19a7f
movq -0x288(%rbp), %rax
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
movl 0x16c(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rsi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x3b0(%rbp)
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
movl 0x16c(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movsd -0x3b0(%rbp), %xmm0
movq %rax, %rcx
movq -0x288(%rbp), %rax
addsd (%rcx), %xmm0
movsd 0xabe7(%rip), %xmm1     # 0x24658
divsd %xmm1, %xmm0
movsd %xmm0, 0x310(%rax)
jmp 0x19abf
movq -0x288(%rbp), %rax
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
movl 0x16c(%rax), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rsi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x310(%rax)
movq -0x288(%rbp), %rax
cmpl $0x1, 0x16c(%rax)
jle 0x19ba5
movq -0x288(%rbp), %rax
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
cvtsi2sdl 0x16c(%rax), %xmm0
movsd 0xb17c(%rip), %xmm1     # 0x24c70
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x1a8(%rax)
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
cvtsi2sdl 0x16c(%rax), %xmm0
movsd 0xb131(%rip), %xmm1     # 0x24c68
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x198(%rax)
movq %rax, %rdi
addq $0x320, %rdi            # imm = 0x320
cvtsi2sdl 0x16c(%rax), %xmm0
movsd 0xb0e6(%rip), %xmm1     # 0x24c60
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x1a0(%rax)
jmp 0x19c18
movq -0x288(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
xorl %eax, %eax
movl %eax, %esi
callq 0xe910
movq -0x288(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x1a8(%rdi)
addq $0x320, %rdi            # imm = 0x320
xorl %eax, %eax
movl %eax, %esi
callq 0xe910
movq -0x288(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x198(%rdi)
addq $0x320, %rdi            # imm = 0x320
xorl %eax, %eax
movl %eax, %esi
callq 0xe910
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x1a0(%rax)
movq -0x288(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
movq %rdi, -0x3c8(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0xe910
movq -0x3c8(%rbp), %rdi
movq %rax, %rcx
movq -0x288(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x318(%rax)
movl 0x16c(%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0xe910
movq -0x288(%rbp), %rsi
movsd (%rax), %xmm0
movsd %xmm0, 0x308(%rsi)
addq $0x350, %rsi            # imm = 0x350
leaq -0x258(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x1c420
movq -0x288(%rbp), %rdi
movq -0x3c0(%rbp), %rsi
callq 0x1a170
movsd %xmm0, -0x3b8(%rbp)
jmp 0x19cad
movq -0x288(%rbp), %rax
movsd -0x3b8(%rbp), %xmm0
movsd %xmm0, 0x3b0(%rax)
leaq -0x258(%rbp), %rdi
callq 0xe440
movq -0x288(%rbp), %rsi
addq $0x368, %rsi            # imm = 0x368
leaq -0x270(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x1c420
movq -0x288(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x1a170
movsd %xmm0, -0x3d0(%rbp)
jmp 0x19d0e
movq -0x288(%rbp), %rax
movsd -0x3d0(%rbp), %xmm0
movsd %xmm0, 0x3b8(%rax)
leaq -0x270(%rbp), %rdi
callq 0xe440
movq -0x288(%rbp), %rax
movl 0x16c(%rax), %ecx
subl 0x380(%rax), %ecx
movl %ecx, 0x3a0(%rax)
leaq 0xafd8(%rip), %rdi      # 0x24d29
leaq 0xb0f0(%rip), %rsi      # 0x24e48
movb $0x0, %al
callq 0x3050
leaq 0xafc3(%rip), %rdi      # 0x24d29
leaq 0xafc2(%rip), %rsi      # 0x24d2f
movb $0x0, %al
callq 0x3050
leaq 0xafae(%rip), %rdi      # 0x24d29
leaq 0xb0ae(%rip), %rsi      # 0x24e30
movb $0x0, %al
callq 0x3050
leaq 0xaf99(%rip), %rdi      # 0x24d29
leaq 0xaf9d(%rip), %rsi      # 0x24d34
movb $0x0, %al
callq 0x3050
leaq 0xaf84(%rip), %rdi      # 0x24d29
leaq 0xaf8f(%rip), %rsi      # 0x24d3b
movb $0x0, %al
callq 0x3050
leaq 0xaf6f(%rip), %rdi      # 0x24d29
leaq 0xaf82(%rip), %rsi      # 0x24d43
movb $0x0, %al
callq 0x3050
leaq 0xaf5a(%rip), %rdi      # 0x24d29
leaq 0xaf74(%rip), %rsi      # 0x24d4a
movb $0x0, %al
callq 0x3050
leaq 0xaf45(%rip), %rdi      # 0x24d29
leaq 0xaf66(%rip), %rsi      # 0x24d51
movb $0x0, %al
callq 0x3050
leaq 0xaf30(%rip), %rdi      # 0x24d29
leaq 0xaf5c(%rip), %rsi      # 0x24d5c
movb $0x0, %al
callq 0x3050
leaq 0xaf1b(%rip), %rdi      # 0x24d29
leaq 0xaf4f(%rip), %rsi      # 0x24d64
movb $0x0, %al
callq 0x3050
leaq 0xaf06(%rip), %rdi      # 0x24d29
leaq 0xaf42(%rip), %rsi      # 0x24d6c
movb $0x0, %al
callq 0x3050
leaq 0xaef1(%rip), %rdi      # 0x24d29
leaq 0xaf36(%rip), %rsi      # 0x24d75
movb $0x0, %al
callq 0x3050
leaq 0xaedc(%rip), %rdi      # 0x24d29
leaq 0xaf2a(%rip), %rsi      # 0x24d7e
movb $0x0, %al
callq 0x3050
leaq 0xaec7(%rip), %rdi      # 0x24d29
leaq 0xaf1e(%rip), %rsi      # 0x24d87
movb $0x0, %al
callq 0x3050
leaq 0xaeb2(%rip), %rdi      # 0x24d29
leaq 0xaf12(%rip), %rsi      # 0x24d90
movb $0x0, %al
callq 0x3050
leaq 0xae9d(%rip), %rdi      # 0x24d29
leaq 0xaf05(%rip), %rsi      # 0x24d98
movb $0x0, %al
callq 0x3050
leaq 0xb364(%rip), %rdi      # 0x25205
movb $0x0, %al
callq 0x3050
movq -0x288(%rbp), %rax
movl 0x16c(%rax), %esi
leaq 0xaee3(%rip), %rdi      # 0x24d9f
movb $0x0, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x398(%rax), %xmm0
leaq 0xae3d(%rip), %rdi      # 0x24d16
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x160(%rax), %xmm0
leaq 0xaeaf(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x1a8(%rax), %xmm0
leaq 0xae92(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x310(%rax), %xmm0
leaq 0xae75(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x1a0(%rax), %xmm0
leaq 0xae58(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x198(%rax), %xmm0
leaq 0xae3b(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x238(%rax), %xmm0
leaq 0xae1e(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x318(%rax), %xmm0
leaq 0xae01(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x308(%rax), %xmm0
leaq 0xade4(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x240(%rax), %xmm0
leaq 0xadc7(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x248(%rax), %xmm0
leaq 0xadaa(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x3b0(%rax), %xmm0
leaq 0xad8d(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x3b8(%rax), %xmm0
leaq 0xad70(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movsd 0x250(%rax), %xmm0
leaq 0xad53(%rip), %rdi      # 0x24da5
movb $0x1, %al
callq 0x3050
movq -0x288(%rbp), %rax
movl 0x3a0(%rax), %esi
leaq 0xad32(%rip), %rdi      # 0x24d9f
movb $0x0, %al
callq 0x3050
leaq 0xad32(%rip), %rdi      # 0x24dad
movb $0x0, %al
callq 0x3050
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0xe440
jmp 0x1a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0xe440
movq -0x68(%rbp), %rdi
callq 0x33d0
nopw %cs:(%rax,%rax)