// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x1509d(%rip), %rsi     # 0x1f4c1
leaq 0xf8(%rsp), %rdi
movl $0x10, %edx
callq 0xf4b6
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ab53
testb %al, %al
je 0xa995
movq %r15, 0x8(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0xf51e
leaq 0x15067(%rip), %rsi     # 0x1f4e4
leaq 0x1507b(%rip), %rdx     # 0x1f4ff
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xfc7a
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ab53
testb %al, %al
je 0xa6ec
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0xf51e
leaq 0x1501f(%rip), %rsi     # 0x1f500
leaq 0x1501b(%rip), %rdx     # 0x1f503
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xfc7a
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0xf598
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x50(%rsp)
movups %xmm0, 0x5c(%rsp)
leaq 0x148(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x178(%rsp), %rsi
movups -0x20(%rsi), %xmm0
movups -0x14(%rsi), %xmm1
leaq 0xb0(%rsp), %rdi
movups %xmm1, -0x14(%rdi)
movaps %xmm0, -0x20(%rdi)
callq 0x1b778
movq 0x190(%rsp), %rax
leaq 0x90(%rsp), %rdi
movq %rax, 0x38(%rdi)
leaq 0x50(%rsp), %rsi
callq 0x1ca70
testb %al, %al
jne 0xa658
addq $0x18, %r14
leaq 0x30(%rsp), %r12
leaq 0x118(%rsp), %r13
leaq 0x198(%rsp), %rbp
leaq 0x90(%rsp), %rbx
leaq 0x50(%rsp), %r15
movq %r12, %rdi
leaq 0xb0(%rsp), %rsi
callq 0xf812
movq 0xc8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xf51e
movq %r14, %rdi
movq %r13, %rsi
callq 0x1cc5c
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0xa61b
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5320
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xf660
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0xa645
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1ca70
testb %al, %al
je 0xa5c1
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xa675
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xa69a
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x5320
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xa6b4
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0xa6d1
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa6ec
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0x14e11(%rip), %rsi     # 0x1f504
leaq 0x14e13(%rip), %rdx     # 0x1f50d
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xfc7a
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ab53
movl %eax, %ebp
testb %al, %al
je 0xa80b
leaq 0x149a6(%rip), %rdi     # 0x1f0eb
callq 0x53c0
leaq 0x158(%rsp), %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xf6c2
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x6f5e
leaq 0x14d82(%rip), %rsi     # 0x1f50e
leaq 0x90(%rsp), %rdi
callq 0x55b0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0xf51e
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %r8
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r15, %rcx
je 0xa7d8
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xa7f7
leaq 0x20(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0xa7f2
movq 0x20(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xa836
movq 0x10(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x50e0
jmp 0xa844
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa82c
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5320
movq 0x8(%rsp), %r15
jmp 0xa995
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5370
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xa868
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xa86e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x14898(%rip), %rsi     # 0x1f12a
leaq 0x50(%rsp), %rdi
callq 0x55b0
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa8cc
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0xa8d3
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x158(%rsp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x53d0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0xa917
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa932
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa94d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5320
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xa96a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa98b
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5320
testb %bpl, %bpl
movq 0x8(%rsp), %r15
jne 0xa9ae
leaq 0x10(%r15), %rax
movq %rax, (%r15)
leaq 0x14e71(%rip), %rdx     # 0x1f814
movq %r15, %rdi
movq %rdx, %rsi
callq 0x6fee
leaq 0xf8(%rsp), %rdi
callq 0xf700
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa9d2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq %r15, %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaa0a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5320
jmp 0xaa0a
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaa2c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5320
jmp 0xaa2c
jmp 0xaa29
movq %rax, %r14
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xaa4e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x5320
jmp 0xaa4e
movq %rax, %r14
movq 0x8(%rsp), %rcx
movq (%rcx), %rdi
addq $0x10, %rcx
cmpq %rcx, %rdi
je 0xab5d
movq (%rcx), %rsi
jmp 0xab55
jmp 0xaa92
movq %rax, %r14
jmp 0xaae6
jmp 0xaa74
movq %rax, %r14
jmp 0xab42
jmp 0xaa92
jmp 0xaa82
jmp 0xaa82
movq %rax, %r14
jmp 0xab7e
movq %rax, %r14
jmp 0xab8b
movq %rax, %r14
jmp 0xab5d
jmp 0xaac6
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0xaac9
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5320
jmp 0xaac9
movq %rax, %r14
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xaae6
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xab0b
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x5320
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xab25
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0xab42
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xab5d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xab7e
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5320
leaq 0xf8(%rsp), %rdi
callq 0xf700
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xaba2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq %r14, %rdi
callq 0x5550