// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f882
movq (%rbp), %r12
movq 0x8(%rbp), %r14
testq %r14, %r14
je 0x3f74c
movq 0x3171c(%rip), %rax     # 0x70e58
cmpb $0x0, (%rax)
je 0x3f747
incl 0x8(%r14)
jmp 0x3f74c
lock
incl 0x8(%r14)
movb 0x10(%rbp), %r15b
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x2fdc0
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 0x3f7ba
movq 0x316ae(%rip), %rax     # 0x70e58
cmpb $0x0, (%rax)
je 0x3f7b5
incl 0x8(%r14)
jmp 0x3f7ba
lock
incl 0x8(%r14)
leaq 0x98(%rsp), %rsi
callq 0x2fa10
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x3f7d9
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 0x3f81e
movq 0x31648(%rip), %rcx     # 0x70e58
cmpb $0x0, (%rcx)
je 0x3f81a
incl 0x8(%rax)
jmp 0x3f81e
lock
incl 0x8(%rax)
movq %rbx, %rdi
leaq 0x88(%rsp), %rsi
callq 0x2fe90
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3f840
callq 0x2f370
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3f84f
callq 0x2f370
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3f863
callq 0x2f6c0
testq %r14, %r14
je 0x3f870
movq %r14, %rdi
callq 0x2f370
addq $0x18, %rbp
cmpq 0xb8(%rsp), %rbp
jb 0x3f728
movq 0xa8(%rsp), %rax
movq (%rax), %rsi
movq %rsp, %rdi
callq 0x2fe10
movq (%rsp), %rbp
cmpq 0x8(%rsp), %rbp
jae 0x3fabc
leaq 0x28(%rsp), %r13
movq (%rbp), %r12
movq 0x8(%rbp), %r14
testq %r14, %r14
je 0x3f8cd
movq 0x3159b(%rip), %rax     # 0x70e58
cmpb $0x0, (%rax)
je 0x3f8c8
incl 0x8(%r14)
jmp 0x3f8cd
lock
incl 0x8(%r14)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2ef40
movq %r13, %rdi
leaq 0x1bc86(%rip), %rsi     # 0x5b568
callq 0x2e560
movl %eax, %r15d
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3f8fe
callq 0x2f6c0
testl %r15d, %r15d
je 0x3f928
movq %r12, 0x48(%rsp)
movq %r14, 0x50(%rsp)
testq %r14, %r14
je 0x3f998
movq 0x3153b(%rip), %rax     # 0x70e58
cmpb $0x0, (%rax)
je 0x3f993
incl 0x8(%r14)
jmp 0x3f998
movq %r13, %rdi
movq %r12, %rsi
callq 0x30440
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 0x3f9b3
movq 0x314cf(%rip), %rcx     # 0x70e58
cmpb $0x0, (%rcx)
je 0x3f9af
incl 0x8(%rax)
jmp 0x3f9b3
lock
incl 0x8(%r14)
movq %rbx, %rdi
leaq 0x48(%rsp), %rsi
callq 0x2fb00
movq 0x50(%rsp), %rdi
jmp 0x3fa96
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0x2fa10
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3f9cf
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 0x3fa11
movq 0x3145c(%rip), %rax     # 0x70e58
cmpb $0x0, (%rax)
je 0x3fa07
incl 0x8(%r14)
jmp 0x3fa11
lock
incl 0x8(%r14)
movq 0x68(%rsp), %r12
movq %r12, 0xd8(%rdi)
addq $0xe0, %rdi
leaq 0x70(%rsp), %rsi
callq 0x30ce0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3fa38
callq 0x2f370
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x3fa66
movq 0x31400(%rip), %rcx     # 0x70e58
cmpb $0x0, (%rcx)
je 0x3fa62
incl 0x8(%rax)
jmp 0x3fa66
lock
incl 0x8(%rax)
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2fe90
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x3fa82
callq 0x2f370
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3fa91
callq 0x2f370
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3faa0
callq 0x2f370
testq %r14, %r14
je 0x3faad
movq %r14, %rdi
callq 0x2f370
addq $0x10, %rbp
cmpq 0x8(%rsp), %rbp
jb 0x3f8a9
movq %rsp, %rdi
callq 0x305d0
leaq 0xb0(%rsp), %rdi
callq 0x30c50
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3fbcb
jmp 0x3fb48
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x3fb0f
movq %rax, %rbx
movq %r15, %rdi
callq 0x2f6c0
jmp 0x3fb37
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb19
callq 0x2f370
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb37
callq 0x2f370
jmp 0x3fb37
movq %rax, %rbx
movq 0x50(%rsp), %rdi
jmp 0x3fb3c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb4b
callq 0x2f370
jmp 0x3fb4b
movq %rax, %rbx
testq %r14, %r14
je 0x3fb58
movq %r14, %rdi
callq 0x2f370
movq %rsp, %rdi
callq 0x305d0
jmp 0x3fbcb
movq %rax, %rbx
jmp 0x3fbbe
movq %rax, %rbx
movq %r13, %rdi
callq 0x2f6c0
jmp 0x3fbaa
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
jmp 0x3fb8c
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb96
callq 0x2f370
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3fbaa
callq 0x2f370
jmp 0x3fbaa
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3fbbe
callq 0x2f6c0
testq %r14, %r14
je 0x3fbcb
movq %r14, %rdi
callq 0x2f370
leaq 0xb0(%rsp), %rdi
callq 0x30c50
movq %rbx, %rdi
callq 0x30a10