// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8(%rsp)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
leaq 0x15081(%rip), %rsi     # 0x1e4c1
leaq 0xf8(%rsp), %r12
movq %r12, %rdi
movl $0x10, %edx
callq 0xe4b4
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x19bbf
testb %al, %al
je 0x9843
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0xe51c
leaq 0x15054(%rip), %rsi     # 0x1e4e4
leaq 0x15068(%rip), %rdx     # 0x1e4ff
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xeca4
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x19bbf
testb %al, %al
je 0x96ff
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0xe51c
leaq 0x1500c(%rip), %rsi     # 0x1e500
leaq 0x15008(%rip), %rdx     # 0x1e503
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xeca4
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0xe592
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 0x1a7e2
movq 0x190(%rsp), %rax
leaq 0x90(%rsp), %rdi
movq %rax, 0x38(%rdi)
leaq 0x50(%rsp), %rsi
callq 0x1baec
testb %al, %al
jne 0x966b
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 0xe80c
movq 0xc8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xe51c
movq %r14, %rdi
movq %r13, %rsi
callq 0x1bcc4
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x962e
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xe65a
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x9658
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1baec
testb %al, %al
je 0x95d4
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x9688
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x96ad
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x4320
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x96c7
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x96e4
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x96ff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0x14dfe(%rip), %rsi     # 0x1e504
leaq 0x14e00(%rip), %rdx     # 0x1e50d
leaq 0xf8(%rsp), %rdi
movl $0x10, %ecx
callq 0xeca4
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
addq %rdi, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x19bbf
testb %al, %al
je 0x9822
leaq 0x14995(%rip), %rdi     # 0x1e0eb
callq 0x43c0
leaq 0x158(%rsp), %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe6bc
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x5f70
leaq 0x14d71(%rip), %rsi     # 0x1e50e
leaq 0x90(%rsp), %rdi
callq 0x45b0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0xe51c
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %r8
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r15, %rcx
je 0x97e9
movq 0xa0(%rsp), %rdi
movq 0x10(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x9810
leaq 0x20(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x9807
movq 0x20(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x9899
leaq 0x90(%rsp), %rdi
callq 0x40e0
jmp 0x98a7
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9843
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4320
movq 0x8(%rsp), %rdi
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
leaq 0x14fbe(%rip), %rdx     # 0x1e814
movq %rdx, %rsi
callq 0x6006
leaq 0xf8(%rsp), %rdi
callq 0xe6fa
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x9882
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x8(%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4370
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x98cb
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x98d1
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 0x14835(%rip), %rsi     # 0x1e12a
leaq 0x50(%rsp), %rdi
callq 0x45b0
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x992f
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0x9936
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 0x43d0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x997a
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9995
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x99b0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x99cd
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x985e
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x985e
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a1a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x9a1a
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a3c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x9a3c
jmp 0x9a39
movq %rax, %r14
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0x9a5e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x9a5e
movq %rax, %r14
movq 0x8(%rsp), %rcx
movq (%rcx), %rdi
addq $0x10, %rcx
cmpq %rcx, %rdi
je 0x9b65
movq (%rcx), %rsi
jmp 0x9b5d
jmp 0x9a9a
movq %rax, %r14
jmp 0x9aee
jmp 0x9a84
movq %rax, %r14
jmp 0x9b4a
jmp 0x9a9a
jmp 0x9a92
jmp 0x9a92
movq %rax, %r14
jmp 0x9b86
movq %rax, %r14
jmp 0x9b65
jmp 0x9ace
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x9ad1
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x4320
jmp 0x9ad1
movq %rax, %r14
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x9aee
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x9b13
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x4320
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9b2d
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x9b4a
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9b65
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9b86
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4320
leaq 0xf8(%rsp), %rdi
callq 0xe6fa
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x9baa
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4550