// File: /workspace/github_cpp_makefile_star2_O2/EmbeddedPaul166[P]SNMP-Agent/src/parser.cpp
// Function: Parser::isImportPresent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string Parser::isImportPresent(std::string fileContent)
{ 
    std::smatch match;
    std::regex pattern("IMPORTS\\s*((.*\\n)*?)\\s*OBJECT-TYPE");
    if (std::regex_search(fileContent, match, pattern))
    {
        std::string import = match.str(0); 
        
        pattern.assign("IMPORTS\\s*((.*\\n)*?)\\s*FROM");
        if (std::regex_search(import, match, pattern))
        {
            std::string importedDataTypes = match.str(1);
            pattern.assign("\\w+");
            std::sregex_iterator begin(importedDataTypes.cbegin(), importedDataTypes.cend(), pattern);
            std::sregex_iterator end;
            std::string customDataType;
            for (std::sregex_iterator it = begin; it != end; it++)
            {
                match = *it;
                m_customDataTypeNameVector.push_back(match.str(0));
            }
        }
        
        pattern.assign("FROM (.*)");
        if (std::regex_search(import, match, pattern))
        {
            std::string importPath(getenv("PROJECT_PATH"));
            importPath  = importPath + "/mibs/" + match.str(1) + ".txt";
            return importPath;
        }
    }
    return "";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, %rbx
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x11418(%rip), %rsi     # 0x19481
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb4e0
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x8333
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0xb562
leaq 0x113fa(%rip), %rsi     # 0x194a4
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x8229
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0x113d2(%rip), %rsi     # 0x194c0
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
leaq 0x30(%rsp), %rcx
xorl %r8d, %r8d
callq 0xb5b2
leaq 0xf0(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movaps %xmm0, -0x20(%rax)
movups %xmm0, -0x14(%rax)
leaq 0x168(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x90(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xb646
addq $0x18, 0x8(%rsp)
leaq 0x1b8(%rsp), %r13
leaq 0x90(%rsp), %rbp
leaq 0xd0(%rsp), %r15
leaq 0x10(%rsp), %rbx
leaq 0x178(%rsp), %r12
leaq 0x198(%rsp), %r14
movq %rbp, %rdi
movq %r15, %rsi
callq 0xb662
testb %al, %al
je 0x81eb
movq %rbx, %rdi
leaq 0xb0(%rsp), %rsi
callq 0xb66c
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xb562
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x174b0
movq %r12, %rdi
callq 0x4170
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xb68e
movq %r13, %rdi
callq 0xb94c
jmp 0x8193
leaq 0xb0(%rsp), %rdi
callq 0xb94c
leaq 0x158(%rsp), %rdi
callq 0x4170
leaq 0xf0(%rsp), %rdi
callq 0xb94c
leaq 0x138(%rsp), %rdi
callq 0xb94c
leaq 0x50(%rsp), %rdi
callq 0x4170
leaq 0x11294(%rip), %rsi     # 0x194c4
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0xb582
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0xb546
testb %al, %al
je 0x8329
leaq 0x10e89(%rip), %rdi     # 0x190eb
callq 0x43a0
leaq 0x118(%rsp), %rdx
movq (%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5398
leaq 0x11249(%rip), %rdx     # 0x194ce
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0xb74d
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xb562
leaq 0xd0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0xb6e6
leaq 0x10e62(%rip), %rdx     # 0x1912a
leaq 0x118(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xb6c7
leaq 0x118(%rsp), %rbx
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x43b0
movq %rbx, %rdi
callq 0x4170
leaq 0xd0(%rsp), %rdi
callq 0x4170
leaq 0x50(%rsp), %rdi
callq 0x4170
leaq 0x90(%rsp), %rdi
callq 0x4170
leaq 0x70(%rsp), %rdi
callq 0x4170
jmp 0x834b
leaq 0x70(%rsp), %rdi
callq 0x4170
leaq 0x1149a(%rip), %rsi     # 0x197d4
leaq 0x118(%rsp), %rdx
movq (%rsp), %rdi
callq 0x5398
leaq 0x30(%rsp), %rdi
callq 0xb786
leaq 0x10(%rsp), %rdi
callq 0xb94c
movq (%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
callq 0x4170
jmp 0x838a
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x4170
jmp 0x8399
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x4170
jmp 0x83ab
movq %rax, %r14
movq (%rsp), %rdi
jmp 0x8424
jmp 0x83cf
movq %rax, %r14
jmp 0x83f8
jmp 0x83ba
movq %rax, %r14
jmp 0x841f
jmp 0x83cf
jmp 0x83c5
jmp 0x83c5
movq %rax, %r14
jmp 0x8433
movq %rax, %r14
jmp 0x843d
movq %rax, %r14
jmp 0x8429
jmp 0x83e8
movq %rax, %r14
leaq 0x178(%rsp), %rdi
callq 0x4170
jmp 0x83eb
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0xb94c
leaq 0x158(%rsp), %rdi
callq 0x4170
leaq 0xf0(%rsp), %rdi
callq 0xb94c
leaq 0x138(%rsp), %rdi
callq 0xb94c
leaq 0x50(%rsp), %rdi
callq 0x4170
leaq 0x70(%rsp), %rdi
callq 0x4170
leaq 0x30(%rsp), %rdi
callq 0xb786
leaq 0x10(%rsp), %rdi
callq 0xb94c
movq %r14, %rdi
callq 0x4540
nop