// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/network.cc
// Function: bool storeVoronoiNetwork<voro::container_periodic_poly>(voro::container_periodic_poly&, ATOM_NETWORK*, VORONOI_NETWORK*, double, double, double, std::vector<BASIC_VCELL, std::allocator<BASIC_VCELL>>&, std::vector<int, std::allocator<int>>&, bool, std::vector<VOR_CELL, std::allocator<VOR_CELL>>&)
bool storeVoronoiNetwork(c_option &con, ATOM_NETWORK *atmnet, VORONOI_NETWORK *vornet, double bx, double by, double bz,
			 vector<BASIC_VCELL> &basCells, vector<int> &atomShifts, bool storeAdvCells, vector<VOR_CELL> &advCells) {
  voronoi_network vnet (con, VOR_NODE_MERGE_THRESHOLD); // data structure defined in voro++ which is not to be confused with VORONOI_NETWORK
  int id;
  double vvol=0,x,y,z,r;
  voronoicell c(con);

  puts("Performing Voronoi decomposition.");

  basCells.clear(); advCells.clear();
  basCells.resize(atmnet->numAtoms, BASIC_VCELL());
  advCells.resize(atmnet->numAtoms, VOR_CELL());
  vector<int> numNodes;
  int cellIndex = 0;

  vector< vector<double> > vertices;

  // Compute Voronoi cells
  c_loop_all_periodic vl(con);
  vector<int> cellIDs;
  int **cellInfo;
  cellInfo = new int*[atmnet->numAtoms];
    if(vl.start()) {
      do { 
	if(con.compute_cell(c,vl)) {
	  vvol+=c.volume();
	  vl.pos(id,x,y,z,r);
	  	  
	  int *map;
	  vector<double> coords;
	  c.vertices(atmnet->atoms[id].x, atmnet->atoms[id].y, atmnet->atoms[id].z, coords);

	  numNodes.push_back(c.p);
	  cellIDs.push_back(id);
	  vertices.push_back(coords);

	  vnet.add_to_network(c,id,x,y,z,r, map);

	  cellInfo[cellIndex] = map;
	  
	  if(storeAdvCells){
	    VOR_CELL newCell;
	    createAdvCell(c, coords, map, newCell);
	    advCells[id] = newCell;
	  }
	} 
	else {
	  numNodes.push_back(0);
	  cellIDs.push_back(-1);
	  vertices.push_back(vector<double>());
	  
	  cellInfo[cellIndex] = NULL;
	}
	cellIndex++;
      } while(vl.inc());
    }
    else {
      fputs("Error: Unable to begin Voronoi decomposition.\nExiting...\n",stderr);
      exit(1);
    }

    // Carry out the volume check
    printf("Volume check:\n  Total domain volume  = %f\n",bx*by*bz);
    printf("  Total Voronoi volume = %f\n", vvol);
//    if(abs(vvol - bx*by*bz) > 0.00001) {
//    if(abs(vvol - bx*by*bz) > 0.0001) {
//      fputs("Error: Voronoi volume check failed.\nExiting...\n",stderr);
//      exit(1);
//    }
    double box_vol = bx*by*bz;
    double error_percent = 100*abs(vvol - box_vol)/box_vol;
    double error_percent_tolerance = 0.001; // former (before Voro++ fit default = 0.1; 
    if(error_percent > error_percent_tolerance) {
      printf("Error: Voronoi volume check failed (%.3f%% error, > %.3f%% tolerance).\nExiting...\n", error_percent, error_percent_tolerance);
      return false;
//      exit(1);
    }
    
    cout << "Voronoi decomposition finished. Rerouting Voronoi network information." << "\n";
    
    vnet.store_network(vornet->nodes, vornet->edges, false);
    for(int i = 0; i < atmnet->numAtoms; i++){
      if(numNodes[i] == 0){
	continue;
      }
      
      vector<int> nodeIDs;
      vector<Point> nodeLocations; 
      if((int)vertices[i].size() != 3*numNodes[i]){
	cerr << "Error: Improper number of node coordinates in Voronoi decomposition" << "\n"
	     << "Found " << vertices[i].size() << " but expected " << 3*numNodes[i] << "\n"
	     << "Exiting..." << "\n";
	exit(1);
      }

      for(int j = 0; j < numNodes[i]; j++){
	nodeLocations.push_back(Point(vertices[i][3*j], vertices[i][3*j+1], vertices[i][3*j+2])) ;
	nodeIDs.push_back(cellInfo[i][j*4]);
      }
      
      basCells[cellIDs[i]] = BASIC_VCELL(nodeLocations, nodeIDs);
      delete [] cellInfo[i];
    }
    delete [] cellInfo;
    cout << "Finished rerouting information." << "\n";
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movl %r9d, 0xa8(%rsp)
movq %rcx, %r14
movsd %xmm2, 0x118(%rsp)
movsd %xmm1, 0x110(%rsp)
movsd %xmm0, 0x90(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x398(%rsp), %rdi
movsd 0x140586(%rip), %xmm0   # 0x14d030
movq %rbx, %rsi
callq 0x8136a
movq %rbx, 0x98(%rsp)
movsd 0x178(%rbx), %xmm0
leaq 0x2b0(%rsp), %rdi
callq 0x1214ac
movq 0x4b0(%rsp), %rbx
leaq 0x1881e2(%rip), %rax    # 0x194cc0
movq %rax, 0x2b0(%rsp)
leaq 0x140a39(%rip), %rdi    # 0x14d526
callq 0x4660
movq (%r14), %rsi
movq %r14, %rdi
callq 0xfaa6
movq (%rbx), %rsi
movq %rbx, %rdi
callq 0xfad6
movslq 0x110(%r15), %rbx
leaq 0x180(%rsp), %rdi
callq 0x6bbe0
leaq 0x180(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf984
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0xcb4c
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0xcb69
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movslq 0x110(%r15), %rbx
leaq 0x180(%rsp), %rdi
callq 0x6a896
movq %r12, 0x108(%rsp)
movq %r15, 0x88(%rsp)
movq %r14, 0x130(%rsp)
leaq 0x180(%rsp), %rdx
movq 0x4b0(%rsp), %rdi
movq %rbx, %rsi
callq 0xf9cc
leaq 0x260(%rsp), %rdi
callq 0xf5a0
leaq 0x230(%rsp), %rdi
callq 0xf618
leaq 0x200(%rsp), %rdi
callq 0xf668
leaq 0x1d0(%rsp), %rdi
callq 0xf1b6
leaq 0x1a0(%rsp), %rdi
callq 0xf6de
leaq 0x180(%rsp), %rdi
callq 0xf5e8
xorl %r12d, %r12d
movq %r12, 0x60(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq %r12, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
movq 0x98(%rsp), %rax
movl 0x128(%rax), %ebx
movl 0x180(%rax), %r14d
movl 0x1cc(%rax), %ecx
movl %ecx, 0xac(%rsp)
movq 0x1a8(%rax), %rcx
movq %rcx, 0x128(%rsp)
movq 0x1a0(%rax), %rcx
movq %rcx, 0x120(%rsp)
movq 0x1b0(%rax), %r13
movl 0x184(%rax), %r15d
movl 0x188(%rax), %ecx
movl %ecx, 0x48(%rsp)
movl 0x18c(%rax), %ecx
movl %ecx, 0x40(%rsp)
movl 0x190(%rax), %ebp
movq %r12, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq 0x88(%rsp), %rax
movslq 0x110(%rax), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x4030
movq %rax, 0x30(%rsp)
movl %ebx, %eax
imull %r14d, %eax
leal 0x1(,%rax,2), %eax
movl %eax, 0x3c(%rsp)
imull %r15d, %ebp
addl %r14d, %ebp
movl %ebx, 0x4c(%rsp)
imull %ebx, %ebp
movslq %ebp, %rax
movq %r13, 0xa0(%rsp)
cmpl $0x0, (%r13,%rax,4)
movl %r14d, 0x44(%rsp)
je 0xccff
movl %r14d, %ebx
jmp 0xcd48
xorl %r12d, %r12d
movl %r14d, %ebx
movq 0xa0(%rsp), %rcx
incl %r12d
movl $0x1, %eax
cmpl 0x4c(%rsp), %r12d
jne 0xcd3d
incl %ebx
xorl %r12d, %r12d
cmpl 0x48(%rsp), %ebx
jne 0xcd3d
incl %r15d
movl 0x44(%rsp), %ebx
movl 0x3c(%rsp), %eax
cmpl 0x40(%rsp), %r15d
je 0xd7c6
addl %eax, %ebp
movslq %ebp, %rax
cmpl $0x0, (%rcx,%rax,4)
je 0xcd0d
addq $0x1f8, 0x98(%rsp) # imm = 0x1F8
xorpd %xmm0, %xmm0
movapd %xmm0, 0xd0(%rsp)
xorl %r14d, %r14d
xorl %ecx, %ecx
movl %r15d, (%rsp)
movq 0x98(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
movl %ebp, %edx
movl %ecx, 0x38(%rsp)
movl %r12d, %r8d
movl %ebx, %r9d
callq 0x1418d0
testb %al, %al
je 0xceab
leaq 0x2b0(%rsp), %rdi
callq 0x122c8c
movsd %xmm0, 0x140(%rsp)
movq %r14, 0x100(%rsp)
movl 0x38(%rsp), %ecx
movl %ecx, %edx
movl 0xac(%rsp), %esi
imull %esi, %edx
movslq %ebp, %rdi
movq 0x120(%rsp), %rax
movq (%rax,%rdi,8), %rax
movslq %ecx, %rcx
movslq (%rax,%rcx,4), %rax
movl %eax, 0xc(%rsp)
movq 0x128(%rsp), %rcx
movq %rdi, 0x138(%rsp)
movq (%rcx,%rdi,8), %rcx
movslq %edx, %rdx
movsd 0x14023e(%rip), %xmm0   # 0x14d038
cmpl $0x3, %esi
je 0xce05
movsd 0x18(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x160(%rsp)
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x158(%rsp)
movsd 0x8(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x150(%rsp)
movsd 0x10(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x148(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x88(%rsp), %rcx
movq 0x2f0(%rcx), %rcx
imulq $0x98, %rax, %rax
movsd (%rcx,%rax), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
movsd 0x10(%rcx,%rax), %xmm2
leaq 0x2b0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x124f2e
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0xcf88
movl 0x2cc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0xcf9a
movl $0x0, 0x180(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0xced3
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0xcee5
leaq 0x50(%rsp), %rdi
leaq 0x180(%rsp), %rdx
callq 0x14198
movl $0xffffffff, 0x180(%rsp) # imm = 0xFFFFFFFF
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xcf18
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
leaq 0x180(%rsp), %r13
jmp 0xcf2d
leaq 0x70(%rsp), %rdi
leaq 0x180(%rsp), %r13
movq %r13, %rdx
callq 0x14198
xorpd %xmm0, %xmm0
movapd %xmm0, 0x180(%rsp)
movq $0x0, 0x190(%rsp)
leaq 0xe0(%rsp), %rdi
movq %r13, %rsi
callq 0x12ac6
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0xcf73
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rax
movq $0x0, (%rax,%r14,8)
movslq %ebp, %rdx
jmp 0xd1e2
leaq 0x50(%rsp), %rdi
leaq 0x2cc(%rsp), %rdx
callq 0xf864
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xcfba
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0xcfc9
leaq 0x70(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xf864
leaq 0xe0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xef20
movl 0xc(%rsp), %r14d
movslq 0x2cc(%rsp), %rax
movq %rax, %rdi
shlq $0x4, %rdi
testq %rax, %rax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x4030
movq %rax, %r13
leaq 0x398(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
movl %r14d, %edx
movsd 0x158(%rsp), %xmm0
movsd 0x150(%rsp), %xmm1
movsd 0x148(%rsp), %xmm2
movsd 0x160(%rsp), %xmm3
movq %rax, %rcx
callq 0x816c0
movq 0x30(%rsp), %rax
movq 0x100(%rsp), %rcx
movq %r13, (%rax,%rcx,8)
cmpb $0x0, 0xa8(%rsp)
je 0xd1a0
leaq 0x180(%rsp), %rdi
callq 0x6a896
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xfa14
leaq 0x2b0(%rsp), %rdi
leaq 0x168(%rsp), %rsi
movq %r13, %rdx
leaq 0x180(%rsp), %rcx
callq 0x79bc
movq 0x168(%rsp), %rdi
testq %rdi, %rdi
je 0xd0bf
movq 0x178(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movslq 0xc(%rsp), %rax
imulq $0xf8, %rax, %r13
movq 0x4b0(%rsp), %rax
addq (%rax), %r13
movq %r13, %rdi
leaq 0x180(%rsp), %rsi
callq 0x1186c
movl 0x198(%rsp), %eax
movl %eax, 0x18(%r13)
leaq 0x20(%r13), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x11cf0
leaq 0x50(%r13), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x11f72
leaq 0x80(%r13), %rdi
leaq 0x200(%rsp), %rsi
callq 0x121fa
leaq 0xb0(%r13), %rdi
leaq 0x230(%rsp), %rsi
callq 0x124be
addq $0xe0, %r13
movq %r13, %rdi
leaq 0x260(%rsp), %rsi
callq 0x11942
leaq 0x260(%rsp), %rdi
callq 0xf5a0
leaq 0x230(%rsp), %rdi
callq 0xf618
leaq 0x200(%rsp), %rdi
callq 0xf668
leaq 0x1d0(%rsp), %rdi
callq 0xf1b6
leaq 0x1a0(%rsp), %rdi
callq 0xf6de
leaq 0x180(%rsp), %rdi
callq 0xf5e8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd1b7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movapd 0xd0(%rsp), %xmm0
addsd 0x140(%rsp), %xmm0
movapd %xmm0, 0xd0(%rsp)
movq 0x100(%rsp), %r14
movq 0x138(%rsp), %rdx
incq %r14
movl 0x38(%rsp), %ecx
incl %ecx
movq 0xa0(%rsp), %rax
cmpl (%rax,%rdx,4), %ecx
jl 0xcd66
incl %r12d
movl $0x1, %eax
cmpl 0x4c(%rsp), %r12d
jne 0xd228
incl %ebx
xorl %r12d, %r12d
cmpl 0x48(%rsp), %ebx
jne 0xd228
incl %r15d
movl 0x44(%rsp), %ebx
movl 0x3c(%rsp), %eax
cmpl 0x40(%rsp), %r15d
je 0xd240
addl %eax, %ebp
movslq %ebp, %rax
movq 0xa0(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0xd1fc
jmp 0xcd64
movsd 0x90(%rsp), %xmm0
mulsd 0x110(%rsp), %xmm0
mulsd 0x118(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
leaq 0x140317(%rip), %rdi    # 0x14d582
movb $0x1, %al
callq 0x4060
leaq 0x140334(%rip), %rdi    # 0x14d5ad
movaps 0xd0(%rsp), %xmm0
movb $0x1, %al
callq 0x4060
movapd 0xd0(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
subsd %xmm1, %xmm0
andpd 0x13fdfa(%rip), %xmm0   # 0x14d0a0
mulsd 0x13fd92(%rip), %xmm0   # 0x14d040
divsd %xmm1, %xmm0
ucomisd 0x13fd8e(%rip), %xmm0   # 0x14d048
movapd %xmm0, 0xd0(%rsp)
ja 0xd65d
movq 0x187cf0(%rip), %rdi    # 0x194fc0
leaq 0x140346(%rip), %rsi    # 0x14d61d
movl $0x46, %edx
callq 0x44e0
movq 0x187cd8(%rip), %rdi    # 0x194fc0
leaq 0x14632f(%rip), %rsi    # 0x15361e
movl $0x1, %edx
callq 0x44e0
movq 0x108(%rsp), %rdx
leaq 0x48(%rdx), %rsi
addq $0x60, %rdx
leaq 0x398(%rsp), %rdi
xorl %ecx, %ecx
callq 0x8015a
movq 0x88(%rsp), %rax
movl 0x110(%rax), %eax
testl %eax, %eax
jle 0xd621
leaq 0x180(%rsp), %rbx
xorl %r15d, %r15d
movq 0x50(%rsp), %rcx
cmpl $0x0, (%rcx,%r15,4)
je 0xd612
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0xc0(%rsp)
movapd %xmm0, 0xb0(%rsp)
movq 0xe0(%rsp), %rax
leaq (%r15,%r15,2), %r13
movq 0x8(%rax,%r13,8), %rdx
subq (%rax,%r13,8), %rdx
shrq $0x3, %rdx
movl (%rcx,%r15,4), %eax
leal (%rax,%rax,2), %ecx
cmpl %edx, %ecx
jne 0xd6f3
testl %eax, %eax
jle 0xd45f
movl $0x10, %ebp
xorl %r14d, %r14d
xorl %r12d, %r12d
movq 0xe0(%rsp), %rax
movq (%rax,%r13,8), %rax
movsd -0x10(%rax,%rbp), %xmm0
movsd -0x8(%rax,%rbp), %xmm1
movsd (%rax,%rbp), %xmm2
movq %rbx, %rdi
callq 0x83f68
movq 0xb8(%rsp), %rsi
cmpq 0xc0(%rsp), %rsi
je 0xd401
movq 0x190(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x180(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0xb8(%rsp)
jmp 0xd411
leaq 0xb0(%rsp), %rdi
movq %rbx, %rdx
callq 0x12d36
movq 0x30(%rsp), %rax
movq (%rax,%r15,8), %rdx
addq %r14, %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xd438
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xd442
leaq 0x10(%rsp), %rdi
callq 0xf864
incq %r12
movq 0x50(%rsp), %rax
movslq (%rax,%r15,4), %rax
addq $0x10, %r14
addq $0x18, %rbp
cmpq %rax, %r12
jl 0xd3a6
leaq 0x298(%rsp), %r14
movq %r14, %rdi
leaq 0xb0(%rsp), %rsi
callq 0xe868
leaq 0x280(%rsp), %r12
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0xe8f8
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6bbf0
movq 0x70(%rsp), %rax
movslq (%rax,%r15,4), %rax
movq 0x130(%rsp), %rcx
movq (%rcx), %r14
leaq (%rax,%rax,2), %r12
shlq $0x4, %r12
movq (%r14,%r12), %rdi
movq 0x10(%r14,%r12), %rsi
movaps 0x180(%rsp), %xmm0
movups %xmm0, (%r14,%r12)
movq 0x190(%rsp), %rax
movq %rax, 0x10(%r14,%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0x180(%rsp)
movq $0x0, 0x190(%rsp)
testq %rdi, %rdi
je 0xd4fd
subq %rdi, %rsi
callq 0x4470
addq %r12, %r14
movq 0x18(%r14), %rdi
movq 0x28(%r14), %rsi
movupd 0x198(%rsp), %xmm0
movupd %xmm0, 0x18(%r14)
movq 0x1a8(%rsp), %rax
movq %rax, 0x28(%r14)
leaq 0x198(%rsp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testq %rdi, %rdi
je 0xd565
subq %rdi, %rsi
callq 0x4470
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0xd565
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
movq 0x88(%rsp), %r14
je 0xd58a
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0xd5a7
movq 0x290(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x298(%rsp), %rdi
testq %rdi, %rdi
je 0xd5c4
movq 0x2a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0xd5d7
callq 0x4570
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xd5f4
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd60b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl 0x110(%r14), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0xd339
movq 0x30(%rsp), %rdi
callq 0x4570
movq 0x18798e(%rip), %rdi    # 0x194fc0
leaq 0x140085(%rip), %rsi    # 0x14d6be
movl $0x1f, %edx
callq 0x44e0
movq 0x187976(%rip), %rdi    # 0x194fc0
leaq 0x145fcd(%rip), %rsi    # 0x15361e
movl $0x1, %edx
callq 0x44e0
jmp 0xd673
leaq 0x13ff66(%rip), %rdi    # 0x14d5ca
movsd 0x13f9dc(%rip), %xmm1   # 0x14d048
movb $0x2, %al
callq 0x4060
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xd68d
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xe0(%rsp), %rdi
callq 0xefe6
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xd6b1
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movapd 0xd0(%rsp), %xmm0
ucomisd 0x13f986(%rip), %xmm0   # 0x14d048
setbe %bl
leaq 0x2b0(%rsp), %rdi
callq 0x121724
leaq 0x398(%rsp), %rdi
callq 0x7f6b8
movl %ebx, %eax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1878f6(%rip), %rdi    # 0x194ff0
leaq 0x13ff63(%rip), %rsi    # 0x14d664
movl $0x43, %edx
callq 0x44e0
movq 0x1878de(%rip), %rdi    # 0x194ff0
leaq 0x145f05(%rip), %rsi    # 0x15361e
movl $0x1, %edx
callq 0x44e0
movq 0x1878c6(%rip), %rdi    # 0x194ff0
leaq 0x13ff77(%rip), %rsi    # 0x14d6a8
movl $0x6, %edx
callq 0x44e0
movq 0xe0(%rsp), %rax
movq 0x8(%rax,%r13,8), %rsi
subq (%rax,%r13,8), %rsi
sarq $0x3, %rsi
movq 0x187899(%rip), %rdi    # 0x194ff0
callq 0x42b0
movq %rax, %rbx
leaq 0x13ff49(%rip), %rsi    # 0x14d6af
movl $0xe, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x50(%rsp), %rax
movl (%rax,%r15,4), %eax
leal (%rax,%rax,2), %esi
movq %rbx, %rdi
callq 0x4750
movq %rax, %rbx
leaq 0x145e8d(%rip), %rsi    # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x146f25(%rip), %rsi    # 0x1546ca
movl $0xa, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x145e65(%rip), %rsi    # 0x15361e
movq %rbx, %rdi
callq 0x4440
callq 0x72bc
callq 0x48ea
jmp 0xd8ac
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xf55c
jmp 0xd93f
jmp 0xd7fc
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xf4ca
jmp 0xd93f
movq %rax, %rbx
jmp 0xd93f
movq %rax, %rbx
jmp 0xd94c
jmp 0xd8ac
jmp 0xd8ac
movq %rax, %rbx
movq 0x168(%rsp), %rdi
testq %rdi, %rdi
je 0xd8b4
movq 0x178(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0xd8b4
jmp 0xd8c3
jmp 0xd8ac
movq %rax, %rbx
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0xd901
movq 0x190(%rsp), %rsi
jmp 0xd8f9
jmp 0xd8ca
movq %rax, %rbx
jmp 0xd88b
movq %rax, %rbx
movq 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0xd88b
movq 0x290(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x298(%rsp), %rdi
testq %rdi, %rdi
je 0xd8cd
movq 0x2a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0xd8cd
jmp 0xd8ca
movq %rax, %rbx
jmp 0xd901
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xf55c
jmp 0xd8ea
movq %rax, %rbx
jmp 0xd8ea
jmp 0xd8ca
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xd8ea
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd901
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xd91b
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xe0(%rsp), %rdi
callq 0xefe6
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xd93f
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x2b0(%rsp), %rdi
callq 0x121724
leaq 0x398(%rsp), %rdi
callq 0x7f6b8
movq %rbx, %rdi
callq 0x4780