// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rdi, %rbx
movq %rsi, 0xa8(%rsp)
movq (%rsi), %rsi
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x2e5c0
movq (%r14), %rbp
cmpq 0x8(%r14), %rbp
jae 0x3fb34
movq (%rbp), %r12
movq 0x8(%rbp), %r14
testq %r14, %r14
je 0x3f9fe
movq 0x3246a(%rip), %rax     # 0x71e58
cmpb $0x0, (%rax)
je 0x3f9f9
incl 0x8(%r14)
jmp 0x3f9fe
lock
incl 0x8(%r14)
movb 0x10(%rbp), %r15b
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x2fdd0
movl $0xe8, %edi
callq 0x2f830
movq %rax, %r13
movq %rax, %rdi
callq 0x2f880
movq %r13, (%rsp)
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x2e4a0
movq (%rsp), %rdi
movl $0x1, 0x8(%rdi)
movq %r12, 0x98(%rsp)
movq %r14, 0xa0(%rsp)
testq %r14, %r14
je 0x3fa6c
movq 0x323fc(%rip), %rax     # 0x71e58
cmpb $0x0, (%rax)
je 0x3fa67
incl 0x8(%r14)
jmp 0x3fa6c
lock
incl 0x8(%r14)
leaq 0x98(%rsp), %rsi
callq 0x2fa10
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x3fa8b
callq 0x2f370
movq (%rsp), %rax
movb %r15b, 0x20(%rax)
movq 0xd0(%rbx), %rcx
movq %rcx, 0xd0(%rax)
movq %rax, 0x88(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x3fad0
movq 0x32396(%rip), %rcx     # 0x71e58
cmpb $0x0, (%rcx)
je 0x3facc
incl 0x8(%rax)
jmp 0x3fad0
lock
incl 0x8(%rax)
movq %rbx, %rdi
leaq 0x88(%rsp), %rsi
callq 0x2fea0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3faf2
callq 0x2f370
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb01
callq 0x2f370
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3fb15
callq 0x2f6c0
testq %r14, %r14
je 0x3fb22
movq %r14, %rdi
callq 0x2f370
addq $0x18, %rbp
cmpq 0xb8(%rsp), %rbp
jb 0x3f9da
movq 0xa8(%rsp), %rax
movq (%rax), %rsi
movq %rsp, %rdi
callq 0x2fe20
movq (%rsp), %rbp
cmpq 0x8(%rsp), %rbp
jae 0x3fd6e
leaq 0x28(%rsp), %r13
movq (%rbp), %r12
movq 0x8(%rbp), %r14
testq %r14, %r14
je 0x3fb7f
movq 0x322e9(%rip), %rax     # 0x71e58
cmpb $0x0, (%rax)
je 0x3fb7a
incl 0x8(%r14)
jmp 0x3fb7f
lock
incl 0x8(%r14)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2ef40
movq %r13, %rdi
leaq 0x1c9d4(%rip), %rsi     # 0x5c568
callq 0x2e560
movl %eax, %r15d
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3fbb0
callq 0x2f6c0
testl %r15d, %r15d
je 0x3fbda
movq %r12, 0x48(%rsp)
movq %r14, 0x50(%rsp)
testq %r14, %r14
je 0x3fc4a
movq 0x32289(%rip), %rax     # 0x71e58
cmpb $0x0, (%rax)
je 0x3fc45
incl 0x8(%r14)
jmp 0x3fc4a
movq %r13, %rdi
movq %r12, %rsi
callq 0x30450
movl $0xe8, %edi
callq 0x2f830
movq %rax, %r15
movq %rax, %rdi
callq 0x2f880
movq %r15, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x2e4a0
movq 0x18(%rsp), %rdi
movl $0x2, 0x8(%rdi)
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x3fc65
movq 0x3221d(%rip), %rcx     # 0x71e58
cmpb $0x0, (%rcx)
je 0x3fc61
incl 0x8(%rax)
jmp 0x3fc65
lock
incl 0x8(%r14)
movq %rbx, %rdi
leaq 0x48(%rsp), %rsi
callq 0x2fb10
movq 0x50(%rsp), %rdi
jmp 0x3fd48
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0x2fa10
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3fc81
callq 0x2f370
movq 0x18(%rsp), %rdi
movb $0x0, 0x20(%rdi)
movq 0xd0(%rbx), %rax
movq %rax, 0xd0(%rdi)
movq %r12, 0x68(%rsp)
movq %r14, 0x70(%rsp)
testq %r14, %r14
je 0x3fcbe
movq 0x321aa(%rip), %rax     # 0x71e58
cmpb $0x0, (%rax)
je 0x3fcb9
incl 0x8(%r14)
jmp 0x3fcbe
lock
incl 0x8(%r14)
movq 0x68(%rsp), %rax
movq %rax, 0xd8(%rdi)
addq $0xe0, %rdi
leaq 0x70(%rsp), %rsi
callq 0x30cf0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3fcea
callq 0x2f370
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x3fd18
movq 0x3214e(%rip), %rcx     # 0x71e58
cmpb $0x0, (%rcx)
je 0x3fd14
incl 0x8(%rax)
jmp 0x3fd18
lock
incl 0x8(%rax)
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2fea0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x3fd34
callq 0x2f370
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3fd43
callq 0x2f370
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fd52
callq 0x2f370
testq %r14, %r14
je 0x3fd5f
movq %r14, %rdi
callq 0x2f370
addq $0x10, %rbp
cmpq 0x8(%rsp), %rbp
jb 0x3fb5b
movq %rsp, %rdi
callq 0x305e0
leaq 0xb0(%rsp), %rdi
callq 0x30c60
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3fe7d
jmp 0x3fdfa
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x3fdc1
movq %rax, %rbx
movq %r15, %rdi
callq 0x2f6c0
jmp 0x3fde9
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3fdcb
callq 0x2f370
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3fde9
callq 0x2f370
jmp 0x3fde9
movq %rax, %rbx
movq 0x50(%rsp), %rdi
jmp 0x3fdee
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fdfd
callq 0x2f370
jmp 0x3fdfd
movq %rax, %rbx
testq %r14, %r14
je 0x3fe0a
movq %r14, %rdi
callq 0x2f370
movq %rsp, %rdi
callq 0x305e0
jmp 0x3fe7d
movq %rax, %rbx
jmp 0x3fe70
movq %rax, %rbx
movq %r13, %rdi
callq 0x2f6c0
jmp 0x3fe5c
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
jmp 0x3fe3e
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3fe48
callq 0x2f370
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3fe5c
callq 0x2f370
jmp 0x3fe5c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3fe70
callq 0x2f6c0
testq %r14, %r14
je 0x3fe7d
movq %r14, %rdi
callq 0x2f370
leaq 0xb0(%rsp), %rdi
callq 0x30c60
movq %rbx, %rdi
callq 0x30a20