// File: EmbeddedPaul166[P]SNMP-Agent/src/parser.cpp
// Function: Parser::parseNodes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Parser::parseNodes(std::string fileContent)
{
    std::regex patternNode("\\n[^-]\\w+?\\sOBJECT-TYPE\\s*((.*\\n)*?)\\s*::= .*\\n");
    std::smatch match;
    std::string nodeString;
    std::sregex_iterator begin(fileContent.cbegin(), fileContent.cend(), patternNode);
    std::sregex_iterator end;
    
    std::string nodeName;
    unsigned int OID;
    AccessType accessType;
    StatusType statusType;
    std::string description;
    DataType dataType;
    Node * pParent = nullptr;
    
    for (std::sregex_iterator it = begin; it != end; it++)
    {
        match = *it;
        nodeString = match.str(0);
        parseNodeParameters(nodeString, nodeName, OID, dataType, description, accessType, statusType, &pParent);
        m_pNode = addNode(nodeName, OID, dataType, description, accessType, statusType, &pParent);
    }
     
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rsi, -0x268(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq 0x32f16(%rip), %rsi     # 0x485e2
leaq -0x30(%rbp), %rdi
movl $0x10, %edx
callq 0x18ef0
leaq -0x50(%rbp), %rdi
callq 0x18eb0
jmp 0x156e5
leaq -0x80(%rbp), %rdi
callq 0x6600
movq -0x268(%rbp), %rdi
callq 0x61b0
movq -0x268(%rbp), %rdi
movq %rax, -0xc8(%rbp)
callq 0x60c0
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rcx
xorl %r8d, %r8d
callq 0x190a0
jmp 0x15737
leaq -0x110(%rbp), %rdi
callq 0x191d0
jmp 0x15745
leaq -0x130(%rbp), %rdi
callq 0x6600
leaq -0x160(%rbp), %rdi
callq 0x6600
leaq -0x1b0(%rbp), %rdi
callq 0x44a20
jmp 0x1576b
movq $0x0, -0x1b8(%rbp)
leaq -0x1f8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x19220
jmp 0x1578b
jmp 0x1578d
leaq -0x1f8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x19270
testb $0x1, %al
jne 0x1580a
leaq -0x1f8(%rbp), %rdi
callq 0x193b0
jmp 0x1595c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x15a0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x159f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x159ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x159c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x159bc
leaq -0x1f8(%rbp), %rdi
callq 0x192a0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x192c0
jmp 0x15824
xorl %eax, %eax
movl %eax, %edx
leaq -0x218(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x18ff0
jmp 0x1583a
leaq -0x80(%rbp), %rdi
movq %rdi, -0x270(%rbp)
leaq -0x218(%rbp), %rsi
movq %rsi, -0x278(%rbp)
callq 0x6560
movq -0x278(%rbp), %rdi
callq 0x62e0
movq -0x260(%rbp), %rdi
movq -0x270(%rbp), %rsi
movq %rsp, %rax
leaq -0x1b8(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x13c(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x138(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x130(%rbp), %rdx
leaq -0x134(%rbp), %rcx
leaq -0x1b0(%rbp), %r8
leaq -0x160(%rbp), %r9
callq 0x15a20
jmp 0x158b8
movq -0x260(%rbp), %rdi
movq %rsp, %rax
leaq -0x1b8(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x13c(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x130(%rbp), %rsi
leaq -0x134(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
leaq -0x160(%rbp), %r8
leaq -0x138(%rbp), %r9
callq 0x160b0
movq %rax, -0x280(%rbp)
jmp 0x15908
movq -0x260(%rbp), %rax
movq -0x280(%rbp), %rcx
movq %rcx, 0x68(%rax)
leaq -0x258(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
xorl %edx, %edx
callq 0x19330
jmp 0x15931
leaq -0x258(%rbp), %rdi
callq 0x193b0
jmp 0x1578d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x193b0
jmp 0x159bc
leaq -0x1b0(%rbp), %rdi
callq 0x44a90
leaq -0x160(%rbp), %rdi
callq 0x62e0
leaq -0x130(%rbp), %rdi
callq 0x62e0
leaq -0x110(%rbp), %rdi
callq 0x193b0
leaq -0xc0(%rbp), %rdi
callq 0x193b0
leaq -0x80(%rbp), %rdi
callq 0x62e0
leaq -0x50(%rbp), %rdi
callq 0x195a0
leaq -0x30(%rbp), %rdi
callq 0x19570
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0x1b0(%rbp), %rdi
callq 0x44a90
leaq -0x160(%rbp), %rdi
callq 0x62e0
leaq -0x130(%rbp), %rdi
callq 0x62e0
leaq -0x110(%rbp), %rdi
callq 0x193b0
leaq -0xc0(%rbp), %rdi
callq 0x193b0
leaq -0x80(%rbp), %rdi
callq 0x62e0
leaq -0x50(%rbp), %rdi
callq 0x195a0
leaq -0x30(%rbp), %rdi
callq 0x19570
movq -0x58(%rbp), %rdi
callq 0x6790
nopl (%rax)