// File: /workspace/github_cpp_makefile_star2_O2/EmbeddedPaul166[P]SNMP-Agent/src/parser.cpp
// Function: Parser::parseDataType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
DataType Parser::parseDataType(std::string & dataTypeString)
{
    DataType dataType;
    std::regex patternName("\\w+");
    std::regex patternSequenceObject("(\\w+)\\n");
    std::regex patternBrace("\\(SIZE (.*?)\\)\\)");
    std::regex patternBraceTwo(" (.*?)\\)");
    std::regex patternInteger("INTEGER");
    std::regex patternOctetString("OCTET STRING");
    std::regex patternObjectIdentifier("OBJECT IDENTIFIER");
    std::regex patternNULL("NULL");
    std::smatch match;
    
    if (std::regex_search(dataTypeString, match, patternName))
    {
        std::string name = match.str(0);
        if (name == "SEQUENCE")
        {
            dataType.m_baseType = BaseDataType::SEQUENCE_OF;
            if (std::regex_search(dataTypeString, match, patternSequenceObject))
            {
                dataType.m_nodeNameList.push_back(match.str(1));
            }
            else
            {
                dataType.m_nodeNameList.push_back("Error");
            }
        }
        else if (std::regex_search(dataTypeString, match, patternInteger))
        {
            dataType.m_baseType = BaseDataType::INTEGER;
            if (std::regex_search(dataTypeString, match, patternBrace))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_lengthLimit;
            }
            else if (std::regex_search(dataTypeString, match, patternBraceTwo))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_rangeLimitUpper;
            }
        }
        else if (std::regex_search(dataTypeString, match, patternOctetString))
        {
            dataType.m_baseType = BaseDataType::OCTET_STRING;   
            if (std::regex_search(dataTypeString, match, patternBrace))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_lengthLimit;
            }
            else if (std::regex_search(dataTypeString, match, patternBraceTwo))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_rangeLimitUpper;
            }
        }
        else if (std::regex_search(dataTypeString, match, patternObjectIdentifier))
        {
            dataType.m_baseType = BaseDataType::OBJECT_IDENTIFIER;    
            if (std::regex_search(dataTypeString, match, patternBrace))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_lengthLimit;
            }
            else if (std::regex_search(dataTypeString, match, patternBraceTwo))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_rangeLimitUpper;
            }
        }
        else if (std::regex_search(dataTypeString, match, patternNULL))
        {
            dataType.m_baseType = BaseDataType::NULL_D;   
            if (std::regex_search(dataTypeString, match, patternBrace))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_lengthLimit;
            }
            else if (std::regex_search(dataTypeString, match, patternBraceTwo))
            {
                std::stringstream conv(match.str(1));     
                conv >> dataType.m_rangeLimitUpper;
            }
        }
        else
        {
            for (std::vector<std::string>::size_type i = m_customDataTypeNameVector.size() - 1; i != (std::vector<std::string>::size_type) - 1; i--)
            {
                if (m_customDataTypeNameVector[i] == name)
                {
                    dataType = m_customDataTypeVector[i];
                }
         
                if (std::regex_search(dataTypeString, match, patternBrace))
                {
                    std::stringstream conv(match.str(1));     
                    conv >> dataType.m_lengthLimit;
                }
                else if (std::regex_search(dataTypeString, match, patternBraceTwo))
                {
                    std::stringstream conv(match.str(1));     
                    conv >> dataType.m_rangeLimitUpper;
                }
            }
        }
    }
    
    
    return dataType;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
