// File: /workspace/github_cpp_makefile_star2_O3/EmbeddedPaul166[P]SNMP-Agent/src/tree.cpp
// Function: Tree::addNode(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, DataType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, AccessType, StatusType, Node*)
Node * Tree::addNode(unsigned int objectIdentifier, std::string name, DataType dataType, std::string description, AccessType accessType, StatusType statusType, Node * pParentElement)
{ 
    std::list <Node *> emptyChildList;
    emptyChildList.clear();
    
    Node newNode(objectIdentifier, name, dataType, description, accessType, statusType, pParentElement, emptyChildList);    
    
    m_nodeList.push_back(newNode);
    
    if (pParentElement -> m_childElementPointerList.empty())
    {
        pParentElement -> m_childElementPointerList.push_back(&m_nodeList.back()); 
    }
    else
    {
        for (std::list<Node *>::iterator it = pParentElement -> m_childElementPointerList.begin(); it != pParentElement -> m_childElementPointerList.end(); it++)
        {
            int childObjectIdentifier = (*it) -> m_objectIdentifier;
            int newChildObjectIdentifier = m_nodeList.back().m_objectIdentifier;
            if (newChildObjectIdentifier < childObjectIdentifier)
            {
                pParentElement -> m_childElementPointerList.insert(it, &m_nodeList.back());
                break;
            }
            else if (pParentElement -> m_childElementPointerList.back() == (*it))
            {
                pParentElement -> m_childElementPointerList.push_back(&m_nodeList.back());
                break;
            }
        }
    }
    Node * pNewNode = &m_nodeList.back();
    return pNewNode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r12
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x40(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x5f70
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
leaq 0x90(%rsp), %r13
movaps %xmm1, -0x10(%r13)
movaps %xmm0, -0x20(%r13)
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x7892
leaq 0xa8(%rsp), %rdi
addq $0x38, %r12
movq %r12, %rsi
callq 0x791c
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x5f70
leaq 0x58(%rsp), %r12
leaq 0x40(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x1d480
movq 0x1c8(%rsp), %r13
movl 0x1c0(%rsp), %eax
subq $0x8, %rsp
leaq 0xd0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x78(%rsp), %rcx
leaq 0x8(%rsp), %r8
movl %r15d, %esi
movl %ebp, %r9d
pushq %r12
pushq %r13
pushq %rax
callq 0x1d6a4
addq $0x20, %rsp
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x1d0c6
movq (%rdi), %r15
movl $0x18, %esi
callq 0x4320
movq %r15, %rdi
cmpq %r12, %r15
jne 0x1d0b1
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1d0e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0x70(%rsp), %rdi
callq 0x1cc96
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1d107
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0x8(%rbx), %r15
leaq 0xc8(%rsp), %rsi
movq %r15, %rdi
callq 0x1d54a
movq %rax, %rdi
movq %r15, %rsi
callq 0x4070
incq 0x18(%rbx)
leaq 0xa8(%r13), %r15
movq 0xa8(%r13), %r12
movq 0x10(%rbx), %rbp
cmpq %r15, %r12
je 0x1d169
movl 0x10(%rbp), %eax
addq $0x10, %rbp
movq 0x10(%r12), %rcx
cmpl (%rcx), %eax
jl 0x1d179
movq 0xb0(%r13), %rdx
cmpq %rcx, 0x10(%rdx)
je 0x1d18f
movq (%r12), %r12
cmpq %r15, %r12
jne 0x1d148
jmp 0x1d1af
movl $0x18, %edi
callq 0x4310
addq $0x10, %rbp
jmp 0x1d199
movl $0x18, %edi
callq 0x4310
movq %rbp, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
jmp 0x1d1a3
movl $0x18, %edi
callq 0x4310
movq %rbp, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4070
incq 0xb8(%r13)
movq 0x10(%rbx), %rbx
leaq 0xc8(%rsp), %rdi
callq 0x1d8b0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x1d1df
movq (%rdi), %r15
movl $0x18, %esi
callq 0x4320
movq %r15, %rdi
cmpq %r14, %r15
jne 0x1d1ca
addq $0x10, %rbx
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d1fe
jmp 0x1d1fe
jmp 0x1d1fe
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x1d8b0
jmp 0x1d297
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x1d23a
movq (%rdi), %r14
movl $0x18, %esi
callq 0x4320
movq %r14, %rdi
cmpq %r12, %r14
jne 0x1d220
jmp 0x1d23a
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1d25a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x1d25a
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1cc96
jmp 0x1d276
movq %rax, %rbx
movq %r13, %rdi
callq 0x5f12
jmp 0x1d276
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1d297
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x1d297
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x40(%rsp), %r15
cmpq %r15, %rdi
je 0x1d2bb
movq (%rdi), %r14
movl $0x18, %esi
callq 0x4320
movq %r14, %rdi
cmpq %r15, %r14
jne 0x1d2a6
movq %rbx, %rdi
callq 0x4550
nop