// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/src/Protocol.cpp
// Function: fprime::Protocol::populateNode(std::shared_ptr<fprime::Node>, Json::Value, bool)
void Protocol::populateNode(fprime::Node::NodePtr node, Json::Value nodeSpec, bool requiredFlag) {
        try {
            node->setProtocol(this);
            Json::Value members = nodeSpec["members"];
            for (int i = 0; i < members.size(); i++) {
                string memberId = members[i]["memberId"].asString();
                try {
                    if (memberId.empty())
                        throw runtime_error("Empty member was specified for node.");

                    fprime::Node::NodePtr child(new Node());
                    fprime::Field::FieldPtr fieldPtr;
                    child->setProtocol(this);

                    if (members[i]["isComponent"] == "Y") {

                        fprime::Component::ComponentPtr componentPtr = this->getComponent(string(memberId));
                        if (componentPtr == nullptr)
                            throw std::runtime_error("Component :" + memberId + " did not found.");
                        if (componentPtr->getType() == "BlockRepeating") {
                            try {
                                child->setType(fprime::Node::REPEATING_GROUP);
                                fieldPtr = componentPtr->getControlField();
                                if (fieldPtr == nullptr)
                                    throw std::runtime_error("control field for Component :" + memberId + " did not found.");
                                child->setRequired(requiredFlag);
                                child->setComponent(componentPtr);
                                child->setField(fieldPtr);
                                node->appendChild(child);
                            } catch (exception& e) {
                                throw std::runtime_error("Error trying to get the id of control field :" + string(e.what()));
                            }

                        } else
                            node->resolveComponent(componentPtr);
                    } else {
                        fieldPtr = this->getField(boost::lexical_cast<unsigned int>(memberId));
                        if (fieldPtr == nullptr)
                            throw std::runtime_error("Field " + memberId + " did not found.");
                        if (fieldPtr->getDataType() == "NumInGroup") {
                            stringstream msg;
                            msg << fieldPtr->getId() << " " <<
                                    fieldPtr->getName() <<
                                    " is of type NumInGroup and cannot be assigned directly to components or messages. add the corresponding component.";
                            throw std::runtime_error(msg.str());
                        }
                        child->setType(fprime::Node::FIELD_NODE);

                        if (members[i]["isRequired"] == "Y")
                            child->setRequired(true);
                        else
                            child->setRequired(false);

                        child->setField(fieldPtr);
                        node->appendChild(child);

                    }
                } catch (exception& e) {
                    throw std::runtime_error("Exception populating node member " + memberId + " : " + string(e.what()));
                }
            }
        } catch (exception& e) {
            throw std::runtime_error("at populateNode: " + string(e.what()));
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r13
movq %rsi, 0x30(%rsp)
movq (%rsi), %rdi
movq %r13, %rsi
callq 0x3e8e0
leaq 0x13426(%rip), %rsi     # 0x66754
movq %r14, %rdi
callq 0x3ed60
leaq 0x118(%rsp), %rdi
movq %rax, %rsi
callq 0x41bd0
xorl %r14d, %r14d
leaq 0x118(%rsp), %rbp
movzbl %bl, %eax
movl %eax, 0x68(%rsp)
leaq 0x140(%rsp), %r15
movq %rbp, %rdi
callq 0x41cf0
cmpl %eax, %r14d
jae 0x53734
movq %rbp, %rdi
movl %r14d, %esi
callq 0x407c0
movq %rax, %rdi
leaq 0x13446(%rip), %rsi     # 0x667cc
callq 0x3ed60
leaq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x424b0
cmpq $0x0, 0xa0(%rsp)
je 0x53753
movl $0xe8, %edi
callq 0x405e0
movq %rax, %r12
movq %rax, %rdi
callq 0x40660
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x418c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x3e8e0
movq %rbp, %rdi
movl %r14d, %esi
callq 0x407c0
movq %rax, %rdi
leaq 0x13416(%rip), %rsi     # 0x6680c
callq 0x3ed60
movq %rax, %r12
movq %r15, %rdi
leaq 0x12749(%rip), %rsi     # 0x65b51
callq 0x41f20
movq %r12, %rdi
movq %r15, %rsi
callq 0x41240
movl %eax, %r12d
movq %r15, %rdi
callq 0x3f200
testb %r12b, %r12b
je 0x53598
leaq 0x2c8(%rsp), %r12
movq %r12, %rdi
leaq 0x98(%rsp), %rsi
callq 0x412d0
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3e700
movq %r12, %rdi
callq 0x3ef50
movq 0x58(%rsp), %rsi
testq %rsi, %rsi
je 0x5383f
movq %r15, %rdi
callq 0x3f790
movq %r15, %rdi
leaq 0x13164(%rip), %rsi     # 0x665e0
callq 0x42b50
movl %eax, %r12d
movq %r15, %rdi
callq 0x3ef50
testb %r12b, %r12b
je 0x536c6
movq 0x38(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x40b50
movq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x41880
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x42660
leaq 0x148(%rsp), %rdi
callq 0x40650
cmpq $0x0, 0x70(%rsp)
je 0x53919
movq 0x38(%rsp), %rdi
movl 0x68(%rsp), %esi
callq 0x3ebb0
movl %r14d, 0x6c(%rsp)
movq %r15, %r14
movq %r13, %r15
movq %rbp, %r13
movq 0x38(%rsp), %r12
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x3ffc0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3eea0
leaq 0x110(%rsp), %rdi
callq 0x40650
movq 0x38(%rsp), %r12
leaq 0xf8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
callq 0x3f930
movq %r12, %rdi
movq %rbx, %rsi
callq 0x408b0
leaq 0x100(%rsp), %rdi
callq 0x40650
movq 0x30(%rsp), %rax
movq (%rax), %r12
leaq 0xe8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3e1b0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x40f50
leaq 0xf0(%rsp), %rdi
movq %r13, %rbp
movq %r15, %r13
movq %r14, %r15
movl 0x6c(%rsp), %r14d
jmp 0x536fc
leaq 0x98(%rsp), %rdi
callq 0x3eda0
movq %r15, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x42670
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x42660
leaq 0x148(%rsp), %rdi
callq 0x40650
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x538ac
movq %r15, %rdi
callq 0x40e10
movq %r15, %rdi
leaq 0x1324c(%rip), %rsi     # 0x66838
callq 0x42b50
movl %eax, %r12d
movq %r15, %rdi
callq 0x3ef50
testb %r12b, %r12b
jne 0x53788
movq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x40b50
movq %rbp, %rdi
movl %r14d, %esi
callq 0x407c0
movq %rax, %rdi
leaq 0x1328f(%rip), %rsi     # 0x668b6
callq 0x3ed60
movq %rax, %r12
movq %r15, %rdi
leaq 0x12518(%rip), %rsi     # 0x65b51
callq 0x41f20
movq %r12, %rdi
movq %r15, %rsi
callq 0x41240
movl %eax, %r12d
movq %r15, %rdi
callq 0x3f200
movq 0x38(%rsp), %rdi
movzbl %r12b, %esi
callq 0x3ebb0
movq 0x38(%rsp), %r12
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
callq 0x3f930
movq %r12, %rdi
movq %rbx, %rsi
callq 0x408b0
leaq 0xd0(%rsp), %rdi
callq 0x40650
movq 0x30(%rsp), %rax
movq (%rax), %r12
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3e1b0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x40f50
leaq 0xc0(%rsp), %rdi
jmp 0x53706
movq 0x30(%rsp), %rax
movq (%rax), %r12
movq %r13, %rbx
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
callq 0x3ffc0
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %r13
callq 0x409e0
leaq 0xe0(%rsp), %rdi
callq 0x40650
leaq 0x60(%rsp), %rdi
callq 0x40650
leaq 0x78(%rsp), %rdi
callq 0x40650
leaq 0x40(%rsp), %rdi
callq 0x40650
leaq 0x98(%rsp), %rdi
callq 0x3ef50
incl %r14d
jmp 0x53360
leaq 0x118(%rsp), %rdi
callq 0x3f200
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x132ad(%rip), %rsi     # 0x66a12
movq %rax, %rdi
callq 0x3ecd0
movq 0x2b864(%rip), %rsi     # 0x7efd8
movq 0x2b64d(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
leaq 0x140(%rsp), %rdi
callq 0x3fad0
movq 0x70(%rsp), %rdi
callq 0x40430
leaq 0x150(%rsp), %rdi
movl %eax, %esi
callq 0x3f9e0
leaq 0x13e0a(%rip), %rsi     # 0x675bf
movq %rax, %rdi
callq 0x405b0
movq %rax, %rbx
movq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x40800
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x40130
leaq 0x13060(%rip), %rsi     # 0x66843
movq %rax, %rdi
callq 0x405b0
leaq 0x10(%rsp), %rdi
callq 0x3ef50
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x158(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x41af0
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b7ad(%rip), %rsi     # 0x7efd8
movq 0x2b596(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x13208(%rip), %rsi     # 0x66a59
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x40140
leaq 0x131cd(%rip), %rdx     # 0x66a37
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3e640
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b740(%rip), %rsi     # 0x7efd8
movq 0x2b529(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x12d6c(%rip), %rsi     # 0x6662a
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x40140
leaq 0x13160(%rip), %rdx     # 0x66a37
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3e640
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b6d3(%rip), %rsi     # 0x7efd8
movq 0x2b4bc(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x1311c(%rip), %rsi     # 0x66a47
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x40140
leaq 0x130f3(%rip), %rdx     # 0x66a37
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3e640
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b666(%rip), %rsi     # 0x7efd8
movq 0x2b44f(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
movq %rdx, %r13
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x539a6
jmp 0x53a89
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
jmp 0x53a89
movq %rdx, %r13
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3ef50
jmp 0x53a89
jmp 0x53a83
jmp 0x53a01
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x539ed
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53a27
jmp 0x53b38
movq %rdx, %r13
movq %rax, %r14
jmp 0x53dd9
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x53a3d
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
jmp 0x53b38
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53aa1
jmp 0x53c8e
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x53a6f
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53aec
jmp 0x53c18
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3fbc0
jmp 0x53c8e
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
jmp 0x53c8e
movq %rdx, %r13
movq %rax, %r14
leaq 0xe0(%rsp), %rdi
callq 0x40650
jmp 0x53c18
movq %rdx, %r13
movq %rax, %r14
leaq 0x100(%rsp), %rdi
jmp 0x53b09
movq %rdx, %r13
movq %rax, %r14
leaq 0xf0(%rsp), %rdi
jmp 0x53b09
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
jmp 0x53c18
jmp 0x53b32
movq %rdx, %r13
movq %rax, %r14
leaq 0x110(%rsp), %rdi
callq 0x40650
jmp 0x53b38
jmp 0x53c88
jmp 0x53c88
movq %rdx, %r13
movq %rax, %r14
leaq 0x2c8(%rsp), %rdi
callq 0x3ef50
jmp 0x53c8e
movq %rdx, %r13
movq %rax, %r14
cmpl $0x1, %r13d
jne 0x53c18
movq %r14, %rdi
callq 0x3ed90
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x3ed70
leaq 0x12eeb(%rip), %rsi     # 0x66a65
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x41f00
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b430(%rip), %rsi     # 0x7efd8
movq 0x2b219(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x53bda
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53bf1
jmp 0x53bf9
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
callq 0x41d30
jmp 0x53c18
movq %rdx, %r13
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
jmp 0x53c1d
jmp 0x53c75
movq %rdx, %r13
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x40650
jmp 0x53c8e
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
jmp 0x53ca2
jmp 0x53c88
movq %rdx, %r13
movq %rax, %r14
leaq 0xc0(%rsp), %rdi
jmp 0x53c1d
jmp 0x53c5a
jmp 0x53c88
movq %rdx, %r13
movq %rax, %r14
movq %r12, %rdi
callq 0x403f0
jmp 0x53ca2
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3f200
jmp 0x53c8e
jmp 0x53c88
jmp 0x53c88
jmp 0x53c7d
movq %rdx, %r13
movq %rax, %r14
jmp 0x53ca2
movq %rdx, %r13
movq %rax, %r14
jmp 0x53dcc
movq %rdx, %r13
movq %rax, %r14
leaq 0x78(%rsp), %rdi
callq 0x40650
leaq 0x40(%rsp), %rdi
callq 0x40650
cmpl $0x1, %r13d
jne 0x53dbf
movq %r14, %rdi
callq 0x3ed90
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
leaq 0x12dca(%rip), %rsi     # 0x66a93
leaq 0x38(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x40140
leaq 0x128be(%rip), %rdx     # 0x665a0
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x3e640
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x70(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %rax, %rsi
callq 0x3ed70
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x3ffe0
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b299(%rip), %rsi     # 0x7efd8
movq 0x2b082(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
jmp 0x53e61
movq %rdx, %r13
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x53d71
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x70(%rsp), %rdi
callq 0x3ef50
jmp 0x53d86
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x3ef50
jmp 0x53d9b
movq %rdx, %r13
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53db2
jmp 0x53dba
movq %rdx, %r13
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
callq 0x41d30
leaq 0x98(%rsp), %rdi
callq 0x3ef50
leaq 0x118(%rsp), %rdi
callq 0x3f200
cmpl $0x1, %r13d
jne 0x53e9d
movq %r14, %rdi
callq 0x3ed90
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x3f0e0
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x118(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq %rax, %rsi
callq 0x3ed70
leaq 0x12c94(%rip), %rsi     # 0x66ab5
leaq 0x140(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x41f00
movb $0x1, %bpl
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x41c90
xorl %ebp, %ebp
movq 0x2b186(%rip), %rsi     # 0x7efd8
movq 0x2af6f(%rip), %rdx     # 0x7edc8
movq %rbx, %rdi
callq 0x42050
movq %rax, %r14
leaq 0x140(%rsp), %rdi
callq 0x3ef50
jmp 0x53e79
movq %rax, %r14
movb $0x1, %bpl
leaq 0x118(%rsp), %rdi
callq 0x3ef50
testb %bpl, %bpl
jne 0x53e90
jmp 0x53e98
movq %rax, %r14
movq %rbx, %rdi
callq 0x3faf0
callq 0x41d30
movq %r14, %rdi
callq 0x42200
movq %rax, %rdi
callq 0x43915
nop