// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/src/Node.cpp
// Function: fprime::Node::Node(fprime::Node const&)
Node::Node(const Node& other) :
    _type(other._type),
    isRequired(other.isRequired),
    field(other.field),
    protocolPtr(other.protocolPtr),
    componentPtr(other.componentPtr) {

        if (other._type == fprime::Node::NodeType::FIELD_NODE || other._type == fprime::Node::NodeType::REPEATING_GROUP) {
            fprime::DataHolderFactory factory;
            this->value = factory.create(other.field->getDataType());
            const string val = other.value->get();
            this->value->set(val);
        }

        childsVector.clear();
        childsByFieldId.clear();
        for (NodeVector::const_iterator itr = other.childsVector.begin(); itr != other.childsVector.end(); itr++) {
            NodePtr newNode(new Node(**itr));
            childsVector.push_back(newNode);
            if (other._type == fprime::Node::NodeType::ROOT_NODE || other._type == fprime::Node::NodeType::GROUP_INSTANCE)
                childsByFieldId[newNode->getField()->getId()] = newNode;

            if (other._type == fprime::Node::NodeType::REPEATING_GROUP)
                childsByFieldId[childsVector.size()] = newNode;
        }

        //        if (_type != fprime::Node::NodeType::ROOT_NODE)
        //            cout << "Node " << field->getId() << " copied" << endl;
        //        else
        //            cout << "Root Node " << " copied" << endl;

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x304d0(%rip), %rax     # 0x7eef8
addq $0x10, %rax
movq %rax, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movb 0x20(%rsi), %al
movb %al, 0x20(%rdi)
addq $0x28, %rdi
leaq 0x28(%rsi), %r14
movq %r14, %rsi
callq 0x3f930
andq $0x0, 0x48(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
andl $0x0, 0x58(%rbx)
leaq 0x38(%rbx), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x60(%rbx)
leaq 0x50(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x58(%rbx), %rax
movq %rax, 0x68(%rbx)
movq %rax, 0x70(%rbx)
andq $0x0, 0x78(%rbx)
leaq 0x80(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x3ee80
leaq 0xa8(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x3ee80
movq 0xd0(%rbp), %rax
movq %rax, 0xd0(%rbx)
movl $0xd8, %esi
leaq (%rbx,%rsi), %rdi
addq %rbp, %rsi
callq 0x3ffc0
movl 0x8(%rbp), %eax
decl %eax
cmpl $0x1, %eax
ja 0x4eb88
leaq 0x50(%rsp), %rdi
callq 0x426b0
movq (%r14), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x40e10
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x40870
leaq 0x10(%rbx), %r14
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x3f600
leaq 0x38(%rsp), %rdi
callq 0x40650
leaq 0xa8(%rsp), %rdi
callq 0x3ef50
movq 0x10(%rbp), %rsi
movq (%rsi), %rax
leaq 0x30(%rsp), %rdi
callq *0x18(%rax)
movq (%r14), %r14
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x412d0
movq (%r14), %rax
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x88(%rsp), %rdi
callq 0x3ef50
leaq 0x30(%rsp), %rdi
callq 0x3ef50
leaq 0x50(%rsp), %rdi
callq 0x42700
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq 0x20(%rsp), %rdi
callq 0x41720
movq 0x8(%rsp), %rdi
callq 0x3f190
movq 0x38(%rbp), %r15
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %r14
cmpq 0x40(%rbp), %r15
je 0x4ec7c
movl $0xe8, %edi
callq 0x405e0
movq %rax, %r12
movq (%r15), %rsi
movq %rax, %rdi
callq 0x42590
movq %r13, %rdi
movq %r12, %rsi
callq 0x418c0
movq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x40da0
movl 0x8(%rbp), %eax
cmpl $0x3, %eax
je 0x4ebfa
testl %eax, %eax
jne 0x4ec3c
movq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x406d0
movq 0x30(%rsp), %rdi
callq 0x40430
movl %eax, 0x2c(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
callq 0x3fb80
movq %rax, %rdi
movq %r13, %rsi
callq 0x3f870
leaq 0x38(%rsp), %rdi
callq 0x40650
movl 0x8(%rbp), %eax
cmpl $0x2, %eax
jne 0x4ec69
movq 0x40(%rbx), %rax
subq 0x38(%rbx), %rax
shrq $0x4, %rax
movl %eax, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3fb80
movq %rax, %rdi
movq %r13, %rsi
callq 0x3f870
leaq 0x58(%rsp), %rdi
callq 0x40650
addq $0x10, %r15
jmp 0x4ebb4
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbp
leaq 0x88(%rsp), %rdi
callq 0x3ef50
jmp 0x4eca3
movq %rax, %rbp
leaq 0x30(%rsp), %rdi
jmp 0x4ecb7
jmp 0x4ecbe
movq %rax, %rbp
leaq 0xa8(%rsp), %rdi
callq 0x3ef50
jmp 0x4ecc1
movq %rax, %rbp
leaq 0x50(%rsp), %rdi
callq 0x42700
jmp 0x4ed18
movq %rax, %rbp
jmp 0x4ed18
movq %rax, %rbp
jmp 0x4ed2c
movq %rax, %rbp
jmp 0x4ed34
jmp 0x4ece0
jmp 0x4ece0
movq %rax, %rbp
jmp 0x4ecff
movq %rax, %rbp
movq %r12, %rdi
callq 0x403f0
jmp 0x4ed0e
movq %rax, %rbp
leaq 0x38(%rsp), %rdi
callq 0x40650
leaq 0x58(%rsp), %rdi
callq 0x40650
jmp 0x4ed0e
movq %rax, %rbp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
leaq 0xe0(%rbx), %rdi
callq 0x40650
movq %r12, %rdi
callq 0x3f200
movq %r15, %rdi
callq 0x3f200
movq 0x8(%rsp), %rdi
callq 0x3e810
movq 0x20(%rsp), %rdi
callq 0x41310
leaq 0x30(%rbx), %rdi
callq 0x40650
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x40650
movq %rbp, %rdi
callq 0x42200
nop