// File: IncredibleHannes[P]QMUL-ChessGame/src/View/View.cpp
// Function: View::loadFromFile[abi:cxx11]() const
std::list<Move*> View::loadFromFile() const {
  std::list<Move*> moves;
  std::ifstream myStream("./SaveFile.txt");
  if(!myStream.is_open()) {
    std::cout << "There is no savefile to open" << std::endl;
    myStream.close();
    return moves;
  }
  std::string line;
  while(getline(myStream,line)) {
    if (line.size() == 5) {
      moves.push_back(new Move(Position(line.substr(0, 2)), Position(line.substr(3, 5))));
    }
  }
  myStream.close();
  return moves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x2c0(%rbp)
movq %rdi, %rax
movq %rax, -0x2b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x9150
leaq 0x837(%rip), %rsi       # 0xc43b
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x2270
jmp 0xbc17
leaq -0x220(%rbp), %rdi
callq 0x2230
movb %al, -0x2c1(%rbp)
jmp 0xbc2b
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0xbcbb
jmp 0xbc3b
movq 0x638e(%rip), %rdi      # 0x11fd0
leaq 0x801(%rip), %rsi       # 0xc44a
callq 0x2150
movq %rax, -0x2d0(%rbp)
jmp 0xbc57
movq -0x2d0(%rbp), %rdi
movq 0x635b(%rip), %rsi      # 0x11fc0
callq 0x2180
jmp 0xbc6c
leaq -0x220(%rbp), %rdi
callq 0x2060
jmp 0xbc7a
movb $0x1, -0x11(%rbp)
movl $0x1, -0x230(%rbp)
jmp 0xbec9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0xbf07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0xbedd
leaq -0x250(%rbp), %rdi
callq 0x21e0
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x2050
movq %rax, -0x2d8(%rbp)
jmp 0xbce3
movq -0x2d8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x21b0
movb %al, -0x2d9(%rbp)
jmp 0xbd01
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0xbd10
jmp 0xbe91
leaq -0x250(%rbp), %rdi
callq 0x2100
cmpq $0x5, %rax
jne 0xbe8c
movl $0x20, %edi
callq 0x2160
movq %rax, -0x2e8(%rbp)
jmp 0xbd39
movb $0x1, -0x2a9(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x280(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x2, %ecx
callq 0x2170
jmp 0xbd5e
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x2e70
jmp 0xbd73
leaq -0x2a8(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x3, %edx
movl $0x5, %ecx
callq 0x2170
jmp 0xbd92
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x2e70
jmp 0xbda7
movq -0x2e8(%rbp), %rdi
movq -0x260(%rbp), %rsi
movq -0x288(%rbp), %rdx
callq 0x68b0
jmp 0xbdc3
movq -0x2c0(%rbp), %rdi
movq -0x2e8(%rbp), %rax
movb $0x0, -0x2a9(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x258(%rbp), %rsi
callq 0x9400
jmp 0xbded
leaq -0x2a8(%rbp), %rdi
callq 0x20f0
leaq -0x280(%rbp), %rdi
callq 0x20f0
jmp 0xbe8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0xbebb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0xbe73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0xbe67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x20f0
leaq -0x280(%rbp), %rdi
callq 0x20f0
testb $0x1, -0x2a9(%rbp)
jne 0xbe7e
jmp 0xbe8a
movq -0x2e8(%rbp), %rdi
callq 0x2140
jmp 0xbebb
jmp 0xbcc7
leaq -0x220(%rbp), %rdi
callq 0x2060
jmp 0xbe9f
movb $0x1, -0x11(%rbp)
movl $0x1, -0x230(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x20f0
jmp 0xbec9
leaq -0x250(%rbp), %rdi
callq 0x20f0
jmp 0xbedd
leaq -0x220(%rbp), %rdi
callq 0x2070
testb $0x1, -0x11(%rbp)
jne 0xbef7
jmp 0xbeeb
leaq -0x220(%rbp), %rdi
callq 0x2070
jmp 0xbf07
movq -0x2c0(%rbp), %rdi
callq 0x2bb0
movq -0x2b8(%rbp), %rax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x2c0(%rbp), %rdi
callq 0x2bb0
movq -0x228(%rbp), %rdi
callq 0x2260