// File: /workspace/github_cpp_makefile_star2_O1/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 0x9050
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
callq 0x9ba4
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
decl %eax
leaq 0x24(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x8(%rsp), %rdi
callq 0x912a
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x9cc2
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x9482
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 0x9ba4
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq $0x3, %rcx
jb 0x94b7
movl $0x2, %r12d
leaq 0x7(%rsp), %r15
decq %rcx
movb (%rax,%r12,4), %al
cmpq %rcx, %r12
jne 0x9459
andb $0x7f, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9ba4
jmp 0x946a
orb $-0x80, %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9ba4
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r12
jb 0x943a
jmp 0x94b7
cmpq $0x8, %rcx
jne 0x94a7
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 0x9ba4
jmp 0x94b7
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
movq %rbx, %rdi
callq 0x9ba4
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x94ce
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x94ee
jmp 0x94ee
jmp 0x94ee
jmp 0x94ee
jmp 0x94e7
movq %rax, %r14
jmp 0x9508
jmp 0x94ee
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9508
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x5320
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x951c
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x5320
movq %r14, %rdi
callq 0x5550