// File: wandernauta[P]ttasks/TodoList.cpp
// Function: TodoList::parse()
void TodoList::parse() {
  tasks.clear();

  std::ifstream ifs(path.c_str());

  if (!ifs.good()) {
    std::cerr << "Fatal: Can't open " << path.c_str() << "." << std::endl;
    exit(1);
  }

  while (ifs.good()) {
    std::string line = "";
    getline(ifs, line);

    if (line != "") {
      int taskno = atoi(line.c_str());
      std::string::size_type taskdesc = line.find_first_not_of("1234567890. ");
      if (taskdesc == std::string::npos) continue;
      tasks[taskno] = std::string(line, taskdesc); 
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x5d90
movq -0x288(%rbp), %rdi
addq $0x30, %rdi
callq 0x3110
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
movl $0x8, %edx
callq 0x3430
movq -0x210(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x210(%rbp,%rax), %rdi
callq 0x33d0
movb %al, -0x27a(%rbp)
jmp 0x4f03
movb -0x27a(%rbp), %al
testb $0x1, %al
jne 0x4fa9
jmp 0x4f13
movq 0x80d6(%rip), %rdi      # 0xcff0
leaq 0x42d6(%rip), %rsi      # 0x91f7
callq 0x3240
movq %rax, -0x290(%rbp)
jmp 0x4f2f
movq -0x288(%rbp), %rdi
addq $0x30, %rdi
callq 0x3110
movq -0x290(%rbp), %rdi
movq %rax, %rsi
callq 0x3240
movq %rax, -0x298(%rbp)
jmp 0x4f57
movq -0x298(%rbp), %rdi
leaq 0x4151(%rip), %rsi      # 0x90b6
callq 0x3240
movq %rax, -0x2a0(%rbp)
jmp 0x4f73
movq -0x2a0(%rbp), %rdi
movq 0x803f(%rip), %rsi      # 0xcfc0
callq 0x3290
jmp 0x4f88
movl $0x1, %edi
callq 0x3300
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x51fb
jmp 0x4fab
movq -0x210(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x210(%rbp,%rax), %rdi
callq 0x33d0
movb %al, -0x2a1(%rbp)
jmp 0x4fcb
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x4fda
jmp 0x51e6
leaq -0x241(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x3410
movq -0x2b0(%rbp), %rdx
leaq 0x4160(%rip), %rsi      # 0x915b
leaq -0x240(%rbp), %rdi
callq 0x48b0
jmp 0x5009
leaq -0x241(%rbp), %rdi
callq 0x32b0
leaq -0x210(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3080
jmp 0x502a
leaq 0x412a(%rip), %rsi      # 0x915b
leaq -0x240(%rbp), %rdi
callq 0x5db0
movb %al, -0x2b1(%rbp)
jmp 0x5045
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x5054
jmp 0x51ac
leaq -0x240(%rbp), %rdi
callq 0x3110
movq %rax, %rdi
callq 0x33a0
movl %eax, -0x248(%rbp)
leaq -0x240(%rbp), %rdi
leaq 0x40d3(%rip), %rsi      # 0x914f
xorl %eax, %eax
movl %eax, %edx
callq 0x3160
movq %rax, -0x250(%rbp)
cmpq $-0x1, -0x250(%rbp)
jne 0x50df
movl $0x2, -0x254(%rbp)
jmp 0x51b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x241(%rbp), %rdi
callq 0x32b0
jmp 0x51fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x51d8
movq -0x250(%rbp), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x279(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x3410
movq -0x2c8(%rbp), %rdx
movq -0x2c0(%rbp), %rcx
leaq -0x278(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3030
jmp 0x5123
movq -0x288(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x5b30
movq %rax, -0x2d0(%rbp)
jmp 0x513f
movq -0x2d0(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3320
leaq -0x278(%rbp), %rdi
callq 0x3190
leaq -0x279(%rbp), %rdi
callq 0x32b0
jmp 0x51ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x519e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x3190
leaq -0x279(%rbp), %rdi
callq 0x32b0
jmp 0x51d8
movl $0x0, -0x254(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x3190
movl -0x254(%rbp), %eax
testl %eax, %eax
je 0x51d3
jmp 0x51ce
jmp 0x4fab
jmp 0x4fab
leaq -0x240(%rbp), %rdi
callq 0x3190
jmp 0x51fb
leaq -0x210(%rbp), %rdi
callq 0x30b0
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
leaq -0x210(%rbp), %rdi
callq 0x30b0
movq -0x218(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)