// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/src/Node.cpp
// Function: fprime::Node::resolveComponent(std::shared_ptr<fprime::Component>)
void Node::resolveComponent(fprime::Component::ComponentPtr componentPtr) {
        // process fields
        vector<fprime::Component::FieldT> fields = componentPtr->getFields();
        vector<fprime::Component::FieldT>::iterator iter;
        for (iter = fields.begin(); iter < fields.end(); iter++) {
            fprime::Component::FieldT fieldt = *iter;
            string fieldType = fieldt.field->getDataType();
            fprime::Node::NodePtr child(new Node());
            //            if (fieldType == "NUMINGROUP") {
            //                child.setType(fprime::Node::REPEATING_GROUP);
            //                if (this->componentPtr == nullptr)
            //                    throw runtime_error("at Node.resolveComponent: Component for repeating group " + fieldt.field->getName() + " was not found.");
            //                else {
            //                    fprime::Field::FieldPtr ctrlFieldPtr = this->componentPtr->getControlField();
            //                    child.setField(ctrlFieldPtr);
            //                }
            //                //                cout << "Repeating control field resolved " << child.getField()->getId() << endl;
            //            } else {
            //
            //            };
            child->setType(fprime::Node::FIELD_NODE);
            child->setField(fieldt.field);

            child->setRequired(fieldt.isRequired);
            child->setProtocol(protocolPtr);
            appendChild(child);

        }

        // process components

        vector<fprime::Component::ComponentPtr> nestedComponents = componentPtr->getNestedComponents();
        vector<fprime::Component::ComponentPtr>::iterator cmpIter;
        for (cmpIter = nestedComponents.begin(); cmpIter < nestedComponents.end(); cmpIter++) {
            fprime::Component::ComponentPtr nestedComponent = *cmpIter;

            if (nestedComponent->getType() == "BlockRepeating") {

                fprime::Field::FieldPtr ctrlFieldPtr = nestedComponent->getControlField();
                fprime::Node::NodePtr child(new Node());
                child->setType(fprime::Node::REPEATING_GROUP);
                child->setField(ctrlFieldPtr);

                //TODO Define required
                child->setRequired(false);
                child->setProtocol(protocolPtr);
                child->setComponent(nestedComponent);
                appendChild(child);

            } else {
                resolveComponent(nestedComponent);
            }
        }


    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq (%rsi), %rsi
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x3e950
movq (%r14), %r13
leaq 0x98(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rbp
leaq 0x90(%rsp), %r12
leaq 0x80(%rsp), %r14
cmpq 0xc8(%rsp), %r13
jae 0x4f94f
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x40970
movq 0x20(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x40e10
movl $0xe8, %edi
callq 0x405e0
movq %rax, %r15
movq %rax, %rdi
callq 0x40660
movq %rbp, %rdi
movq %r15, %rsi
callq 0x418c0
movq 0x10(%rsp), %r15
movl $0x1, 0x8(%r15)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3f930
movq %r15, %rdi
movq %r12, %rsi
callq 0x408b0
leaq 0x98(%rsp), %rdi
callq 0x40650
movq 0x10(%rsp), %rax
movb 0x30(%rsp), %cl
movb %cl, 0x20(%rax)
movq 0xd0(%rbx), %rcx
movq %rcx, 0xd0(%rax)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3e1b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40f50
leaq 0x88(%rsp), %rdi
callq 0x40650
leaq 0x18(%rsp), %rdi
callq 0x40650
leaq 0xa0(%rsp), %rdi
callq 0x3ef50
leaq 0x28(%rsp), %rdi
callq 0x40650
addq $0x18, %r13
jmp 0x4f869
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x20(%rsp), %rdi
callq 0x40e90
movq 0x20(%rsp), %r12
leaq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %r15
leaq 0xa0(%rsp), %rbp
cmpq 0x28(%rsp), %r12
jae 0x4fae1
movq %r15, %rdi
movq %r12, %rsi
callq 0x3ffc0
movq 0x10(%rsp), %rsi
movq %rbp, %rdi
callq 0x3f790
movq %rbp, %rdi
leaq 0x16c36(%rip), %rsi     # 0x665e0
callq 0x42b50
movl %eax, %r14d
movq %rbp, %rdi
callq 0x3ef50
testb %r14b, %r14b
je 0x4faa9
movq 0x10(%rsp), %rsi
movq %rbp, %rdi
callq 0x41880
movl $0xe8, %edi
callq 0x405e0
movq %rax, %r14
movq %rax, %rdi
callq 0x40660
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x418c0
movq 0x40(%rsp), %r14
movl $0x2, 0x8(%r14)
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3f930
movq %r14, %rdi
movq %r13, %rsi
callq 0x408b0
leaq 0x78(%rsp), %rdi
callq 0x40650
movq 0x40(%rsp), %r14
movb $0x0, 0x20(%r14)
movq 0xd0(%rbx), %rax
movq %rax, 0xd0(%r14)
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x3ffc0
addq $0xd8, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x40350
leaq 0xe0(%rsp), %rdi
callq 0x40650
leaq 0x60(%rsp), %r14
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x3e1b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40f50
leaq 0x68(%rsp), %rdi
callq 0x40650
leaq 0x48(%rsp), %rdi
callq 0x40650
leaq 0xa8(%rsp), %rdi
jmp 0x4fac9
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ffc0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x409e0
leaq 0x58(%rsp), %rdi
callq 0x40650
leaq 0x18(%rsp), %rdi
callq 0x40650
addq $0x10, %r12
jmp 0x4f97d
leaq 0x20(%rsp), %rdi
callq 0x41b00
leaq 0xc0(%rsp), %rdi
callq 0x42550
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4fbd5
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x4fb63
jmp 0x4fb53
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x4fb30
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0x40650
leaq 0x48(%rsp), %rdi
callq 0x40650
jmp 0x4fb5b
movq %rax, %rbx
movq %r14, %rdi
callq 0x403f0
jmp 0x4fb5b
movq %rax, %rbx
jmp 0x4fb68
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x40650
leaq 0x18(%rsp), %rdi
callq 0x40650
leaq 0x20(%rsp), %rdi
callq 0x41b00
jmp 0x4fbd5
movq %rax, %rbx
jmp 0x4fbcb
movq %rax, %rbx
leaq 0x88(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x4fb98
movq %rax, %rbx
movq 0x38(%rsp), %rdi
callq 0x40650
leaq 0x18(%rsp), %rdi
callq 0x40650
jmp 0x4fbbe
movq %rax, %rbx
movq %r15, %rdi
callq 0x403f0
jmp 0x4fbbe
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x3ef50
leaq 0x28(%rsp), %rdi
callq 0x40650
leaq 0xc0(%rsp), %rdi
callq 0x42550
movq %rbx, %rdi
callq 0x42200