// File: 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
movq %rsp, %rbp
subq $0x760, %rsp            # imm = 0x760
movb %r9b, %al
movq 0x10(%rbp), %r9
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq %r8, -0x48(%rbp)
andb $0x1, %al
movb %al, -0x49(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x130(%rbp), %rdi
movsd 0x1e4d83(%rip), %xmm0   # 0x1f2030
callq 0xe5970
movq $0x0, -0x140(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x15b70
jmp 0xd2cf
leaq 0x1e51cf(%rip), %rdi    # 0x1f24a5
callq 0x57c0
jmp 0xd2dd
movq -0x40(%rbp), %rdi
callq 0x15bc0
movq 0x10(%rbp), %rdi
callq 0x15be0
movq -0x40(%rbp), %rax
movq %rax, -0x670(%rbp)
movq -0x18(%rbp), %rax
movslq 0x110(%rax), %rax
movq %rax, -0x668(%rbp)
leaq -0x288(%rbp), %rdi
callq 0xbd340
jmp 0xd31a
movq -0x668(%rbp), %rsi
movq -0x670(%rbp), %rdi
leaq -0x288(%rbp), %rdx
callq 0x15c00
jmp 0xd336
leaq -0x288(%rbp), %rdi
callq 0x138c0
movq 0x10(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x18(%rbp), %rax
movslq 0x110(%rax), %rax
movq %rax, -0x678(%rbp)
leaq -0x380(%rbp), %rdi
callq 0xbbd70
jmp 0xd36d
movq -0x678(%rbp), %rsi
movq -0x680(%rbp), %rdi
leaq -0x380(%rbp), %rdx
callq 0x15cb0
jmp 0xd389
leaq -0x380(%rbp), %rdi
callq 0x13b00
leaq -0x398(%rbp), %rdi
callq 0xd0d0
movl $0x0, -0x39c(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x105a0
movq -0x10(%rbp), %rsi
leaq -0x418(%rbp), %rdi
callq 0x15d60
jmp 0xd3c9
leaq -0x430(%rbp), %rdi
callq 0xd0d0
movq -0x18(%rbp), %rax
movslq 0x110(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5030
movq %rax, -0x688(%rbp)
jmp 0xd404
movq -0x688(%rbp), %rax
movq %rax, -0x438(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x15df0
movb %al, -0x689(%rbp)
jmp 0xd426
movb -0x689(%rbp), %al
testb $0x1, %al
jne 0xd435
jmp 0xd89a
jmp 0xd437
movq -0x10(%rbp), %rdi
leaq -0x248(%rbp), %rsi
leaq -0x418(%rbp), %rdx
callq 0x15e60
movb %al, -0x68a(%rbp)
jmp 0xd456
movb -0x68a(%rbp), %al
testb $0x1, %al
jne 0xd465
jmp 0xd7a3
leaq -0x248(%rbp), %rdi
callq 0x1ae080
movsd %xmm0, -0x698(%rbp)
jmp 0xd47b
movsd -0x698(%rbp), %xmm1
movsd -0x140(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x140(%rbp)
leaq -0x418(%rbp), %rdi
leaq -0x134(%rbp), %rsi
leaq -0x148(%rbp), %rdx
leaq -0x150(%rbp), %rcx
leaq -0x158(%rbp), %r8
leaq -0x160(%rbp), %r9
callq 0x15ec0
jmp 0xd4c8
leaq -0x458(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0xf650
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x134(%rbp), %rsi
callq 0xfcc0
movsd (%rax), %xmm0
movsd %xmm0, -0x6b0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x134(%rbp), %rsi
callq 0xfcc0
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x6a8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x134(%rbp), %rsi
callq 0xfcc0
movsd -0x6b0(%rbp), %xmm0
movsd -0x6a8(%rbp), %xmm1
movq -0x6a0(%rbp), %rsi
movsd 0x10(%rax), %xmm2
leaq -0x248(%rbp), %rdi
callq 0x1b0e50
jmp 0xd563
leaq -0x22c(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0xd1b0
jmp 0xd578
leaq -0x430(%rbp), %rdi
leaq -0x134(%rbp), %rsi
callq 0xd1b0
jmp 0xd58d
leaq -0x3b8(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x10630
jmp 0xd5a2
movl -0x134(%rbp), %edx
movsd -0x148(%rbp), %xmm0
movsd -0x150(%rbp), %xmm1
movsd -0x158(%rbp), %xmm2
movsd -0x160(%rbp), %xmm3
leaq -0x130(%rbp), %rdi
leaq -0x248(%rbp), %rsi
leaq -0x440(%rbp), %rcx
callq 0x15fb0
jmp 0xd5e4
movq -0x440(%rbp), %rdx
movq -0x438(%rbp), %rax
movslq -0x39c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
testb $0x1, -0x49(%rbp)
je 0xd781
leaq -0x550(%rbp), %rdi
callq 0xbbd70
jmp 0xd615
leaq -0x568(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x16050
jmp 0xd62a
movq -0x440(%rbp), %rdx
leaq -0x248(%rbp), %rdi
leaq -0x568(%rbp), %rsi
leaq -0x550(%rbp), %rcx
callq 0x73c0
jmp 0xd64d
leaq -0x568(%rbp), %rdi
callq 0xf9d0
movq 0x10(%rbp), %rdi
movslq -0x134(%rbp), %rsi
callq 0x16140
movq %rax, %rdi
leaq -0x550(%rbp), %rsi
callq 0x16160
jmp 0xd67a
leaq -0x550(%rbp), %rdi
callq 0x13b00
jmp 0xd781
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xdf67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xdf5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x138c0
jmp 0xdf5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x13b00
jmp 0xdf5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xdf43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xdf37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xd792
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xd773
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x568(%rbp), %rdi
callq 0xf9d0
leaq -0x550(%rbp), %rdi
callq 0x13b00
jmp 0xd792
leaq -0x458(%rbp), %rdi
callq 0xf9d0
jmp 0xd865
leaq -0x458(%rbp), %rdi
callq 0xf9d0
jmp 0xdf37
movl $0x0, -0x56c(%rbp)
leaq -0x398(%rbp), %rdi
leaq -0x56c(%rbp), %rsi
callq 0xffc0
jmp 0xd7c2
movl $0xffffffff, -0x570(%rbp) # imm = 0xFFFFFFFF
leaq -0x430(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0xffc0
jmp 0xd7e1
xorps %xmm0, %xmm0
movaps %xmm0, -0x590(%rbp)
movq $0x0, -0x580(%rbp)
leaq -0x590(%rbp), %rdi
movq %rdi, -0x6b8(%rbp)
callq 0xf650
movq -0x6b8(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
callq 0x16210
jmp 0xd81e
leaq -0x590(%rbp), %rdi
callq 0xf9d0
movq -0x438(%rbp), %rax
movslq -0x39c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0xd865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x590(%rbp), %rdi
callq 0xf9d0
jmp 0xdf37
movl -0x39c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x39c(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x16240
movb %al, -0x6b9(%rbp)
jmp 0xd888
movb -0x6b9(%rbp), %al
testb $0x1, %al
jne 0xd437
jmp 0xd898
jmp 0xd8bc
movq 0x26572f(%rip), %rax    # 0x272fd0
movq (%rax), %rsi
leaq 0x1e4c1c(%rip), %rdi    # 0x1f24c7
callq 0x5610
jmp 0xd8b2
movl $0x1, %edi
callq 0x67c0
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
leaq 0x1e4c27(%rip), %rdi    # 0x1f2501
movb $0x1, %al
callq 0x5070
jmp 0xd8e3
movsd -0x140(%rbp), %xmm0
leaq 0x1e4c3a(%rip), %rdi    # 0x1f252c
movb $0x1, %al
callq 0x5070
jmp 0xd8fb
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x598(%rbp)
movsd -0x140(%rbp), %xmm0
movsd -0x598(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x162b0
movsd %xmm0, -0x6c8(%rbp)
jmp 0xd93d
movsd -0x6c8(%rbp), %xmm1
movsd 0x1e46f3(%rip), %xmm0   # 0x1f2040
mulsd %xmm1, %xmm0
divsd -0x598(%rbp), %xmm0
movsd %xmm0, -0x5a0(%rbp)
movsd 0x1e46cf(%rip), %xmm0   # 0x1f2038
movsd %xmm0, -0x5a8(%rbp)
movsd -0x5a0(%rbp), %xmm0
ucomisd -0x5a8(%rbp), %xmm0
jbe 0xd9b6
movsd -0x5a0(%rbp), %xmm0
movsd -0x5a8(%rbp), %xmm1
leaq 0x1e4baf(%rip), %rdi    # 0x1f2549
movb $0x2, %al
callq 0x5070
jmp 0xd9a3
movb $0x0, -0x1(%rbp)
movl $0x1, -0x5ac(%rbp)
jmp 0xdeed
movq 0x265603(%rip), %rdi    # 0x272fc0
leaq 0x1e4bd8(%rip), %rsi    # 0x1f259c
callq 0x5540
movq %rax, -0x6d0(%rbp)
jmp 0xd9d2
movq -0x6d0(%rbp), %rdi
leaq 0x1ebc45(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xd9e7
movq -0x20(%rbp), %rdx
movq %rdx, %rsi
addq $0x48, %rsi
addq $0x60, %rdx
leaq -0x130(%rbp), %rdi
xorl %ecx, %ecx
callq 0xe3d80
jmp 0xda06
movl $0x0, -0x5b0(%rbp)
movl -0x5b0(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x110(%rcx), %eax
jge 0xde8e
movslq -0x5b0(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0xed60
cmpl $0x0, (%rax)
jne 0xda43
jmp 0xde1f
leaq -0x5c8(%rbp), %rdi
callq 0xd0d0
leaq -0x5e0(%rbp), %rdi
callq 0xed40
movslq -0x5b0(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
callq 0x162d0
movq %rax, %rdi
callq 0xf990
movl %eax, -0x6d4(%rbp)
movslq -0x5b0(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0xed60
movq %rax, %rcx
movl -0x6d4(%rbp), %eax
imull $0x3, (%rcx), %ecx
cmpl %ecx, %eax
je 0xdbe3
movq 0x265546(%rip), %rdi    # 0x272ff0
leaq 0x1e4b32(%rip), %rsi    # 0x1f25e3
callq 0x5540
movq %rax, -0x6e0(%rbp)
jmp 0xdabf
movq -0x6e0(%rbp), %rdi
leaq 0x1ebb58(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x6e8(%rbp)
jmp 0xdadb
movq -0x6e8(%rbp), %rdi
leaq 0x1e4b3e(%rip), %rsi    # 0x1f2627
callq 0x5540
movq %rax, -0x6f0(%rbp)
jmp 0xdaf7
movslq -0x5b0(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
callq 0x162d0
movq %rax, %rdi
callq 0xf990
movq -0x6f0(%rbp), %rdi
movq %rax, %rsi
callq 0x5160
movq %rax, -0x6f8(%rbp)
jmp 0xdb2a
movq -0x6f8(%rbp), %rdi
leaq 0x1e4af6(%rip), %rsi    # 0x1f262e
callq 0x5540
movq %rax, -0x700(%rbp)
jmp 0xdb46
movslq -0x5b0(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0xed60
movq -0x700(%rbp), %rdi
movl (%rax), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %esi
callq 0x58d0
movq %rax, -0x708(%rbp)
jmp 0xdb75
movq -0x708(%rbp), %rdi
leaq 0x1ebaa2(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x710(%rbp)
jmp 0xdb91
movq -0x710(%rbp), %rdi
leaq 0x1ed77b(%rip), %rsi    # 0x1fb31a
callq 0x5540
movq %rax, -0x718(%rbp)
jmp 0xdbad
movq -0x718(%rbp), %rdi
leaq 0x1eba6a(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xdbc2
movl $0x1, %edi
callq 0x67c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xde71
movl $0x0, -0x5e4(%rbp)
movl -0x5e4(%rbp), %eax
movl %eax, -0x71c(%rbp)
movslq -0x5b0(%rbp), %rsi
leaq -0x398(%rbp), %rdi
callq 0xed60
movq %rax, %rcx
movl -0x71c(%rbp), %eax
cmpl (%rcx), %eax
jge 0xdd36
movslq -0x5b0(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
movq %rdi, -0x738(%rbp)
callq 0x162d0
movq %rax, %rdi
movl -0x5e4(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movslq %eax, %rsi
callq 0xedb0
movq -0x738(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x730(%rbp)
movslq -0x5b0(%rbp), %rsi
callq 0x162d0
movq %rax, %rdi
movl -0x5e4(%rbp), %ecx
movl %ecx, %eax
leal 0x1(%rax,%rax,2), %eax
movslq %eax, %rsi
callq 0xedb0
movq -0x738(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x728(%rbp)
movslq -0x5b0(%rbp), %rsi
callq 0x162d0
movq %rax, %rdi
movl -0x5e4(%rbp), %ecx
movl %ecx, %eax
leal 0x2(%rax,%rax,2), %eax
movslq %eax, %rsi
callq 0xedb0
movsd -0x730(%rbp), %xmm0
movsd -0x728(%rbp), %xmm1
movsd (%rax), %xmm2
leaq -0x600(%rbp), %rdi
callq 0xe9c70
jmp 0xdcdb
leaq -0x5e0(%rbp), %rdi
leaq -0x600(%rbp), %rsi
callq 0xed80
jmp 0xdcf0
movq -0x438(%rbp), %rax
movslq -0x5b0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x5e4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
leaq (%rax,%rcx,4), %rsi
leaq -0x5c8(%rbp), %rdi
callq 0xd1b0
jmp 0xdd20
jmp 0xdd22
movl -0x5e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5e4(%rbp)
jmp 0xdbed
leaq -0x648(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0xedd0
jmp 0xdd4b
leaq -0x660(%rbp), %rdi
leaq -0x5c8(%rbp), %rsi
callq 0xeec0
jmp 0xdd60
leaq -0x630(%rbp), %rdi
leaq -0x648(%rbp), %rsi
leaq -0x660(%rbp), %rdx
callq 0xbd3d0
jmp 0xdd7c
movq -0x40(%rbp), %rax
movq %rax, -0x748(%rbp)
movslq -0x5b0(%rbp), %rsi
leaq -0x430(%rbp), %rdi
callq 0xed60
movq -0x748(%rbp), %rdi
movslq (%rax), %rsi
callq 0x162f0
movq %rax, %rdi
leaq -0x630(%rbp), %rsi
callq 0x16310
leaq -0x630(%rbp), %rdi
callq 0x138c0
leaq -0x660(%rbp), %rdi
callq 0xec80
leaq -0x648(%rbp), %rdi
callq 0xefe0
movq -0x438(%rbp), %rax
movslq -0x5b0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x740(%rbp)
cmpq $0x0, %rax
je 0xde07
movq -0x740(%rbp), %rdi
callq 0x56c0
leaq -0x5e0(%rbp), %rdi
callq 0xefe0
leaq -0x5c8(%rbp), %rdi
callq 0xec80
movl -0x5b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5b0(%rbp)
jmp 0xda10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0xde65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x660(%rbp), %rdi
callq 0xec80
leaq -0x648(%rbp), %rdi
callq 0xefe0
leaq -0x5e0(%rbp), %rdi
callq 0xefe0
leaq -0x5c8(%rbp), %rdi
callq 0xec80
jmp 0xdf37
movq -0x438(%rbp), %rax
movq %rax, -0x750(%rbp)
cmpq $0x0, %rax
je 0xdeae
movq -0x750(%rbp), %rdi
callq 0x56c0
movq 0x26510b(%rip), %rdi    # 0x272fc0
leaq 0x1e4781(%rip), %rsi    # 0x1f263d
callq 0x5540
movq %rax, -0x758(%rbp)
jmp 0xdeca
movq -0x758(%rbp), %rdi
leaq 0x1eb74d(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xdedf
movb $0x1, -0x1(%rbp)
movl $0x1, -0x5ac(%rbp)
leaq -0x430(%rbp), %rdi
callq 0xec80
leaq -0x3b8(%rbp), %rdi
callq 0x10790
leaq -0x398(%rbp), %rdi
callq 0xec80
leaq -0x248(%rbp), %rdi
callq 0x16350
leaq -0x130(%rbp), %rdi
callq 0xe2cb0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x760, %rsp            # imm = 0x760
popq %rbp
retq
leaq -0x430(%rbp), %rdi
callq 0xec80
leaq -0x3b8(%rbp), %rdi
callq 0x10790
leaq -0x398(%rbp), %rdi
callq 0xec80
leaq -0x248(%rbp), %rdi
callq 0x16350
leaq -0x130(%rbp), %rdi
callq 0xe2cb0
movq -0x250(%rbp), %rdi
callq 0x58f0
nop