// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/src/FixParser.cpp
// Function: fprime::FixParser::parseLevel(std::map<unsigned int, fprime::FixParser::FixPair, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, fprime::FixParser::FixPair>>>, unsigned int&, std::shared_ptr<fprime::Node>, unsigned int, bool)
bool FixParser::parseLevel(OrderedMap map, unsigned int& position, fprime::Node::NodePtr node, unsigned int groupBeginning, bool isGroupInstance) {
        int instanceCounter = 0;
        for (OrderedMap::iterator it = map.find(position); it != map.end(); std::advance(it, position - (std::distance(map.begin(), it)))) {
            position++;
            try {
                string val = node->getChild(it->second.field)->getValue();
            } catch (InvalidField& e) {
                position--;
                if (isGroupInstance) {
                    return true;
                } else {
                    return false;
                }
            }
            switch (node->getChild(it->second.field)->getType()) {
                case fprime::Node::FIELD_NODE:
                {
                    node->getChild(it->second.field)->setValue(it->second.value);
                    break;
                }
                case fprime::Node::REPEATING_GROUP:
                {
                    int value = boost::lexical_cast<unsigned int>(it->second.value);
//                    node(it->second.field).setValue(it->second.value);
                    FixPair fpair = map[it->first + 1];

                    for (unsigned int i = 1; i <= value; i++) {
                        node->getChild(it->second.field)->appendGroupInstance();
                        bool result = parseLevel(map, position, node->getChild(it->second.field)->getInstance(i), fpair.field, true);
                    }
                    break;
                }
            }
            if (isGroupInstance) {
                if (groupBeginning == map[it->first + 1].field) {
                    return true;
                }
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r9d, %r15d
movl %r8d, 0x24(%rsp)
movq %rcx, %r13
movq %rdx, %rbp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x18(%rsp)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x40a60
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x88(%rsp), %r12
movl %r15d, 0x20(%rsp)
movq %rbp, %rbx
incl (%rbp)
movq (%r13), %rsi
movl 0x28(%rax), %edx
leaq 0x8(%rsp), %rdi
callq 0x40840
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x3e480
leaq 0x10(%rsp), %rdi
callq 0x40650
movq %r14, %rdi
callq 0x3ef50
movq (%r13), %rsi
movq (%rsp), %rax
movl 0x28(%rax), %edx
movq %r14, %rdi
callq 0x40840
movq 0x28(%rsp), %rdi
callq 0x41340
movl %eax, %r14d
leaq 0x30(%rsp), %rdi
callq 0x40650
cmpl $0x1, %r14d
je 0x4b49c
cmpl $0x2, %r14d
jne 0x4b4f9
movq (%rsp), %rdi
addq $0x30, %rdi
callq 0x3eda0
movl %eax, %r15d
movq (%rsp), %rax
movl 0x20(%rax), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3e670
leaq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x3f820
pushq $0x1
popq %r14
cmpl %r15d, %r14d
ja 0x4b4ea
movq (%r13), %rsi
movq (%rsp), %rax
movl 0x28(%rax), %edx
leaq 0x8(%rsp), %rdi
callq 0x40840
movq 0x8(%rsp), %rdi
callq 0x401c0
leaq 0x10(%rsp), %rdi
callq 0x40650
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x3f8c0
movq (%r13), %rsi
movq (%rsp), %rax
movl 0x28(%rax), %edx
leaq 0x8(%rsp), %rdi
callq 0x40840
movq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
movl %r14d, %edx
callq 0x42440
movl 0x28(%rsp), %r8d
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
pushq $0x1
popq %r9
callq 0x3e610
leaq 0x60(%rsp), %rdi
callq 0x40650
leaq 0x10(%rsp), %rdi
callq 0x40650
movq %r12, %rdi
callq 0x40310
incl %r14d
jmp 0x4b3f3
movq (%r13), %rsi
movq (%rsp), %rax
movl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
callq 0x40840
movq 0x28(%rsp), %r14
movq (%rsp), %rsi
addq $0x30, %rsi
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
callq 0x412d0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3f400
movq %rbp, %rdi
callq 0x3ef50
leaq 0x30(%rsp), %rdi
callq 0x40650
jmp 0x4b4f9
leaq 0x30(%rsp), %rdi
callq 0x3ef50
movl 0x20(%rsp), %r15d
testb %r15b, %r15b
je 0x4b522
movq (%rsp), %rax
movl 0x20(%rax), %eax
incl %eax
movl %eax, 0x28(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x3e670
movl 0x24(%rsp), %ecx
cmpl %ecx, (%rax)
je 0x4b593
movq %rbx, %rbp
movl (%rbx), %r14d
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rsp), %rsi
callq 0x3eaa0
subq %rax, %r14
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3e430
movq (%rsp), %rax
jmp 0x4b33d
jmp 0x4b5a8
movq %rax, %r12
leaq 0x68(%rsp), %rdi
callq 0x3ef50
jmp 0x4b5ab
movq %rdx, %r14
movq %rax, %r12
jmp 0x4b57a
movq %rdx, %r14
movq %rax, %r12
leaq 0x10(%rsp), %rdi
callq 0x40650
cmpl $0x1, %r14d
jne 0x4b605
movq %r12, %rdi
callq 0x3ed90
decl (%rbx)
callq 0x41d30
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq 0x30(%rsp), %rdi
callq 0x40650
jmp 0x4b605
jmp 0x4b5e9
movq %rax, %r12
jmp 0x4b5da
movq %rax, %r12
jmp 0x4b5d0
movq %rax, %r12
leaq 0x60(%rsp), %rdi
callq 0x40650
leaq 0x10(%rsp), %rdi
callq 0x40650
leaq 0x88(%rsp), %rdi
callq 0x40310
jmp 0x4b5fb
movq %rax, %r12
jmp 0x4b5fb
movq %rax, %r12
leaq 0x10(%rsp), %rdi
callq 0x40650
leaq 0x30(%rsp), %rdi
callq 0x3ef50
movq %r12, %rdi
callq 0x42200
nop