// File: Kingsford-Group[P]ghost2/src/readFromNet.hpp
// Function: readFromNet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
Graph readFromNet(string fileName, bool directed)
{ 
  ptime t = bclock::local_time();
  Graph result;
  result.direct(directed);
  ifstream fin(fileName);
  if(!fin.good()) 
  {
    cout << "error loading file: " << fileName << "\n";
    exit(0);
  }
  unsigned start = fileName.find_last_of("/");
  unsigned end = fileName.find(".net");
  if(start == string::npos) start = -1;
  string name = fileName.substr(start+1,end-start-1);
  result.setName(name);

  int N,E;
  fin >> N >> E;
  for(int i=0;i<N;i++)
  {
    string n;
    fin >> n;
    result.addVertex(n);
  }
  for(int i=0;i<E;i++)
  {
    string n1,n2;
    fin >> n1 >> n2;
    result.addEdge(n1, n2);
  }
  fin.close();
  cout << "extracted: " << result.getName() << ".net in " <<
    (bclock::local_time() - t).total_milliseconds() << " milliseconds\n";
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movq %rsi, -0x3a8(%rbp)
movq %rdi, -0x398(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x3a0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
callq 0x23b20
movq -0x398(%rbp), %rdi
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x23b50
movq -0x398(%rbp), %rdi
movzbl -0x11(%rbp), %esi
andl $0x1, %esi
callq 0x23bb0
jmp 0x13dd0
movq -0x3a8(%rbp), %rsi
leaq -0x240(%rbp), %rdi
movl $0x8, %edx
callq 0x10bd0
jmp 0x13dea
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x240(%rbp,%rax), %rdi
callq 0x10c60
movb %al, -0x3a9(%rbp)
jmp 0x13e0a
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x13e8c
jmp 0x13e16
movq 0x11d17b(%rip), %rdi    # 0x130f98
leaq 0xa892b(%rip), %rsi     # 0xbc74f
callq 0x106c0
movq %rax, -0x3b8(%rbp)
jmp 0x13e32
movq -0x3a8(%rbp), %rsi
movq -0x3b8(%rbp), %rdi
callq 0x10600
movq %rax, -0x3c0(%rbp)
jmp 0x13e4e
movq -0x3c0(%rbp), %rdi
leaq 0xa87ab(%rip), %rsi     # 0xbc607
callq 0x106c0
jmp 0x13e63
xorl %edi, %edi
callq 0x10890
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x14343
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x14319
movq -0x3a8(%rbp), %rdi
leaq 0xa863f(%rip), %rsi     # 0xbc4d9
movq $-0x1, %rdx
callq 0x10650
movq -0x3a8(%rbp), %rdi
movl %eax, -0x244(%rbp)
leaq 0xa8906(%rip), %rsi     # 0xbc7c0
xorl %eax, %eax
movl %eax, %edx
callq 0x10e30
movl %eax, -0x248(%rbp)
movl -0x244(%rbp), %eax
cmpq $-0x1, %rax
jne 0x13edf
movl $0xffffffff, -0x244(%rbp) # imm = 0xFFFFFFFF
movq -0x3a8(%rbp), %rsi
movl -0x244(%rbp), %eax
movl %eax, %ecx
incl %ecx
movl %ecx, %edx
movl -0x248(%rbp), %ecx
notl %eax
addl %ecx, %eax
movl %eax, %ecx
leaq -0x268(%rbp), %rdi
callq 0x10740
jmp 0x13f0c
leaq -0x288(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x10300
jmp 0x13f21
movq -0x398(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x23c60
jmp 0x13f36
leaq -0x288(%rbp), %rdi
callq 0x10460
leaq -0x240(%rbp), %rdi
leaq -0x28c(%rbp), %rsi
callq 0x10440
movq %rax, -0x3c8(%rbp)
jmp 0x13f5e
movq -0x3c8(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x10440
jmp 0x13f73
movl $0x0, -0x294(%rbp)
movl -0x294(%rbp), %eax
cmpl -0x28c(%rbp), %eax
jge 0x14072
leaq -0x2b8(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x109f0
movq -0x3d0(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x10910
jmp 0x13fb7
leaq -0x2d8(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x10300
jmp 0x13fcc
movq -0x398(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x239b0
jmp 0x13fe1
leaq -0x2d8(%rbp), %rdi
callq 0x10460
leaq -0x2b8(%rbp), %rdi
callq 0x10460
movl -0x294(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x294(%rbp)
jmp 0x13f7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1430d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x10460
jmp 0x1430d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x14061
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x10460
leaq -0x2b8(%rbp), %rdi
callq 0x10460
jmp 0x1430d
movl $0x0, -0x2dc(%rbp)
movl -0x2dc(%rbp), %eax
cmpl -0x290(%rbp), %eax
jge 0x141c5
leaq -0x300(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0x109f0
leaq -0x320(%rbp), %rdi
callq 0x109f0
movq -0x3e0(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x10910
movq %rax, -0x3d8(%rbp)
jmp 0x140c9
movq -0x3d8(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x10910
jmp 0x140de
leaq -0x340(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x10300
jmp 0x140f3
leaq -0x360(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x10300
jmp 0x14108
movq -0x398(%rbp), %rdi
leaq -0x340(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0x23a80
jmp 0x14124
leaq -0x360(%rbp), %rdi
callq 0x10460
leaq -0x340(%rbp), %rdi
callq 0x10460
leaq -0x320(%rbp), %rdi
callq 0x10460
leaq -0x300(%rbp), %rdi
callq 0x10460
movl -0x2dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2dc(%rbp)
jmp 0x1407c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x141a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1419c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x10460
leaq -0x340(%rbp), %rdi
callq 0x10460
leaq -0x320(%rbp), %rdi
callq 0x10460
leaq -0x300(%rbp), %rdi
callq 0x10460
jmp 0x1430d
leaq -0x240(%rbp), %rdi
callq 0x10170
jmp 0x141d3
movq 0x11cdbe(%rip), %rdi    # 0x130f98
leaq 0xa85ba(%rip), %rsi     # 0xbc79b
callq 0x106c0
movq %rax, -0x3e8(%rbp)
jmp 0x141ef
movq -0x398(%rbp), %rsi
leaq -0x380(%rbp), %rdi
callq 0x23c90
jmp 0x14204
movq -0x3e8(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x10600
movq %rax, -0x3f0(%rbp)
jmp 0x14220
movq -0x3f0(%rbp), %rdi
leaq 0xa8597(%rip), %rsi     # 0xbc7c5
callq 0x106c0
movq %rax, -0x3f8(%rbp)
jmp 0x1423c
callq 0x23b20
movq %rax, -0x400(%rbp)
jmp 0x1424a
movq -0x400(%rbp), %rax
movq %rax, -0x390(%rbp)
leaq -0x390(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x23cc0
movq %rax, -0x408(%rbp)
jmp 0x14271
movq -0x408(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x23cf0
movq %rax, -0x410(%rbp)
jmp 0x14294
movq -0x410(%rbp), %rsi
movq -0x3f8(%rbp), %rdi
callq 0x10d40
movq %rax, -0x418(%rbp)
jmp 0x142b0
movq -0x418(%rbp), %rdi
leaq 0xa84f3(%rip), %rsi     # 0xbc7b1
callq 0x106c0
jmp 0x142c5
leaq -0x380(%rbp), %rdi
callq 0x10460
movb $0x1, -0x21(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x10460
leaq -0x240(%rbp), %rdi
callq 0x101b0
testb $0x1, -0x21(%rbp)
jne 0x14333
jmp 0x14327
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x10460
leaq -0x268(%rbp), %rdi
callq 0x10460
leaq -0x240(%rbp), %rdi
callq 0x101b0
jmp 0x14343
movq -0x398(%rbp), %rdi
callq 0x23d50
movq -0x3a0(%rbp), %rax
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
movq -0x398(%rbp), %rdi
callq 0x23d50
movq -0x30(%rbp), %rdi
callq 0x10cc0
nopl (%rax,%rax)