// File: /workspace/github_cpp_makefile_star2_O1/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 $0x488, %rsp            # imm = 0x488
movl %r9d, 0xb8(%rsp)
movq %rcx, %r14
movsd %xmm2, 0x130(%rsp)
movsd %xmm1, 0x128(%rsp)
movsd %xmm0, 0xa0(%rsp)
movq %rdx, 0x120(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x3a8(%rsp), %rdi
movsd 0x1425b2(%rip), %xmm0   # 0x14f030
movq %r15, %rsi
callq 0x8266c
movq %r15, 0xa8(%rsp)
movsd 0x178(%r15), %xmm0
leaq 0x2c0(%rsp), %rdi
callq 0x122cd0
movq 0x4c0(%rsp), %r15
leaq 0x18a20d(%rip), %rax    # 0x196cc0
movq %rax, 0x2c0(%rsp)
leaq 0x142a14(%rip), %rdi    # 0x14f4d6
callq 0x4660
movq (%r14), %rsi
movq %r14, %rdi
callq 0xf9f6
movq (%r15), %rsi
movq %r15, %rdi
callq 0xfa26
movq %rbx, 0x60(%rsp)
movslq 0x110(%rbx), %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x6c730
leaq 0x1c0(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf8d4
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xcb26
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xcb43
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rax
movslq 0x110(%rax), %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x6b2d6
movq %r14, 0x138(%rsp)
leaq 0x1c0(%rsp), %rdx
movq 0x4c0(%rsp), %rdi
movq %rbx, %rsi
callq 0xf91c
leaq 0x2a0(%rsp), %rdi
callq 0xf4f6
leaq 0x270(%rsp), %rdi
callq 0xf568
leaq 0x240(%rsp), %rdi
callq 0xf5b8
leaq 0x210(%rsp), %rdi
callq 0xf118
leaq 0x1e0(%rsp), %rdi
callq 0xf62e
leaq 0x1c0(%rsp), %rdi
callq 0xf538
xorl %r12d, %r12d
movq %r12, 0x50(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq %r12, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movq 0xa8(%rsp), %rax
movl 0x128(%rax), %ebp
movl 0x180(%rax), %r14d
movl 0x1cc(%rax), %ecx
movl %ecx, 0xbc(%rsp)
movq 0x1a8(%rax), %rcx
movq %rcx, 0x148(%rsp)
movq 0x1a0(%rax), %rcx
movq %rcx, 0x140(%rsp)
movq 0x1b0(%rax), %r15
movl 0x184(%rax), %r13d
movl 0x188(%rax), %ecx
movl %ecx, 0x78(%rsp)
movl 0x18c(%rax), %ecx
movl %ecx, 0x74(%rsp)
movl 0x190(%rax), %ebx
movq %r12, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movq 0x60(%rsp), %rax
movslq 0x110(%rax), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x4030
movq %rax, 0x68(%rsp)
movl %ebp, %eax
imull %r14d, %eax
leal 0x1(,%rax,2), %eax
movl %eax, 0x70(%rsp)
imull %r13d, %ebx
addl %r14d, %ebx
movl %ebp, 0x7c(%rsp)
imull %ebp, %ebx
movslq %ebx, %rax
movq %r15, 0xb0(%rsp)
cmpl $0x0, (%r15,%rax,4)
setne %al
movl %r14d, %ebp
movl %r14d, 0x18(%rsp)
jne 0xcd1e
xorl %eax, %eax
xorl %r12d, %r12d
incl %r12d
movl $0x1, %ecx
cmpl 0x7c(%rsp), %r12d
jne 0xcd02
incl %ebp
xorl %r12d, %r12d
cmpl 0x78(%rsp), %ebp
jne 0xcd02
incl %r13d
xorl %r12d, %r12d
movl 0x18(%rsp), %ebp
movl 0x70(%rsp), %ecx
cmpl 0x74(%rsp), %r13d
je 0xcd1a
addl %ecx, %ebx
movslq %ebx, %rax
movq 0xb0(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
setne %al
je 0xccd3
jmp 0xcd1e
movl 0x18(%rsp), %ebp
testb $0x1, %al
je 0xd779
addq $0x1f8, 0xa8(%rsp) # imm = 0x1F8
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x14(%rsp)
movl %r13d, (%rsp)
movq 0xa8(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
movl %ebx, %edx
movl 0x14(%rsp), %ecx
movl %r12d, %r8d
movl %ebp, %r9d
callq 0x142f28
movslq %ebx, %rcx
movq %rcx, 0x118(%rsp)
testb %al, %al
je 0xce94
leaq 0x2c0(%rsp), %rdi
callq 0x12454e
movsd %xmm0, 0x150(%rsp)
movq %r14, 0x110(%rsp)
movl 0x14(%rsp), %ecx
movl %ecx, %edx
movl 0xbc(%rsp), %esi
imull %esi, %edx
movq 0x140(%rsp), %rax
movq 0x118(%rsp), %rdi
movq (%rax,%rdi,8), %rax
movslq %ecx, %rcx
movslq (%rax,%rcx,4), %rax
movl %eax, 0x1c(%rsp)
movq 0x148(%rsp), %rcx
movq (%rcx,%rdi,8), %rcx
movslq %edx, %rdx
movsd 0x142252(%rip), %xmm0   # 0x14f038
cmpl $0x3, %esi
je 0xcdf1
movsd 0x18(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x170(%rsp)
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x168(%rsp)
movsd 0x8(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x160(%rsp)
movsd 0x10(%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x158(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x60(%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 0x2c0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x126836
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xcf77
movl 0x2dc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0xcf89
movl $0x0, 0x1c0(%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xcebc
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0xcece
leaq 0x40(%rsp), %rdi
leaq 0x1c0(%rsp), %rdx
callq 0x1422c
movl $0xffffffff, 0x1c0(%rsp) # imm = 0xFFFFFFFF
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0xcf07
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x88(%rsp)
leaq 0x1c0(%rsp), %r15
jmp 0xcf1f
leaq 0x80(%rsp), %rdi
leaq 0x1c0(%rsp), %r15
movq %r15, %rdx
callq 0x1422c
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
movq $0x0, 0x1d0(%rsp)
leaq 0xf0(%rsp), %rdi
movq %r15, %rsi
callq 0x12afa
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xcf65
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x68(%rsp), %rax
movq $0x0, (%rax,%r14,8)
jmp 0xd1d2
leaq 0x40(%rsp), %rdi
leaq 0x2dc(%rsp), %rdx
callq 0xf7b4
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0xcfaf
movl 0x1c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rsp)
jmp 0xcfc1
leaq 0x80(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
callq 0xf7b4
leaq 0xf0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xee9a
movl 0x1c(%rsp), %r15d
movslq 0x2dc(%rsp), %rax
movq %rax, %rdi
shlq $0x4, %rdi
testq %rax, %rax
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x4030
movq %rax, %r14
leaq 0x3a8(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
movl %r15d, %edx
movsd 0x168(%rsp), %xmm0
movsd 0x160(%rsp), %xmm1
movsd 0x158(%rsp), %xmm2
movsd 0x170(%rsp), %xmm3
movq %rax, %rcx
callq 0x829ee
movq 0x68(%rsp), %rax
movq 0x110(%rsp), %rcx
movq %r14, (%rax,%rcx,8)
cmpb $0x0, 0xb8(%rsp)
je 0xd198
leaq 0x1c0(%rsp), %rdi
callq 0x6b2d6
leaq 0x178(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xf964
leaq 0x2c0(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %r14, %rdx
leaq 0x1c0(%rsp), %rcx
callq 0x7844
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0xd0b7
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movslq 0x1c(%rsp), %rax
imulq $0xf8, %rax, %r14
movq 0x4c0(%rsp), %rax
addq (%rax), %r14
movq %r14, %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x11892
movl 0x1d8(%rsp), %eax
movl %eax, 0x18(%r14)
leaq 0x20(%r14), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x11cf2
leaq 0x50(%r14), %rdi
leaq 0x210(%rsp), %rsi
callq 0x11f8a
leaq 0x80(%r14), %rdi
leaq 0x240(%rsp), %rsi
callq 0x12214
leaq 0xb0(%r14), %rdi
leaq 0x270(%rsp), %rsi
callq 0x124da
addq $0xe0, %r14
movq %r14, %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x11968
leaq 0x2a0(%rsp), %rdi
callq 0xf4f6
leaq 0x270(%rsp), %rdi
callq 0xf568
leaq 0x240(%rsp), %rdi
callq 0xf5b8
leaq 0x210(%rsp), %rdi
callq 0xf118
leaq 0x1e0(%rsp), %rdi
callq 0xf62e
leaq 0x1c0(%rsp), %rdi
callq 0xf538
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd1af
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movapd 0xe0(%rsp), %xmm0
addsd 0x150(%rsp), %xmm0
movapd %xmm0, 0xe0(%rsp)
movq 0x110(%rsp), %r14
movl 0x14(%rsp), %edx
incl %edx
movb $0x1, %al
movq 0xb0(%rsp), %rcx
movl %edx, 0x14(%rsp)
movq 0x118(%rsp), %rsi
cmpl (%rcx,%rsi,4), %edx
jl 0xd23f
movl %ebx, %ecx
incl %r12d
movl $0x1, %ebx
cmpl 0x7c(%rsp), %r12d
jne 0xd224
incl %ebp
xorl %r12d, %r12d
cmpl 0x78(%rsp), %ebp
jne 0xd224
incl %r13d
xorl %r12d, %r12d
cmpl 0x74(%rsp), %r13d
je 0xd250
movl 0x18(%rsp), %ebp
movl 0x70(%rsp), %ebx
addl %ecx, %ebx
movslq %ebx, %rcx
movq 0xb0(%rsp), %rdx
cmpl $0x0, (%rdx,%rcx,4)
je 0xd1f3
movl $0x0, 0x14(%rsp)
movl %ebx, %ecx
incq %r14
movl %ecx, %ebx
testb %al, %al
jne 0xcd4a
jmp 0xd260
movl 0x18(%rsp), %ebp
movl $0x0, 0x14(%rsp)
xorl %eax, %eax
jmp 0xd241
movsd 0xa0(%rsp), %xmm0
mulsd 0x128(%rsp), %xmm0
mulsd 0x130(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
leaq 0x1422a7(%rip), %rdi    # 0x14f532
movb $0x1, %al
callq 0x4060
leaq 0x1422c4(%rip), %rdi    # 0x14f55d
movaps 0xe0(%rsp), %xmm0
movb $0x1, %al
callq 0x4060
movapd 0xe0(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
subsd %xmm1, %xmm0
andpd 0x141dca(%rip), %xmm0   # 0x14f090
mulsd 0x141d72(%rip), %xmm0   # 0x14f040
divsd %xmm1, %xmm0
ucomisd 0x141d6e(%rip), %xmm0   # 0x14f048
movapd %xmm0, 0xe0(%rsp)
ja 0xd60d
movq 0x189cd0(%rip), %rdi    # 0x196fc0
leaq 0x1422d6(%rip), %rsi    # 0x14f5cd
movl $0x46, %edx
callq 0x44e0
movq 0x189cb8(%rip), %rdi    # 0x196fc0
leaq 0x14821f(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x120(%rsp), %rdx
leaq 0x48(%rdx), %rsi
addq $0x60, %rdx
leaq 0x3a8(%rsp), %rdi
xorl %ecx, %ecx
callq 0x813aa
movq 0x60(%rsp), %rax
cmpl $0x0, 0x110(%rax)
jle 0xd5d1
leaq 0x1c0(%rsp), %r14
xorl %r15d, %r15d
movq 0x40(%rsp), %rax
cmpl $0x0, (%rax,%r15,4)
je 0xd5b9
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x30(%rsp)
movq %rcx, 0xd0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movq 0xf0(%rsp), %rcx
leaq (%r15,%r15,2), %rbp
movq 0x8(%rcx,%rbp,8), %rdx
subq (%rcx,%rbp,8), %rdx
shrq $0x3, %rdx
movl (%rax,%r15,4), %eax
leal (%rax,%rax,2), %eax
cmpl %edx, %eax
jne 0xd6a6
movq 0x40(%rsp), %rax
cmpl $0x0, (%rax,%r15,4)
jle 0xd483
movl $0x10, %ebx
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0xf0(%rsp), %rax
movq (%rax,%rbp,8), %rax
movsd -0x10(%rax,%rbx), %xmm0
movsd -0x8(%rax,%rbx), %xmm1
movsd (%rax,%rbx), %xmm2
movq %r14, %rdi
callq 0x85436
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0xd425
movq 0x1d0(%rsp), %rax
movq %rax, 0x10(%rsi)
movupd 0x1c0(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0xc8(%rsp)
jmp 0xd435
leaq 0xc0(%rsp), %rdi
movq %r14, %rdx
callq 0x12d92
movq 0x68(%rsp), %rax
movq (%rax,%r15,8), %rdx
addq %r12, %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0xd45c
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0xd466
leaq 0x20(%rsp), %rdi
callq 0xf7b4
incq %r13
movq 0x40(%rsp), %rax
movslq (%rax,%r15,4), %rax
addq $0x10, %r12
addq $0x18, %rbx
cmpq %rax, %r13
jl 0xd3ca
leaq 0x1a8(%rsp), %r12
movq %r12, %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe7f6
leaq 0x190(%rsp), %r13
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0xe886
movq 0x138(%rsp), %rbx
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6c7b0
movq 0x80(%rsp), %rax
movslq (%rax,%r15,4), %rax
movq (%rbx), %rbx
leaq (%rax,%rax,2), %r12
shlq $0x4, %r12
leaq (%rbx,%r12), %rdi
movq %r14, %rsi
callq 0x12d12
leaq (%rbx,%r12), %rdi
addq $0x18, %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x12d52
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0xd51b
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xd538
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0xd555
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0xd572
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x68(%rsp), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0xd585
callq 0x4570
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xd5a2
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd5b9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
incq %r15
movq 0x60(%rsp), %rax
movslq 0x110(%rax), %rax
cmpq %rax, %r15
jl 0xd355
movq 0x68(%rsp), %rdi
callq 0x4570
movq 0x1899de(%rip), %rdi    # 0x196fc0
leaq 0x142085(%rip), %rsi    # 0x14f66e
movl $0x1f, %edx
callq 0x44e0
movq 0x1899c6(%rip), %rdi    # 0x196fc0
leaq 0x147f2d(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
jmp 0xd623
leaq 0x141f66(%rip), %rdi    # 0x14f57a
movsd 0x141a2c(%rip), %xmm1   # 0x14f048
movb $0x2, %al
callq 0x4060
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xd640
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xf0(%rsp), %rdi
callq 0xef60
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd664
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movapd 0xe0(%rsp), %xmm0
ucomisd 0x1419d3(%rip), %xmm0   # 0x14f048
setbe %bl
leaq 0x2c0(%rsp), %rdi
callq 0x122f4a
leaq 0x3a8(%rsp), %rdi
callq 0x8091c
movl %ebx, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x189943(%rip), %rdi    # 0x196ff0
leaq 0x141f60(%rip), %rsi    # 0x14f614
movl $0x43, %edx
callq 0x44e0
movq 0x18992b(%rip), %rdi    # 0x196ff0
leaq 0x147e62(%rip), %rsi    # 0x15552e
movl $0x1, %edx
callq 0x44e0
movq 0x189913(%rip), %rdi    # 0x196ff0
leaq 0x141f74(%rip), %rsi    # 0x14f658
movl $0x6, %edx
callq 0x44e0
movq 0xf0(%rsp), %rax
movq 0x8(%rax,%rbp,8), %rsi
subq (%rax,%rbp,8), %rsi
sarq $0x3, %rsi
movq 0x1898e6(%rip), %rdi    # 0x196ff0
callq 0x42b0
movq %rax, %rbx
leaq 0x141f46(%rip), %rsi    # 0x14f65f
movl $0xe, %edx
movq %rax, %rdi
callq 0x44e0
movq 0x40(%rsp), %rax
movl (%rax,%r15,4), %eax
leal (%rax,%rax,2), %esi
movq %rbx, %rdi
callq 0x4750
movq %rax, %rbx
leaq 0x147dea(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x148e5a(%rip), %rsi    # 0x1565b2
movl $0xa, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x147dc2(%rip), %rsi    # 0x15552e
movq %rbx, %rdi
callq 0x4440
callq 0x710c
callq 0x48ea
jmp 0xd859
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0xf4b2
jmp 0xd8ed
jmp 0xd7af
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0xf420
jmp 0xd8ed
movq %rax, %rbx
jmp 0xd8ed
movq %rax, %rbx
jmp 0xd8fa
jmp 0xd859
jmp 0xd859
jmp 0xd859
jmp 0xd875
movq %rax, %rbx
jmp 0xd7f8
movq %rax, %rbx
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0xd7f8
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0xd878
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0xd878
jmp 0xd875
movq %rax, %rbx
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0xd861
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0xd861
jmp 0xd870
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xd8ac
movq 0x1d0(%rsp), %rsi
jmp 0xd8a4
jmp 0xd875
movq %rax, %rbx
jmp 0xd8ac
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0xf4b2
jmp 0xd895
movq %rax, %rbx
jmp 0xd895
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xd895
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd8ac
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0xd8c9
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0xf0(%rsp), %rdi
callq 0xef60
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd8ed
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x2c0(%rsp), %rdi
callq 0x122f4a
leaq 0x3a8(%rsp), %rdi
callq 0x8091c
movq %rbx, %rdi
callq 0x4780