// File: /workspace/github_cpp_makefile_star2_O2/EmbeddedPaul166[P]SNMP-Agent/src/parser.cpp
// Function: Parser::parseNodeParameters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned int&, DataType&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, AccessType&, StatusType&, Node**)
void Parser::parseNodeParameters(std::string & nodeString, std::string & nodeName, unsigned int & OID, DataType & dataType, std::string & description, AccessType & accessType, StatusType & statusType, Node ** pParent)
{
    std::regex pattern("(\\w+) OBJECT-TYPE");
    std::smatch match;
    
    if (std::regex_search(nodeString, match, pattern))
    {
        nodeName = match.str(1);
    }
    
    pattern.assign("(\\d+) \\}");
    if (std::regex_search(nodeString, match, pattern))
    {
        OID = std::stoi(match.str(1));
    }
    
    pattern.assign("SYNTAX  ((.*\\n)*?)    ACCESS");
    if (std::regex_search(nodeString, match, pattern))
    {
        std::string matchString = match.str(1);
        dataType = parseDataType(matchString);
    }
    
    pattern.assign("ACCESS  (.+)");
    if (std::regex_search(nodeString, match, pattern))
    {
        std::string accessString = match.str(1);
        if (accessString == "read-only")
        {
            accessType = AccessType::READ_ONLY;
        }
        else if (accessString == "write-only")
        {
            accessType = AccessType::WRITE_ONLY;
        }
        else if (accessString == "read-write")
        {
            accessType = AccessType::READ_WRITE;    
        }
        else if (accessString == "not-accessible")
        {
            accessType = AccessType::NOT_ACCESSIBLE;
        }
    }
    
    pattern.assign("STATUS  (.+)");
    if (std::regex_search(nodeString, match, pattern))
    {
        
        std::string statusString = match.str(1);
        if (statusString == "mandatory")
        {
            statusType = StatusType::MANDATORY;
        }
        else if (statusString == "optional")
        {
            statusType = StatusType::OPTIONAL;
        }
        else if (statusString == "obsolete")
        {
            statusType = StatusType::OBSOLETE;    
        }
    }
    
    pattern.assign("\"(.+?((.*\\n)+).+?)\"\\n");
    if (std::regex_search(nodeString, match, pattern))
    {
        description = match.str(1);
    }
    
    pattern.assign("\\{ (.+) \\d \\}");
    if (std::regex_search(nodeString, match, pattern))
    {
        std::string parentName = match.str(1);
        for (std::list<Node>::iterator it = m_pTree -> m_nodeList.begin(); it != m_pTree -> m_nodeList.end(); it++)
        {
            if ((*it).m_name == parentName)
            {
                *pParent = &(*it);
                break;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, 0x90(%rsp)
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xffef(%rip), %rsi      # 0x195a2
leaq 0x20(%rsp), %r15
pushq $0x10
popq %rdx
movq %r15, %rdi
callq 0xb4e0
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %r14, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9609
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x40(%rsp), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x43b0
movq %r15, %rdi
callq 0x4170
leaq 0xffa4(%rip), %rsi      # 0x195b4
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9660
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x40(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0xb8a3
movl %eax, (%r13)
leaq 0x40(%rsp), %rdi
callq 0x4170
leaq 0xff56(%rip), %rsi      # 0x195bd
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x96d6
leaq 0x98(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x40(%rsp), %rdi
leaq 0x98(%rsp), %rdx
movq %rbx, %rsi
callq 0x9a48
leaq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0xb8c0
leaq 0x40(%rsp), %rdi
callq 0x18002
leaq 0x98(%rsp), %rdi
callq 0x4170
leaq 0xfefd(%rip), %rsi      # 0x195da
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9789
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0xfecc(%rip), %rsi      # 0x195e7
leaq 0x40(%rsp), %rdi
callq 0x6c47
xorl %ecx, %ecx
testb %al, %al
jne 0x9775
leaq 0xfebf(%rip), %rsi      # 0x195f1
leaq 0x40(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x9744
pushq $0x1
jmp 0x9774
leaq 0xfeb1(%rip), %rsi      # 0x195fc
leaq 0x40(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x975d
pushq $0x2
jmp 0x9774
leaq 0xfea3(%rip), %rsi      # 0x19607
leaq 0x40(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x977f
pushq $0x3
popq %rcx
movq 0xf0(%rsp), %rax
movl %ecx, (%rax)
leaq 0x40(%rsp), %rdi
callq 0x4170
leaq 0xfe86(%rip), %rsi      # 0x19616
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x981f
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0xfe59(%rip), %rsi      # 0x19623
leaq 0x40(%rsp), %rdi
callq 0x6c47
xorl %ecx, %ecx
testb %al, %al
jne 0x980b
leaq 0xfe4c(%rip), %rsi      # 0x1962d
leaq 0x40(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x97f3
pushq $0x1
jmp 0x980a
leaq 0xfe3c(%rip), %rsi      # 0x19636
leaq 0x40(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x9815
pushq $0x2
popq %rcx
movq 0xf8(%rsp), %rax
movl %ecx, (%rax)
leaq 0x40(%rsp), %rdi
callq 0x4170
leaq 0xfe19(%rip), %rsi      # 0x1963f
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9876
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x40(%rsp), %r15
movq 0x90(%rsp), %rdi
movq %r15, %rsi
callq 0x43b0
movq %r15, %rdi
callq 0x4170
leaq 0xfdd8(%rip), %rsi      # 0x19655
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x98f8
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0xb562
movq 0x100(%rsp), %r15
movq 0x60(%rbx), %r12
addq $0x8, %r12
leaq 0x40(%rsp), %r14
movq (%r12), %r12
movq 0x60(%rbx), %rax
addq $0x8, %rax
cmpq %rax, %r12
je 0x98ee
leaq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x53d3
testb %al, %al
je 0x98c5
addq $0x10, %r12
movq %r12, (%r15)
leaq 0x40(%rsp), %rdi
callq 0x4170
movq %rsp, %rdi
callq 0xb94c
leaq 0x20(%rsp), %rdi
callq 0xb786
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9955
jmp 0x9955
jmp 0x9955
jmp 0x9955
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x18002
jmp 0x9936
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x994a
jmp 0x9955
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4170
jmp 0x9958
jmp 0x9955
jmp 0x9955
movq %rax, %rbx
movq %rsp, %rdi
callq 0xb94c
leaq 0x20(%rsp), %rdi
callq 0xb786
movq %rbx, %rdi
callq 0x4540