// File: /workspace/github_cpp_makefile_star2_O3/EmbeddedPaul166[P]SNMP-Agent/src/coder.cpp
// Function: Coder::encodeObjectIdentifier(DataType&, std::vector<unsigned int, std::allocator<unsigned int>>&)
std::vector<std::byte> Coder::encodeObjectIdentifier(DataType & dataType, std::vector<unsigned int> & data)
{
    std::vector<std::byte> dataVector;
    dataVector.push_back(encodeID(dataType));
    int length = data.size() - 1;
    std::vector<std::byte> lengthInBytes = encodeLength(length);
    dataVector.insert(dataVector.end(), lengthInBytes.begin(), lengthInBytes.end());
    if (data.size() > 2)
    {
        uint8_t firstElement = 40*data[0] + data[1];
        firstElement |= (1 << 7);
        dataVector.push_back(static_cast<std::byte>(firstElement));
        for (std::vector<unsigned int>::size_type i = 2; i < data.size(); i++)
        {
            if (i == data.size() - 1)
            {
                uint8_t element = data[i];
                element &= ~(1 << 7);
                dataVector.push_back(static_cast<std::byte>(element));
            }
            else
            {
                uint8_t element = data[i];
                element |= (1 << 7);
                dataVector.push_back(static_cast<std::byte>(element));
            }
        }
    }
    else if (data.size() == 2)
    {
        uint8_t firstElement = 40*data[0] + data[1];
        firstElement &= ~(1 << 7);
        dataVector.push_back(static_cast<std::byte>(firstElement));
    }
    else
    {
        dataVector.push_back(static_cast<std::byte>(0));
    }
    return dataVector;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rdx, %rsi
callq 0x808c
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x8bd8
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
decl %eax
leaq 0x24(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x8(%rsp), %rdi
callq 0x8166
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x8cfe
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x84d8
movl (%rax), %ecx
leal (%rcx,%rcx,4), %ecx
shll $0x3, %ecx
addl 0x4(%rax), %ecx
orb $-0x80, %cl
leaq 0x7(%rsp), %rsi
movb %cl, (%rsi)
movq %rbx, %rdi
callq 0x8bd8
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq $0x3, %rcx
jb 0x850d
movl $0x2, %r12d
leaq 0x7(%rsp), %r15
decq %rcx
movb (%rax,%r12,4), %al
cmpq %rcx, %r12
jne 0x84af
andb $0x7f, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8bd8
jmp 0x84c0
orb $-0x80, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8bd8
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r12
jb 0x8490
jmp 0x850d
cmpq $0x8, %rcx
jne 0x84fd
movl (%rax), %ecx
leal (%rcx,%rcx,4), %ecx
shll $0x3, %ecx
addl 0x4(%rax), %ecx
andb $0x7f, %cl
leaq 0x7(%rsp), %rsi
movb %cl, (%rsi)
movq %rbx, %rdi
callq 0x8bd8
jmp 0x850d
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
movq %rbx, %rdi
callq 0x8bd8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8524
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x8544
jmp 0x8544
jmp 0x8544
jmp 0x8544
jmp 0x853d
movq %rax, %r14
jmp 0x855e
jmp 0x8544
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x855e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8572
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4550