// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movl %r9d, 0x48(%rsp)
movl %r8d, 0x5c(%rsp)
movq %rcx, %r15
movq %rdx, 0x18(%rsp)
movq %rdi, 0x60(%rsp)
movq 0x10(%rsi), %rcx
movq %rsi, 0x50(%rsp)
leaq 0x8(%rsi), %rbp
movq %rbp, %rax
testq %rcx, %rcx
je 0x3a5d6
movq 0x18(%rsp), %rax
movl (%rax), %edx
movq %rbp, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x3a5bf
cmpq %rbp, %rax
je 0x3a5e9
movq 0x18(%rsp), %rcx
movl (%rcx), %ecx
cmpl 0x20(%rax), %ecx
cmovaeq %rax, %rbp
leaq 0x98(%rsp), %r13
movq 0x18(%rsp), %rax
incl (%rax)
movq (%r15), %rsi
movl 0x28(%rbp), %edx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2f9d0
movq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2e290
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a629
callq 0x2f370
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3a63d
callq 0x2f6c0
movq (%r15), %rsi
movl 0x28(%rbp), %edx
leaq 0x20(%rsp), %rdi
callq 0x2f9d0
movq 0x20(%rsp), %rdi
callq 0x300d0
movl %eax, %r14d
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3a669
callq 0x2f370
cmpl $0x1, %r14d
je 0x3a7e3
cmpl $0x2, %r14d
jne 0x3a848
movl $0x0, 0x4c(%rsp)
leaq 0x22(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x24(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rbp), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rbp), %rcx
addq %rax, %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rbx, %rdi
leaq 0x4c(%rsp), %rsi
callq 0x30fa0
testb %al, %al
je 0x3a8e6
movq %rbx, %rsi
movl 0x4c(%rsp), %ebx
movl 0x20(%rbp), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x2e3d0
movl (%rax), %ecx
movl %ecx, 0x20(%rsp)
leaq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2e8a0
testl %ebx, %ebx
je 0x3a7cd
movl $0x1, %r14d
movq (%r15), %rsi
movl 0x28(%rbp), %edx
leaq 0x8(%rsp), %rdi
callq 0x2f9d0
movq 0x8(%rsp), %rdi
callq 0x2f530
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a743
callq 0x2f370
movq %r13, %rdi
movq 0x50(%rsp), %rsi
callq 0x2efe0
movq (%r15), %rsi
movl 0x28(%rbp), %edx
leaq 0x8(%rsp), %rdi
callq 0x2f9d0
movq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movl %r14d, %edx
callq 0x30ba0
movl 0x20(%rsp), %r8d
movq 0x60(%rsp), %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rcx
movl $0x1, %r9d
callq 0x2e390
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3a7aa
callq 0x2f370
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a7b9
callq 0x2f370
movq %r13, %rdi
callq 0x2f630
incl %r14d
cmpl %ebx, %r14d
jbe 0x3a71a
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3a848
callq 0x2f6c0
jmp 0x3a848
movq (%r15), %rsi
movl 0x28(%rbp), %edx
leaq 0x20(%rsp), %rdi
callq 0x2f9d0
movq 0x20(%rsp), %r14
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x30(%rbp), %rsi
movq 0x38(%rbp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x2e8a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ecf0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3a839
callq 0x2f6c0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3a848
callq 0x2f370
cmpb $0x0, 0x48(%rsp)
je 0x3a86f
movl 0x20(%rbp), %eax
incl %eax
movl %eax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2e3d0
movl 0x5c(%rsp), %ecx
cmpl %ecx, (%rax)
je 0x3a8d2
movq 0x18(%rsp), %rax
movl (%rax), %r14d
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
xorl %ebx, %ebx
cmpq %rbp, %rax
je 0x3a894
movq %rax, %rdi
callq 0x2f100
incq %rbx
jmp 0x3a882
movq %r14, %rax
subq %rbx, %rax
jle 0x3a8b4
subq %r14, %rbx
movq %rbp, %rdi
callq 0x2f100
movq %rax, %rbp
incq %rbx
jne 0x3a89f
jmp 0x3a5f1
je 0x3a5f1
subq %r14, %rbx
movq %rbp, %rdi
callq 0x2f8d0
movq %rax, %rbp
decq %rbx
jne 0x3a8bd
jmp 0x3a5f1
movb $0x1, %al
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x37513(%rip), %rax     # 0x71e00
addq $0x10, %rax
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
movq 0x373f0(%rip), %rax     # 0x71cf0
movq %rax, 0x8(%rdi)
movq 0x3761d(%rip), %rax     # 0x71f28
movq %rax, 0x10(%rdi)
callq 0x2fd10
jmp 0x3a985
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3a988
callq 0x2f6c0
jmp 0x3a988
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x305c0
jmp 0x3aa03
movq %rdx, %r14
movq %rax, %rbx
jmp 0x3a95e
movq %rdx, %r14
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a95e
callq 0x2f370
cmpl $0x1, %r14d
jne 0x3aa03
movq %rbx, %rdi
callq 0x2e8b0
movq 0x18(%rsp), %rax
decl (%rax)
callq 0x30750
movl 0x48(%rsp), %eax
jmp 0x3a8d4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3aa03
callq 0x2f370
jmp 0x3aa03
movq %rax, %rbx
jmp 0x3a9c7
movq %rax, %rbx
jmp 0x3a9b8
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3a9b8
callq 0x2f370
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a9c7
callq 0x2f370
leaq 0x98(%rsp), %rdi
callq 0x2f630
jmp 0x3a9ef
jmp 0x3a9d8
movq %rax, %rbx
jmp 0x3a9ef
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3a9ef
callq 0x2f370
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3aa03
callq 0x2f6c0
movq %rbx, %rdi
callq 0x30a20
nop