// File: bauerj4[P]Riemann1D/src/main.cpp
// Function: main
int main(int argc, char * argv[])
{
  
  char * PATH = argv[1];
  vector<double> testVector(3,2.0);
  // Primative should invert conservative
  testVector = primativeTo1DConservative(testVector);
  printf("The conserved test components are: [%10.10f, %10.10f, %10.10f]\n", testVector[0],testVector[1], testVector[2]);
  //
  testVector = conservativeTo1DPrimative(testVector);
  printf("The primative components are: [%10.10f, %10.10f, %10.10f]\n", testVector[0],testVector[1], testVector[2]);
  
  
  // Get context.
  
  context_t RiemannContext;
  readContext(PATH, RiemannContext);
  printContext(RiemannContext);
  
  // Initialize simulation
  mesh_t mesh;
  printf("Constructing mesh...\n");
  ConstructMesh(mesh, RiemannContext);
  printf("Mesh constructed.\n");
  
  // Add more ghost cells for higher order
  /*
    if (RiemannContext.SOLUTION_METHOD == "HLLC_FLUX_SUPERBEE" || RiemannContext.SOLUTION_METHOD == "HLLC_FLUX_SUPERBEE")
    {
    double positions[mesh.NCells + 2];
    double pressures[mesh.NCells + 2];
    double velocities[mesh.NCells + 2];
    double denisities[mesh.NCells + 2];
    mesh.NCells = mesh.NCells + 2;
    for (int i = 0; i < mesh.NCells; i++)/ 	
    {
    if i == mesh.NCells - 1)
    {
    positions[i] = positions[i - 1];
    pressures[i] = pressures[i - 1];
    velocities[i] = velocities[i - 1];
    }
    }
    
    }
   */
  
  int snapshot_number = 0;
  PrintDataToFile(mesh, RiemannContext, snapshot_number);
  //return 1;
  // Declare flux vector
  vector<vector<double> > fluxes(mesh.NCells - 3, vector<double>(3,0.));
  
  if(RiemannContext.SOLUTION_METHOD == "HLLC")
    {
      fluxes.push_back(vector<double>(3,0.));
      fluxes.push_back(vector<double>(3,0.));
    }
  
  vector<vector<double> > primatives(mesh.NCells,vector<double> (3,0.));
  vector<vector<double> > conserved(mesh.NCells,vector<double> (3,0.));
  
  for (int i = 0; i < mesh.NCells; i++)
    {
      primatives[i][0] = mesh.FirstDensityElement[i];
      primatives[i][1] = mesh.FirstVelocityElement[i];
      primatives[i][2] = mesh.FirstPressureElement[i];
      //printf("%10.10f, %10.10f, %10.10f", primatives[i][0], primatives[i][1], primatives[i][2]);
    }
  
  for (int i = 0; i < mesh.NCells; i++)
    {
      conserved[i] = primativeTo1DConservative(primatives[i]);
    }
  
  double currentTime = 0;
  double SMAX;
  int iteration;
  // For time, do:
  while (currentTime < RiemannContext.EVOLVE_TIME)
    {
      // Compute fluxes with TRANSMISSIVE BCs
      if (RiemannContext.SOLUTION_METHOD == "HLLC")
 	{
 	  HLLC_FLUX(mesh, fluxes, SMAX);
 	}
      
      if (RiemannContext.SOLUTION_METHOD=="HLLC_FLUX_SUPERBEE")
 	{
 	  int success = 1;
 	  success = HLLC_FLUX_SUPERBEE(mesh, fluxes, RiemannContext, SMAX);
 	  printf("Flux calculation finished.\n");
 	  if (success != 0)
 	    {
 	      printf("RIEMANN SOLVER RETURNED WITH ERROR.\n");	      
PrintDataToFile(mesh, RiemannContext, snapshot_number);
 	      break;
 	    }
 	  printf("FLUX RETURN CODE %d\n",success);
 	}

      if (RiemannContext.SOLUTION_METHOD=="HLLC_FLUX_MINBEE")
        {
          int success = 1;
          success = HLLC_FLUX_MINBEE(mesh, fluxes, RiemannContext, SMAX);
          printf("Flux calculation finished.\n");
          if (success != 0)
            {
              printf("RIEMANN SOLVER RETURNED WITH ERROR.\n");
	      PrintDataToFile(mesh, RiemannContext, snapshot_number);
              break;
            }
          printf("FLUX RETURN CODE %d\n",success);
	}

       // Update mesh
      //vector<vector<double> > test(mesh.NCells - 1, vector<double>(3,0.));
       printf("Updating Mesh.\n");
      
      int success = FVUpdate(conserved, fluxes, mesh, RiemannContext, currentTime, SMAX, iteration);
      if (success != 0)
	{
	  printf("RIEMANN SOLVER RETURNED WITH ERROR.\n");
	  PrintDataToFile(mesh, RiemannContext, snapshot_number);
	  break;
	}


      for (int i = 0; i < mesh.NCells; i++)
	{
	  primatives[i] = conservativeTo1DPrimative(conserved[i]);
	  //printf("%10.10f, %10.10f, %10.10f", primatives[i][0], primatives[i][1], primatives[i][2]);
	  mesh.FirstDensityElement[i] = primatives[i][0];
	  mesh.FirstVelocityElement[i] = primatives[i][1];
	  mesh.FirstPressureElement[i] = primatives[i][2];
	}
      SMAX=0;

    }

  // Convert back to primatives
  /*
  for (int i = 0; i < mesh.NCells; i++)
    {
      primatives[i] = conservativeTo1DPrimative(conserved[i]);
      mesh.FirstDensityElement[i] = primatives[i][0];
      mesh.FirstVelocityElement[i] = primatives[i][1];
      mesh.FirstPressureElement[i] = primatives[i][2];
    }
  */


  // Write output.

  
  PrintDataToFile(mesh, RiemannContext, snapshot_number);

  return 0;
  
}

