// File: j84guo[P]cake/cake.cpp
// Function: parseTargets(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Target, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, Target>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool parseTargets(TargetMap& nodes, vector<string>& lines)
{
    unsigned int lineNo = 1;
    auto it = lines.begin();

    while (it != lines.end()) {
        if (it->find_first_not_of(' ') == string::npos) {
            ++it; ++lineNo;
            continue;
        }

        auto pos = it->find(":");
        if ((pos == string::npos) || !pos) {
            lineError(lineNo, "no target");
            return false;
        }

        string name = it->substr(0, pos);
        nodes.emplace(name, name);
        parseAdjacent(it->substr(pos + 1), nodes.at(name));

        while (++it != lines.end() && ++lineNo) {
            if (!parseTask(*it, nodes.at(name).tasks))
                break;
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3920
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3990
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3950
testb $0x1, %al
jne 0x2caa
jmp 0x2f6e
leaq -0x28(%rbp), %rdi
callq 0x39c0
movq %rax, %rdi
movl $0x20, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2200
cmpq $-0x1, %rax
jne 0x2cde
leaq -0x28(%rbp), %rdi
callq 0x39e0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c87
leaq -0x28(%rbp), %rdi
callq 0x39c0
movq %rax, %rdi
leaq 0x5360(%rip), %rsi      # 0x8051
xorl %eax, %eax
movl %eax, %edx
callq 0x23f0
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x38(%rbp)
je 0x2d10
cmpq $0x0, -0x38(%rbp)
jne 0x2d9f
movl -0x1c(%rbp), %eax
movl %eax, -0xd4(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x23a0
movq -0xd0(%rbp), %rdx
leaq 0x531c(%rip), %rsi      # 0x8053
leaq -0x58(%rbp), %rdi
callq 0x37d0
jmp 0x2d42
movl -0xd4(%rbp), %edi
leaq -0x58(%rbp), %rsi
callq 0x29e0
jmp 0x2d53
leaq -0x58(%rbp), %rdi
callq 0x2140
leaq -0x59(%rbp), %rdi
callq 0x2270
movb $0x0, -0x1(%rbp)
jmp 0x2f72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x2140
leaq -0x59(%rbp), %rdi
callq 0x2270
jmp 0x2f80
leaq -0x28(%rbp), %rdi
callq 0x39c0
movq %rax, %rsi
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x90(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x2240
movq -0xf0(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq %rdx, %rsi
callq 0x3a00
movb %dl, -0xe1(%rbp)
movq %rax, -0xe0(%rbp)
jmp 0x2de8
movb -0xe1(%rbp), %al
movq -0xe0(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movb %al, -0x98(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x39c0
movq %rax, %rsi
movq -0x38(%rbp), %rdx
incq %rdx
leaq -0xc0(%rbp), %rdi
movq $-0x1, %rcx
callq 0x2240
jmp 0x2e2a
movq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3a50
movq %rax, -0xf8(%rbp)
jmp 0x2e43
movq -0xf8(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x2ac0
jmp 0x2e58
leaq -0xc0(%rbp), %rdi
callq 0x2140
leaq -0x28(%rbp), %rdi
callq 0x39e0
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3990
movq -0x108(%rbp), %rdi
movq %rax, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x3950
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xf9(%rbp)
jne 0x2ea8
jmp 0x2ebd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x2ecc
jmp 0x2f4f
leaq -0x28(%rbp), %rdi
callq 0x3a80
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3a50
movq %rax, -0x110(%rbp)
jmp 0x2ef5
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rsi
addq $0x38, %rsi
callq 0x2ba0
movb %al, -0x119(%rbp)
jmp 0x2f14
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x2f4a
jmp 0x2f20
jmp 0x2f4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2f60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x2140
jmp 0x2f60
jmp 0x2e64
leaq -0x90(%rbp), %rdi
callq 0x2140
jmp 0x2c87
leaq -0x90(%rbp), %rdi
callq 0x2140
jmp 0x2f80
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x2390
nopl (%rax)