// File: guitld[P]Graph-Algorithms/source/Graph.cpp
// Function: Graph::fromPajek(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Graph::fromPajek(string filename){

     ifstream pajekFile(filename);

     string line;
     string directed;
     string token1;
     string token2;
     string token3;
     getline(pajekFile, line);
     getline(pajekFile, directed);

     // 'Arcs' represents a directed graph
     if (directed[1] == 'A'){
          while (getline(pajekFile, line)){
               if(!isdigit(line[0])) continue;
               token1 = line.substr(0, line.find(' '));
               token2 = line.substr(token1.size(), line.find(' ', token1.size() + 1));
               token2.erase(token2.begin());
               token3 = line.substr(token1.size() + token2.size(), line.find('\n'));
               this->add_directed_edge(stoi(token1), stoi(token2), stoi(token3));
          }
          pajekFile.close();
     }
     // 'Edges' representes an undirected graph 
     else {
          while (getline(pajekFile, line)){
               if(!isdigit(line[0])) continue;  
               token1 = line.substr(0, line.find(' '));
               token2 = line.substr(token1.size(), line.find(' ', token1.size() + 1));
               token2.erase(token2.begin());
               token3 = line.substr(token1.size() + token2.size(), line.find('\n'));
               this->addEdge(stoi(token1), stoi(token2), stoi(token3));
          }
          pajekFile.close();
     }


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
movl $0x8, %edx
callq 0x2270
leaq -0x238(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x2230
leaq -0x258(%rbp), %rdi
callq 0x2230
leaq -0x278(%rbp), %rdi
callq 0x2230
leaq -0x298(%rbp), %rdi
callq 0x2230
leaq -0x2b8(%rbp), %rdi
callq 0x2230
movq -0x3c8(%rbp), %rdi
movq -0x3c0(%rbp), %rsi
callq 0x2050
jmp 0x330e
leaq -0x218(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x2050
jmp 0x3323
leaq -0x258(%rbp), %rdi
movl $0x1, %esi
callq 0x22d0
movq %rax, -0x3d8(%rbp)
jmp 0x333d
movq -0x3d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0x3694
jmp 0x3352
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x2050
movq %rax, -0x3e0(%rbp)
jmp 0x336e
movq -0x3e0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2200
movb %al, -0x3e1(%rbp)
jmp 0x338c
movb -0x3e1(%rbp), %al
testb $0x1, %al
jne 0x339b
jmp 0x3681
xorl %eax, %eax
movl %eax, %esi
leaq -0x238(%rbp), %rdi
callq 0x22d0
movq %rax, -0x3f0(%rbp)
jmp 0x33b4
movq -0x3f0(%rbp), %rax
movsbl (%rax), %edi
callq 0x2180
cmpl $0x0, %eax
jne 0x3429
jmp 0x3352
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2c0(%rbp)
movl %eax, -0x2c4(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x2120
leaq -0x298(%rbp), %rdi
callq 0x2120
leaq -0x278(%rbp), %rdi
callq 0x2120
leaq -0x258(%rbp), %rdi
callq 0x2120
leaq -0x238(%rbp), %rdi
callq 0x2120
leaq -0x218(%rbp), %rdi
callq 0x2070
jmp 0x39c7
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x3f8(%rbp)
leaq -0x238(%rbp), %rdi
movq %rdi, -0x400(%rbp)
movl $0x20, %esi
callq 0x2210
movq -0x400(%rbp), %rsi
movq -0x3f8(%rbp), %rdx
movq %rax, %rcx
leaq -0x2e8(%rbp), %rdi
callq 0x21c0
jmp 0x346b
leaq -0x278(%rbp), %rdi
movq %rdi, -0x418(%rbp)
leaq -0x2e8(%rbp), %rsi
movq %rsi, -0x420(%rbp)
callq 0x21e0
movq -0x420(%rbp), %rdi
callq 0x2120
movq -0x418(%rbp), %rdi
callq 0x2130
movq -0x418(%rbp), %rdi
movq %rax, -0x408(%rbp)
callq 0x2130
movq %rax, %rdx
incq %rdx
leaq -0x238(%rbp), %rdi
movq %rdi, -0x410(%rbp)
movl $0x20, %esi
callq 0x2210
movq -0x410(%rbp), %rsi
movq -0x408(%rbp), %rdx
movq %rax, %rcx
leaq -0x308(%rbp), %rdi
callq 0x21c0
jmp 0x34f4
leaq -0x298(%rbp), %rdi
movq %rdi, -0x430(%rbp)
leaq -0x308(%rbp), %rsi
movq %rsi, -0x438(%rbp)
callq 0x21e0
movq -0x438(%rbp), %rdi
callq 0x2120
movq -0x430(%rbp), %rdi
callq 0x2160
movq %rax, -0x318(%rbp)
leaq -0x310(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x5b70
movq -0x430(%rbp), %rdi
movq -0x310(%rbp), %rsi
callq 0x21f0
movq %rax, -0x428(%rbp)
jmp 0x3563
movq -0x428(%rbp), %rax
movq %rax, -0x320(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x2130
movq %rax, -0x450(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
movq -0x450(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x440(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x238(%rbp), %rdi
movq %rdi, -0x448(%rbp)
movl $0xa, %esi
callq 0x2210
movq -0x448(%rbp), %rsi
movq -0x440(%rbp), %rdx
movq %rax, %rcx
leaq -0x340(%rbp), %rdi
callq 0x21c0
jmp 0x35df
leaq -0x2b8(%rbp), %rdi
leaq -0x340(%rbp), %rsi
movq %rsi, -0x460(%rbp)
callq 0x21e0
movq -0x460(%rbp), %rdi
callq 0x2120
xorl %eax, %eax
movl %eax, %esi
leaq -0x278(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x454(%rbp)
jmp 0x3622
xorl %eax, %eax
movl %eax, %esi
leaq -0x298(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x464(%rbp)
jmp 0x363f
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b8(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x468(%rbp)
jmp 0x365c
movl -0x468(%rbp), %ecx
movl -0x464(%rbp), %edx
movl -0x454(%rbp), %esi
movq -0x3d0(%rbp), %rdi
callq 0x3030
jmp 0x367c
jmp 0x3352
leaq -0x218(%rbp), %rdi
callq 0x2060
jmp 0x368f
jmp 0x3976
jmp 0x3696
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x2050
movq %rax, -0x470(%rbp)
jmp 0x36b2
movq -0x470(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2200
movb %al, -0x471(%rbp)
jmp 0x36d0
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x36df
jmp 0x3966
xorl %eax, %eax
movl %eax, %esi
leaq -0x238(%rbp), %rdi
callq 0x22d0
movq %rax, -0x480(%rbp)
jmp 0x36f8
movq -0x480(%rbp), %rax
movsbl (%rax), %edi
callq 0x2180
cmpl $0x0, %eax
jne 0x370e
jmp 0x3696
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x488(%rbp)
leaq -0x238(%rbp), %rdi
movq %rdi, -0x490(%rbp)
movl $0x20, %esi
callq 0x2210
movq -0x490(%rbp), %rsi
movq -0x488(%rbp), %rdx
movq %rax, %rcx
leaq -0x360(%rbp), %rdi
callq 0x21c0
jmp 0x3750
leaq -0x278(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
leaq -0x360(%rbp), %rsi
movq %rsi, -0x4b0(%rbp)
callq 0x21e0
movq -0x4b0(%rbp), %rdi
callq 0x2120
movq -0x4a8(%rbp), %rdi
callq 0x2130
movq -0x4a8(%rbp), %rdi
movq %rax, -0x498(%rbp)
callq 0x2130
movq %rax, %rdx
incq %rdx
leaq -0x238(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
movl $0x20, %esi
callq 0x2210
movq -0x4a0(%rbp), %rsi
movq -0x498(%rbp), %rdx
movq %rax, %rcx
leaq -0x380(%rbp), %rdi
callq 0x21c0
jmp 0x37d9
leaq -0x298(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
leaq -0x380(%rbp), %rsi
movq %rsi, -0x4c8(%rbp)
callq 0x21e0
movq -0x4c8(%rbp), %rdi
callq 0x2120
movq -0x4c0(%rbp), %rdi
callq 0x2160
movq %rax, -0x390(%rbp)
leaq -0x388(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x5b70
movq -0x4c0(%rbp), %rdi
movq -0x388(%rbp), %rsi
callq 0x21f0
movq %rax, -0x4b8(%rbp)
jmp 0x3848
movq -0x4b8(%rbp), %rax
movq %rax, -0x398(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x2130
movq %rax, -0x4e0(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
movq -0x4e0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x4d0(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x238(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
movl $0xa, %esi
callq 0x2210
movq -0x4d8(%rbp), %rsi
movq -0x4d0(%rbp), %rdx
movq %rax, %rcx
leaq -0x3b8(%rbp), %rdi
callq 0x21c0
jmp 0x38c4
leaq -0x2b8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
movq %rsi, -0x4f0(%rbp)
callq 0x21e0
movq -0x4f0(%rbp), %rdi
callq 0x2120
xorl %eax, %eax
movl %eax, %esi
leaq -0x278(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x4e4(%rbp)
jmp 0x3907
xorl %eax, %eax
movl %eax, %esi
leaq -0x298(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x4f4(%rbp)
jmp 0x3924
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b8(%rbp), %rdi
movl $0xa, %edx
callq 0x5bb0
movl %eax, -0x4f8(%rbp)
jmp 0x3941
movl -0x4f8(%rbp), %ecx
movl -0x4f4(%rbp), %edx
movl -0x4e4(%rbp), %esi
movq -0x3d0(%rbp), %rdi
callq 0x2fb0
jmp 0x3961
jmp 0x3696
leaq -0x218(%rbp), %rdi
callq 0x2060
jmp 0x3974
jmp 0x3976
leaq -0x2b8(%rbp), %rdi
callq 0x2120
leaq -0x298(%rbp), %rdi
callq 0x2120
leaq -0x278(%rbp), %rdi
callq 0x2120
leaq -0x258(%rbp), %rdi
callq 0x2120
leaq -0x238(%rbp), %rdi
callq 0x2120
leaq -0x218(%rbp), %rdi
callq 0x2070
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq
movq -0x2c0(%rbp), %rdi
callq 0x22c0
nopw %cs:(%rax,%rax)