// Assembly:
subq $0x408, %rsp            # imm = 0x408
movl $0x0, 0x404(%rsp)
movl %edi, 0x400(%rsp)
movq %rsi, 0x3f8(%rsp)
movq 0x3f8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x3f0(%rsp)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x3d0(%rsp)
leaq 0x3cf(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x128a0
movq 0xe0(%rsp), %rcx
leaq 0x3d8(%rsp), %rdi
movl $0x3, %esi
leaq 0x3d0(%rsp), %rdx
callq 0x128b0
jmp 0x16300
leaq 0x3cf(%rsp), %rdi
callq 0x12930
leaq 0x388(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x12a70
jmp 0x16324
leaq 0x3a0(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x52f0
jmp 0x1633b
leaq 0x3d8(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
leaq 0x3a0(%rsp), %rsi
movq %rsi, 0xc0(%rsp)
callq 0x12b70
movq 0xc0(%rsp), %rdi
callq 0x12940
leaq 0x388(%rsp), %rdi
callq 0x12940
movq 0xc8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4ff0
movq 0xc8(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0xd0(%rsp)
movl $0x1, %esi
callq 0x4ff0
movq 0xc8(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0xd8(%rsp)
movl $0x2, %esi
callq 0x4ff0
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd (%rax), %xmm2
leaq 0x2233(%rip), %rdi      # 0x18619
movb $0x3, %al
callq 0x2040
jmp 0x163ef
leaq 0x358(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x12a70
jmp 0x16406
leaq 0x370(%rsp), %rdi
leaq 0x358(%rsp), %rsi
callq 0x5550
jmp 0x1641d
leaq 0x3d8(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
leaq 0x370(%rsp), %rsi
movq %rsi, 0xa0(%rsp)
callq 0x12b70
movq 0xa0(%rsp), %rdi
callq 0x12940
leaq 0x358(%rsp), %rdi
callq 0x12940
movq 0xa8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4ff0
movq 0xa8(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movl $0x1, %esi
callq 0x4ff0
movq 0xa8(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0xb8(%rsp)
movl $0x2, %esi
callq 0x4ff0
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
movsd (%rax), %xmm2
leaq 0x2191(%rip), %rdi      # 0x18659
movb $0x3, %al
callq 0x2040
jmp 0x164d1
leaq 0x2b8(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x171d0
movq 0x98(%rsp), %rsi
movq 0x3f0(%rsp), %rdi
callq 0x2750
jmp 0x164fd
leaq 0x2b8(%rsp), %rdi
callq 0x2f70
jmp 0x1650c
leaq 0x2181(%rip), %rdi      # 0x18694
xorl %eax, %eax
callq 0x2040
jmp 0x1651c
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x159c0
jmp 0x16533
leaq 0x2170(%rip), %rdi      # 0x186aa
xorl %eax, %eax
callq 0x2040
jmp 0x16543
movl $0x0, 0x28c(%rsp)
movl 0x28c(%rsp), %edx
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x160f0
jmp 0x1656c
movl 0x290(%rsp), %eax
addl $-0x3, %eax
cltq
movq %rax, 0x88(%rsp)
movq $0x0, 0x250(%rsp)
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x128a0
movq 0x90(%rsp), %rcx
leaq 0x258(%rsp), %rdi
movl $0x3, %esi
leaq 0x250(%rsp), %rdx
callq 0x128b0
jmp 0x165c5
leaq 0x24e(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x12e70
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rcx
leaq 0x270(%rsp), %rdi
leaq 0x258(%rsp), %rdx
callq 0x12e80
jmp 0x16601
leaq 0x24e(%rsp), %rdi
callq 0x12f00
leaq 0x258(%rsp), %rdi
callq 0x12940
leaq 0x24f(%rsp), %rdi
callq 0x12930
leaq 0x318(%rsp), %rdi
leaq 0x2086(%rip), %rsi      # 0x186bd
callq 0x3260
movb %al, 0x7f(%rsp)
jmp 0x16642
movb 0x7f(%rsp), %al
testb $0x1, %al
jne 0x1664f
jmp 0x168d9
movq $0x0, 0x228(%rsp)
leaq 0x227(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x128a0
movq 0x70(%rsp), %rcx
leaq 0x230(%rsp), %rdi
movl $0x3, %esi
leaq 0x228(%rsp), %rdx
callq 0x128b0
jmp 0x1668e
leaq 0x270(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x17210
jmp 0x166a5
leaq 0x230(%rsp), %rdi
callq 0x12940
leaq 0x227(%rsp), %rdi
callq 0x12930
movq $0x0, 0x200(%rsp)
leaq 0x1ff(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x128a0
movq 0x68(%rsp), %rcx
leaq 0x208(%rsp), %rdi
movl $0x3, %esi
leaq 0x200(%rsp), %rdx
callq 0x128b0
jmp 0x166fe
leaq 0x270(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x17210
jmp 0x16715
leaq 0x208(%rsp), %rdi
callq 0x12940
leaq 0x1ff(%rsp), %rdi
callq 0x12930
jmp 0x168d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x3cf(%rsp), %rdi
callq 0x12930
jmp 0x171c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x171b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x388(%rsp), %rdi
callq 0x12940
jmp 0x171b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x358(%rsp), %rdi
callq 0x12940
jmp 0x171b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x171a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x1681c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x24e(%rsp), %rdi
callq 0x12f00
leaq 0x258(%rsp), %rdi
callq 0x12940
leaq 0x24f(%rsp), %rdi
callq 0x12930
jmp 0x171a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x1719c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x1687e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x12940
leaq 0x227(%rsp), %rdi
callq 0x12930
jmp 0x1719c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x168c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x12940
leaq 0x1ff(%rsp), %rdi
callq 0x12930
jmp 0x1719c
movslq 0x290(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x1c0(%rsp)
leaq 0x1bf(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x128a0
movq 0x60(%rsp), %rcx
leaq 0x1c8(%rsp), %rdi
movl $0x3, %esi
leaq 0x1c0(%rsp), %rdx
callq 0x128b0
jmp 0x16925
leaq 0x1be(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x12e70
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rcx
leaq 0x1e0(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x12e80
jmp 0x16958
leaq 0x1be(%rsp), %rdi
callq 0x12f00
leaq 0x1c8(%rsp), %rdi
callq 0x12940
leaq 0x1bf(%rsp), %rdi
callq 0x12930
movslq 0x290(%rsp), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x180(%rsp)
leaq 0x17f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x128a0
movq 0x48(%rsp), %rcx
leaq 0x188(%rsp), %rdi
movl $0x3, %esi
leaq 0x180(%rsp), %rdx
callq 0x128b0
jmp 0x169cb
leaq 0x17e(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x12e70
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rcx
leaq 0x1a0(%rsp), %rdi
leaq 0x188(%rsp), %rdx
callq 0x12e80
jmp 0x169fe
leaq 0x17e(%rsp), %rdi
callq 0x12f00
leaq 0x188(%rsp), %rdi
callq 0x12940
leaq 0x17f(%rsp), %rdi
callq 0x12930
movl $0x0, 0x178(%rsp)
movl 0x178(%rsp), %eax
cmpl 0x290(%rsp), %eax
jge 0x16bda
movq 0x2a0(%rsp), %rax
movslq 0x178(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movslq 0x178(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4ff0
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x2b0(%rsp), %rax
movslq 0x178(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x28(%rsp)
movslq 0x178(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
movl $0x1, %esi
callq 0x4ff0
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x2a8(%rsp), %rax
movslq 0x178(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x30(%rsp)
movslq 0x178(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
movl $0x2, %esi
callq 0x4ff0
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x178(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x178(%rsp)
jmp 0x16a30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x16b72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x1be(%rsp), %rdi
callq 0x12f00
leaq 0x1c8(%rsp), %rdi
callq 0x12940
leaq 0x1bf(%rsp), %rdi
callq 0x12930
jmp 0x1719c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x16bc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x17e(%rsp), %rdi
callq 0x12f00
leaq 0x188(%rsp), %rdi
callq 0x12940
leaq 0x17f(%rsp), %rdi
callq 0x12930
jmp 0x1718f
movl $0x0, 0x174(%rsp)
movl 0x174(%rsp), %eax
cmpl 0x290(%rsp), %eax
jge 0x16ccb
movslq 0x174(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rsi
leaq 0x140(%rsp), %rdi
callq 0x12a70
jmp 0x16c20
leaq 0x158(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x52f0
jmp 0x16c37
movslq 0x174(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
leaq 0x158(%rsp), %rsi
callq 0x12b70
leaq 0x158(%rsp), %rdi
callq 0x12940
leaq 0x140(%rsp), %rdi
callq 0x12940
movl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
jmp 0x16be5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0x17182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x12940
jmp 0x17182
xorps %xmm0, %xmm0
movsd %xmm0, 0x138(%rsp)
movsd 0x138(%rsp), %xmm1
movsd 0x310(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x17109
leaq 0x318(%rsp), %rdi
leaq 0x19bb(%rip), %rsi      # 0x186bd
callq 0x3260
movb %al, 0x1f(%rsp)
jmp 0x16d0d
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x16d17
jmp 0x16d38
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x130(%rsp), %rdx
callq 0x5790
jmp 0x16d36
jmp 0x16d38
leaq 0x318(%rsp), %rdi
leaq 0x14eb(%rip), %rsi      # 0x18232
callq 0x3260
movb %al, 0x1e(%rsp)
jmp 0x16d52
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0x16d5f
jmp 0x16e06
movl $0x1, 0x128(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x2b8(%rsp), %rdx
leaq 0x130(%rsp), %rcx
callq 0x7170
movl %eax, 0x18(%rsp)
jmp 0x16d95
movl 0x18(%rsp), %eax
movl %eax, 0x128(%rsp)
leaq 0x191b(%rip), %rdi      # 0x186c2
xorl %eax, %eax
callq 0x2040
jmp 0x16db0
cmpl $0x0, 0x128(%rsp)
je 0x16ded
leaq 0x191d(%rip), %rdi      # 0x186de
xorl %eax, %eax
callq 0x2040
jmp 0x16dca
movl 0x28c(%rsp), %edx
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x160f0
jmp 0x16de8
jmp 0x17109
movl 0x128(%rsp), %esi
leaq 0x1908(%rip), %rdi      # 0x18703
xorl %eax, %eax
callq 0x2040
jmp 0x16e04
jmp 0x16e06
leaq 0x318(%rsp), %rdi
leaq 0x1430(%rip), %rsi      # 0x18245
callq 0x3260
movb %al, 0x17(%rsp)
jmp 0x16e20
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x16e2d
jmp 0x16ed4
movl $0x1, 0x124(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x2b8(%rsp), %rdx
leaq 0x130(%rsp), %rcx
callq 0xcce0
movl %eax, 0x10(%rsp)
jmp 0x16e63
movl 0x10(%rsp), %eax
movl %eax, 0x124(%rsp)
leaq 0x184d(%rip), %rdi      # 0x186c2
xorl %eax, %eax
callq 0x2040
jmp 0x16e7e
cmpl $0x0, 0x124(%rsp)
je 0x16ebb
leaq 0x184f(%rip), %rdi      # 0x186de
xorl %eax, %eax
callq 0x2040
jmp 0x16e98
movl 0x28c(%rsp), %edx
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x160f0
jmp 0x16eb6
jmp 0x17109
movl 0x124(%rsp), %esi
leaq 0x183a(%rip), %rdi      # 0x18703
xorl %eax, %eax
callq 0x2040
jmp 0x16ed2
jmp 0x16ed4
leaq 0x183d(%rip), %rdi      # 0x18718
xorl %eax, %eax
callq 0x2040
jmp 0x16ee4
movsd 0x130(%rsp), %xmm0
leaq 0x1a0(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x290(%rsp), %rdx
leaq 0x2b8(%rsp), %rcx
leaq 0x138(%rsp), %r8
leaq 0x12c(%rsp), %r9
callq 0x4150
movl %eax, 0xc(%rsp)
jmp 0x16f28
movl 0xc(%rsp), %eax
movl %eax, 0x120(%rsp)
cmpl $0x0, 0x120(%rsp)
je 0x16f70
leaq 0x179a(%rip), %rdi      # 0x186de
xorl %eax, %eax
callq 0x2040
jmp 0x16f4d
movl 0x28c(%rsp), %edx
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x160f0
jmp 0x16f6b
jmp 0x17109
movl $0x0, 0x11c(%rsp)
movl 0x11c(%rsp), %eax
cmpl 0x290(%rsp), %eax
jge 0x170f8
movslq 0x11c(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rsi
leaq 0xe8(%rsp), %rdi
callq 0x12a70
jmp 0x16fb6
leaq 0x100(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x5550
jmp 0x16fcd
movslq 0x11c(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
leaq 0x100(%rsp), %rsi
callq 0x12b70
leaq 0x100(%rsp), %rdi
callq 0x12940
leaq 0xe8(%rsp), %rdi
callq 0x12940
movslq 0x11c(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4ff0
movsd (%rax), %xmm0
movq 0x2a0(%rsp), %rax
movslq 0x11c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movslq 0x11c(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
movl $0x1, %esi
callq 0x4ff0
movsd (%rax), %xmm0
movq 0x2b0(%rsp), %rax
movslq 0x11c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movslq 0x11c(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x4fd0
movq %rax, %rdi
movl $0x2, %esi
callq 0x4ff0
movsd (%rax), %xmm0
movq 0x2a8(%rsp), %rax
movslq 0x11c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x11c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x11c(%rsp)
jmp 0x16f7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x12940
jmp 0x17182
xorps %xmm0, %xmm0
movsd %xmm0, 0x130(%rsp)
jmp 0x16cd7
movl 0x28c(%rsp), %edx
leaq 0x290(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x160f0
jmp 0x17127
movl $0x0, 0x404(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x130b0
leaq 0x1e0(%rsp), %rdi
callq 0x130b0
leaq 0x270(%rsp), %rdi
callq 0x130b0
leaq 0x2b8(%rsp), %rdi
callq 0x17240
leaq 0x3d8(%rsp), %rdi
callq 0x12940
movl 0x404(%rsp), %eax
addq $0x408, %rsp            # imm = 0x408
retq
leaq 0x1a0(%rsp), %rdi
callq 0x130b0
leaq 0x1e0(%rsp), %rdi
callq 0x130b0
leaq 0x270(%rsp), %rdi
callq 0x130b0
leaq 0x2b8(%rsp), %rdi
callq 0x17240
leaq 0x3d8(%rsp), %rdi
callq 0x12940
movq 0x3c0(%rsp), %rdi
callq 0x23d0