// File: EmbeddedPaul166[P]SNMP-Agent/src/parser.cpp
// Function: Parser::parseCustomDataTypesInImport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Parser::parseCustomDataTypesInImport(std::string fileContent)
{ 
    std::smatch match;
    
    for (std::vector<std::string>::size_type i = m_customDataTypeNameVector.size() - 1; i != (std::vector<std::string>::size_type) - 1; i--)
    {
        std::string patternOneString = m_customDataTypeNameVector[i] + " ::=\\n\\s*[^:upper:c].*?\\n\\s*.*";
        std::string patternTwoString = m_customDataTypeNameVector[i] + " ::=\\n\\s*CHOICE((.*\\n)*?)\\s*\\}"; 
        std::regex patternOne(patternOneString);
        std::regex patternTwo(patternTwoString);
        std::regex patternThree("CHOICE");
        if (std::regex_search(fileContent, match, patternOne))
        {
            std::string matchString = match.str(0);
            if (!std::regex_search(matchString, match, patternThree))
            {
                m_customDataTypeStringVector.push_back(matchString);
            }
        }
        if (std::regex_search(fileContent, match, patternTwo))
        {
            m_customDataTypeStringVector.push_back(match.str(0)); 
        }
    } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rsi, -0x138(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x18eb0
movq -0x130(%rbp), %rdi
addq $0x18, %rdi
callq 0x8200
subq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x38(%rbp)
je 0x143dc
movq -0x130(%rbp), %rdi
addq $0x18, %rdi
movq -0x38(%rbp), %rsi
callq 0x82b0
movq %rax, %rsi
leaq 0x34426(%rip), %rdx     # 0x48545
leaq -0x58(%rbp), %rdi
callq 0x194f0
jmp 0x1412a
movq -0x130(%rbp), %rdi
addq $0x18, %rdi
movq -0x38(%rbp), %rsi
callq 0x82b0
movq %rax, %rsi
leaq 0x3460d(%rip), %rdx     # 0x48755
leaq -0x88(%rbp), %rdi
callq 0x194f0
jmp 0x14156
leaq -0xa8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movl $0x10, %edx
callq 0x195c0
jmp 0x1416d
leaq -0xc8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x10, %edx
callq 0x195c0
jmp 0x14187
leaq 0x343d6(%rip), %rsi     # 0x48564
leaq -0xe8(%rbp), %rdi
movl $0x10, %edx
callq 0x18ef0
jmp 0x141a1
movq -0x138(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
xorl %ecx, %ecx
callq 0x18f90
movb %al, -0x139(%rbp)
jmp 0x141c2
movb -0x139(%rbp), %al
testb $0x1, %al
jne 0x141d1
jmp 0x142c5
xorl %eax, %eax
movl %eax, %edx
leaq -0x108(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x18ff0
jmp 0x141e7
leaq -0x108(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
xorl %ecx, %ecx
callq 0x18f90
movb %al, -0x13a(%rbp)
jmp 0x14208
movb -0x13a(%rbp), %al
testb $0x1, %al
jne 0x142b9
jmp 0x14218
movq -0x130(%rbp), %rdi
addq $0x48, %rdi
leaq -0x108(%rbp), %rsi
callq 0x19670
jmp 0x14231
jmp 0x142b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x143a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x62e0
jmp 0x143a1
leaq -0x108(%rbp), %rdi
callq 0x62e0
movq -0x138(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
xorl %ecx, %ecx
callq 0x18f90
movb %al, -0x13b(%rbp)
jmp 0x142e6
movb -0x13b(%rbp), %al
testb $0x1, %al
jne 0x142f2
jmp 0x14357
movq -0x130(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x148(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x128(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x18ff0
jmp 0x1431a
movq -0x148(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x19300
jmp 0x1432f
leaq -0x128(%rbp), %rdi
callq 0x62e0
jmp 0x14357
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x62e0
jmp 0x143a1
leaq -0xe8(%rbp), %rdi
callq 0x19570
leaq -0xc8(%rbp), %rdi
callq 0x19570
leaq -0xa8(%rbp), %rdi
callq 0x19570
leaq -0x88(%rbp), %rdi
callq 0x62e0
leaq -0x58(%rbp), %rdi
callq 0x62e0
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x140f6
leaq -0xe8(%rbp), %rdi
callq 0x19570
leaq -0xc8(%rbp), %rdi
callq 0x19570
leaq -0xa8(%rbp), %rdi
callq 0x19570
leaq -0x88(%rbp), %rdi
callq 0x62e0
leaq -0x58(%rbp), %rdi
callq 0x62e0
jmp 0x143ee
leaq -0x30(%rbp), %rdi
callq 0x195a0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x195a0
movq -0x60(%rbp), %rdi
callq 0x6790