callq 0x17fe4
leaq 0xfa52(%rip), %rsi      # 0x194c0
leaq 0x170(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfbde(%rip), %rsi      # 0x19663
leaq 0x150(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfbcf(%rip), %rsi      # 0x1966b
leaq 0x90(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfbc9(%rip), %rsi      # 0x1967c
leaq 0x70(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfbbe(%rip), %rsi      # 0x19685
leaq 0x130(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfbaf(%rip), %rsi      # 0x1968d
leaq 0x110(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfa31(%rip), %rsi      # 0x19526
leaq 0xf0(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0xfb8e(%rip), %rsi      # 0x1969a
leaq 0xd0(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x170(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa11f
leaq 0xb0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
movq %r13, 0x8(%rsp)
callq 0xb562
leaq 0xfb3a(%rip), %rsi      # 0x1969f
leaq 0xb0(%rsp), %rdi
callq 0x6c47
testb %al, %al
je 0x9bc8
movl $0x6, (%r13)
leaq 0x30(%rsp), %rsi
leaq 0x150(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9c52
leaq 0x190(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x20(%r13), %rdi
leaq 0x190(%rsp), %rsi
callq 0x174b0
jmp 0x9c7c
leaq 0x30(%rsp), %rsi
leaq 0x130(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9c8e
andl $0x0, (%r13)
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9d1b
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x10(%r13), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0xf77b(%rip), %rsi      # 0x193d4
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x5398
leaq 0x20(%r13), %rdi
leaq 0x190(%rsp), %rsi
callq 0x174b0
leaq 0x190(%rsp), %rdi
callq 0x4170
jmp 0xa10d
leaq 0x30(%rsp), %rsi
leaq 0x110(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9d83
movl $0x1, (%r13)
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9e10
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x10(%r13), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa10d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
movq 0x8(%rsp), %rbx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x18(%rbx), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0x30(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9e78
movl $0x2, (%r13)
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9f05
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x10(%r13), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa10d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
movq 0x8(%rsp), %rbx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x18(%rbx), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0x30(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9f6d
movl $0x4, (%r13)
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa0a1
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x10(%r13), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa10d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
movq 0x8(%rsp), %rbx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x18(%rbx), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
jmp 0xa100
movq 0x20(%rbx), %r12
movq %rbx, 0x58(%rsp)
subq 0x18(%rbx), %r12
movq %r12, %rbx
sarq $0x5, %rbx
leaq 0x18(%r13), %rax
movq %rax, 0x60(%rsp)
leaq 0x10(%r13), %rax
movq %rax, 0x68(%rsp)
imulq $0x50, %rbx, %rbp
addq $-0x50, %rbp
addq $-0x20, %r12
subq $0x1, %rbx
jb 0xa10d
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rdi
addq %r12, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x53d3
testb %al, %al
je 0x9fdb
movq 0x58(%rsp), %rax
movq (%rax), %rsi
addq %rbp, %rsi
movq 0x8(%rsp), %rdi
callq 0xb8c0
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa038
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
pushq $0x18
popq %rdx
callq 0x4490
movq %r13, %rdi
callq 0x4170
movq %r15, %rdi
movq 0x68(%rsp), %rsi
callq 0x4210
jmp 0xa094
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x9f97
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
pushq $0x18
popq %rdx
callq 0x4490
movq %r13, %rdi
callq 0x4170
movq %r15, %rdi
movq 0x60(%rsp), %rsi
callq 0x4210
movq %r15, %rdi
callq 0x4290
jmp 0x9f97
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0xa10d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
movq 0x8(%rsp), %rbx
callq 0x4490
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x18(%rbx), %rsi
leaq 0x190(%rsp), %rdi
callq 0x4210
leaq 0x190(%rsp), %rdi
callq 0x4290
leaq 0xb0(%rsp), %rdi
callq 0x4170
movq 0x8(%rsp), %r13
leaq 0x30(%rsp), %rdi
callq 0xb94c
leaq 0xd0(%rsp), %rdi
callq 0xb786
leaq 0xf0(%rsp), %rdi
callq 0xb786
leaq 0x110(%rsp), %rdi
callq 0xb786
leaq 0x130(%rsp), %rdi
callq 0xb786
leaq 0x70(%rsp), %rdi
callq 0xb786
leaq 0x90(%rsp), %rdi
callq 0xb786
leaq 0x150(%rsp), %rdi
callq 0xb786
leaq 0x170(%rsp), %rdi
callq 0xb786
movq %r13, %rax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa21e
jmp 0xa20d
jmp 0xa28e
jmp 0xa21e
jmp 0xa21e
jmp 0xa20d
jmp 0xa20d
jmp 0xa28e
jmp 0xa28e
jmp 0xa21e
jmp 0xa21e
jmp 0xa20d
jmp 0xa20d
jmp 0xa28e
jmp 0xa28e
jmp 0xa21e
jmp 0xa21e
jmp 0xa20d
jmp 0xa20d
jmp 0xa28e
jmp 0xa28e
jmp 0xa21e
jmp 0xa20d
jmp 0xa28e
jmp 0xa21e
jmp 0xa20d
jmp 0xa28e
jmp 0xa1f6
movq %rax, %r14
leaq 0x190(%rsp), %rdi
jmp 0xa215
jmp 0xa28e
jmp 0xa28e
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4170
jmp 0xa291
jmp 0xa28e
movq %rax, %r14
leaq 0x190(%rsp), %rdi
callq 0x4290
jmp 0xa291
jmp 0xa239
jmp 0xa28e
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa29e
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2b5
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2c2
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2cf
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2dc
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2e6
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa2f3
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa300
movq %r13, 0x8(%rsp)
movq %rax, %r14
jmp 0xa30d
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x4170
leaq 0x30(%rsp), %rdi
callq 0xb94c
leaq 0xd0(%rsp), %rdi
callq 0xb786
leaq 0xf0(%rsp), %rdi
callq 0xb786
leaq 0x110(%rsp), %rdi
callq 0xb786
leaq 0x130(%rsp), %rdi
callq 0xb786
leaq 0x70(%rsp), %rdi
callq 0xb786
leaq 0x90(%rsp), %rdi
callq 0xb786
leaq 0x150(%rsp), %rdi
callq 0xb786
leaq 0x170(%rsp), %rdi
callq 0xb786
movq 0x8(%rsp), %rdi
callq 0x18002
movq %r14, %rdi
callq 0x4540
nop