// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdi)
movq %rdx, %rsi
callq 0x6fb8
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x79ec
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
decl %eax
leaq 0x24(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x8(%rsp), %rdi
callq 0x708e
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x79cc
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x7352
imull $0x28, (%rax), %ecx
addl 0x4(%rax), %ecx
orb $-0x80, %cl
leaq 0x7(%rsp), %rsi
movb %cl, (%rsi)
movq %rbx, %rdi
callq 0x79ec
pushq $0x2
popq %r12
leaq 0x7(%rsp), %r15
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r12
jae 0x7382
decq %rcx
movb (%rax,%r12,4), %al
cmpq %rcx, %r12
jne 0x733c
andb $0x7f, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x79ec
jmp 0x734d
orb $-0x80, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x79ec
incq %r12
jmp 0x730a
cmpq $0x8, %rcx
jne 0x7372
imull $0x28, (%rax), %ecx
addl 0x4(%rax), %ecx
andb $0x7f, %cl
leaq 0x7(%rsp), %rsi
movb %cl, (%rsi)
movq %rbx, %rdi
callq 0x79ec
jmp 0x7382
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
movq %rbx, %rdi
callq 0x79ec
leaq 0x8(%rsp), %rdi
callq 0x54f0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x73ac
jmp 0x73ac
jmp 0x73ac
jmp 0x73ac
jmp 0x73a5
movq %rax, %r14
jmp 0x73b9
jmp 0x73ac
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x54f0
movq %rbx, %rdi
callq 0x54f0
movq %r14, %rdi
callq 0x4540
nop