// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/networkio.cc
// Function: readNet(std::istream*, VORONOI_NETWORK*)
void readNet(istream *input, VORONOI_NETWORK *vornet){
  char buff [256];
  input->getline(buff,256); // Read line "Vertex table:"
  VOR_NODE node;
  string garbage;

  // Read information about each Voronoi node
  int i = 0;
  while(true){
    (*input) >> garbage;
    if(strcmp(garbage.data(), "Edge") == 0)
      break;

    (*input) >> node.x >> node.y >> node.z >> node.rad_stat_sphere;

    // Read node connectivity information
    char *connectBuff = new char [256];
    char *origBuff = connectBuff;
    input->getline(connectBuff,256);
    connectBuff+= 1; //Skip space character
    char *currentChar = connectBuff;
    vector<int> nearestAtoms;

    while(true){
      if(*currentChar == ' ' || *currentChar == '\0'){
	char nextID[256];
	strncpy(nextID,connectBuff,currentChar-connectBuff);
	nextID[currentChar-connectBuff] = '\0';
	nearestAtoms.push_back(atoi(nextID));
	connectBuff = currentChar + 1;
      }
      if(*currentChar == '\0')
	break;
      currentChar++;
    }

    delete [] origBuff;
    node.atomIDs = nearestAtoms;
    vornet->nodes.push_back(node);
    i++;
  }

  input->getline(buff,256); // Reads remainder of line "Edge table:"

  //Read information about each Voronoi edge
  VOR_EDGE edge;
  while(!input->eof()){
    (*input) >> edge.from >> garbage >> edge.to >> edge.rad_moving_sphere
	     >> edge.delta_uc_x >> edge.delta_uc_y >> edge.delta_uc_z >> edge.length;
    vornet->edges.push_back(edge);
  }
  vornet->edges.pop_back();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %ecx
leaq 0x1a0(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0x4830
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x55554
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, 0x30(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0xa0(%rsp), %rbx
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4560
movq 0x38(%rsp), %rdi
leaq 0x125c3a(%rip), %rsi    # 0x150312
callq 0x45c0
testl %eax, %eax
je 0x2a821
movq %r14, %rdi
movq %r15, %rsi
callq 0x42a0
movq %rax, %rdi
leaq 0x68(%rsp), %rsi
callq 0x42a0
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0x42a0
movq %rax, %rdi
leaq 0x78(%rsp), %rsi
callq 0x42a0
movl $0x100, %edi            # imm = 0x100
callq 0x4030
movq %rax, %r15
movq %r14, %r12
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
movq %r15, %rsi
callq 0x4830
leaq 0x1(%r15), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r15, %rbp
addq $0x2, %rbp
movq %r12, %r13
movzbl -0x1(%rbp), %eax
testb $-0x21, %al
jne 0x2a7c8
movq %r12, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4210
movq %rbx, %rax
subq %r13, %rax
movb $0x0, (%rax,%r12)
movq %rbx, %rdi
callq 0x4680
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2a7b6
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x2a7c5
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x1422c
movq %rbp, %r13
incq %r12
cmpb $0x0, -0x1(%rbp)
leaq 0x1(%rbp), %rbp
jne 0x2a76d
movq %r15, %rdi
callq 0x4570
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1005e
leaq 0x60(%rsp), %r15
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xe962
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2a6bf
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x2a6bf
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4420
movsbl %al, %ecx
leaq 0x1a0(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0x4830
leaq 0xa0(%rsp), %rdi
callq 0x5550e
leaq 0xb8(%rsp), %rbp
leaq 0xc0(%rsp), %rbx
movq 0x30(%rsp), %rax
leaq 0x60(%rax), %r15
leaq 0xa0(%rsp), %r12
leaq 0x38(%rsp), %r13
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2a90b
movq %r14, %rdi
movq %r12, %rsi
callq 0x4270
movq %rax, %rdi
movq %r13, %rsi
callq 0x4560
movq %rax, %rdi
leaq 0xa4(%rsp), %rsi
callq 0x4270
movq %rax, %rdi
leaq 0xa8(%rsp), %rsi
callq 0x42a0
movq %rax, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x4270
movq %rax, %rdi
leaq 0xb4(%rsp), %rsi
callq 0x4270
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4270
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42a0
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9ba
jmp 0x2a880
movq 0x30(%rsp), %rax
addq $-0x28, 0x68(%rax)
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2a931
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2a94e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a988
jmp 0x2a988
jmp 0x2a988
jmp 0x2a96c
jmp 0x2a988
jmp 0x2a988
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2a98b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x2a98b
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2a9a7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2a9c4
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780