// File: EmbeddedPaul166[P]SNMP-Agent/src/main.cpp
// Function: main
int main() 
{
    char * pPath =  getenv("PROJECT_PATH");
    if (pPath == nullptr)
    {
        std::cout << "Error: Source set-env file first" << std::endl;
        return 0;
    }
    std::string filePath(pPath);
    filePath += "/mibs/RFC1213-MIB.txt";
    Manager manager;
    manager.parse(filePath);
    encodeASequence(manager);
    encodeASequenceInsideASequence(manager);
    
    while (1)
    {
        std::string input;
        std::cout << std::endl;
        std::cout << "Input OID string:" << std::endl;
        std::cin >> input;
        std::cout << std::endl;
        if (std::cin.fail())
        {
            std::cout << "Bad input!" << std::endl;
            continue;
        }
        else
        {
            manager.getNodeByOID(input);
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl $0x0, -0x4(%rbp)
leaq 0x40272(%rip), %rdi     # 0x480eb
callq 0x6550
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7eb6
movq 0x61118(%rip), %rdi     # 0x68fa8
leaq 0x40261(%rip), %rsi     # 0x480f8
callq 0x6450
movq %rax, %rdi
movq 0x610da(%rip), %rsi     # 0x68f80
callq 0x64b0
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x67a0
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x8130
jmp 0x7eea
leaq -0x31(%rbp), %rdi
callq 0x64d0
leaq 0x4021f(%rip), %rsi     # 0x48119
leaq -0x30(%rbp), %rdi
callq 0x6440
jmp 0x7f05
leaq -0x70(%rbp), %rdi
callq 0x9b10
jmp 0x7f10
leaq -0x90(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x61d0
jmp 0x7f22
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x9f50
jmp 0x7f34
leaq -0x90(%rbp), %rdi
callq 0x62e0
leaq -0x70(%rbp), %rdi
callq 0x6a90
jmp 0x7f4b
leaq -0x70(%rbp), %rdi
callq 0x79b0
jmp 0x7f56
jmp 0x7f58
jmp 0x7f5a
leaq -0xb0(%rbp), %rdi
callq 0x6600
movq 0x6103b(%rip), %rdi     # 0x68fa8
movq 0x6100c(%rip), %rsi     # 0x68f80
callq 0x64b0
jmp 0x7f7b
movq 0x61026(%rip), %rdi     # 0x68fa8
leaq 0x401a6(%rip), %rsi     # 0x4812f
callq 0x6450
movq %rax, -0xd0(%rbp)
jmp 0x7f97
movq -0xd0(%rbp), %rdi
movq 0x60fdb(%rip), %rsi     # 0x68f80
callq 0x64b0
jmp 0x7fac
movq 0x61025(%rip), %rdi     # 0x68fd8
leaq -0xb0(%rbp), %rsi
callq 0x6590
jmp 0x7fc1
movq 0x60fe0(%rip), %rdi     # 0x68fa8
movq 0x60fb1(%rip), %rsi     # 0x68f80
callq 0x64b0
jmp 0x7fd6
movq 0x60ffb(%rip), %rdi     # 0x68fd8
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6030
movb %al, -0xd1(%rbp)
jmp 0x7ff4
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x8003
jmp 0x80b0
movq 0x60f9e(%rip), %rdi     # 0x68fa8
leaq 0x40130(%rip), %rsi     # 0x48141
callq 0x6450
movq %rax, -0xe0(%rbp)
jmp 0x801f
movq -0xe0(%rbp), %rdi
movq 0x60f53(%rip), %rsi     # 0x68f80
callq 0x64b0
jmp 0x8034
movl $0x2, -0xb4(%rbp)
jmp 0x80ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x64d0
jmp 0x8102
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x80f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x80f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x62e0
jmp 0x80f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x62e0
jmp 0x80f0
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xa440
jmp 0x80c2
jmp 0x80c4
movl $0x0, -0xb4(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x62e0
movl -0xb4(%rbp), %eax
testl %eax, %eax
je 0x80eb
jmp 0x80e6
jmp 0x7f58
jmp 0x7f58
leaq -0x70(%rbp), %rdi
callq 0x9ca0
leaq -0x30(%rbp), %rdi
callq 0x62e0
movq -0x40(%rbp), %rdi
callq 0x6790
nopl (%rax,%rax)