user: 请从给定的汇编指令推导出C源代码：

```asm
<encode_oid>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    D3(%rip),%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    $0x1,%edi
  lea    0x1(%rax),%esi
  call   <calloc@plt>
  mov    $0x1,%esi
  mov    $0x6,%edi
  mov    %rax,%r13
  call   <calloc@plt>
  mov    %rbp,%rdi
  mov    %rax,0x8(%rsp)
  call   <strlen@plt>
  mov    $0x1,%edi
  lea    0x1(%rax),%esi
  call   <calloc@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  lea    0x10(%rsp),%rbp
  mov    %rax,%r14
  call   <strcpy@plt>
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  xor    %edi,%edi
  lea    (%rax,%rax,4),%r12d
  call   <strtok_r@plt>
  shl    $0x3,%r12d
  mov    %rax,%rdi
  call   <atoi@plt>
  xor    %edi,%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  add    %eax,%r12d
  mov    %r12b,0x2(%r14)
  call   <strtok_r@plt>
  test   %rax,%rax
  je     L11
  mov    %rax,%rdi
  mov    $0x3,%r12d
  cs nopw 0x0(%rax,%rax,1)
L37:
  call   <atoi@plt>
  mov    %eax,%edi
  mov    %eax,%r15d
  call   <oid_item_length@plt>
  mov    %r12d,%ecx
  mov    %r15d,%esi
  movzbl %al,%edx
  and    $0x7f,%esi
  sub    $0x2,%eax
  add    %edx,%r12d
  lea    -0x1(%r12),%edx
  mov    %sil,(%r14,%rdx,1)
  movsbl %al,%edx
  add    %ecx,%edx
  test   %al,%al
  js     L2
  nopl   0x0(%rax,%rax,1)
L55:
  shr    $0x7,%r15d
  mov    %edx,%ecx
  sub    $0x1,%eax
  sub    $0x1,%edx
  mov    %r15d,%esi
  or     $0xffffff80,%esi
  mov    %sil,(%r14,%rcx,1)
  cmp    $0xff,%al
  jne    L55
L2:
  xor    %edi,%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L37
  lea    -0x2(%r12),%eax
L4:
  movb   $0x6,(%r14)
  mov    %r12d,%esi
  mov    $0x1,%edi
  mov    %al,0x1(%r14)
  call   <calloc@plt>
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %rax,%rdi
  mov    %rax,%r15
  call   <memcpy@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  add    $0x28,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  mov    $0x1,%eax
  mov    $0x3,%r12d
  jmp    L4
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D3
type: string

tool: D3: .

assistant: ```c
unsigned char *encode_oid(unsigned char *array) {
  unsigned char *oid = NULL;
  unsigned char *buffer = (unsigned char *)calloc(1, strlen((char *)array) + 1);
  unsigned char *number = (unsigned char *)calloc(6, sizeof(unsigned char));
  unsigned int index = 2;
  unsigned char *oid_buffer = (unsigned char *)calloc(1, strlen((char *)array) + 1);
  unsigned int value = 0;
  char *saveptr;
  strcpy((char *)buffer, (char *)array);
  char *part;
  part = strtok_r((char *)buffer, ".", &saveptr);
  value = atoi(part) * 40;
  part = strtok_r(NULL, ".", &saveptr);
  value += atoi(part);
  oid_buffer[index] = value;
  index++;
  for (part = strtok_r(NULL, ".", &saveptr); part; part = strtok_r(NULL, ".", &saveptr)) {
    value = atoi(part);
    unsigned char length = oid_item_length(value);
    signed char j = 0;
    oid_buffer[index + length - 1] = value & 0x7F;
    for (j = length - 2; j >= 0; j--) {
      value = value >> 7;
      oid_buffer[index + j] = (value & 0x7F) | 0x80;
    }
    index += length;
  }
  oid_buffer[0] = 0x06;
  oid_buffer[1] = index - 2;
  oid = (unsigned char *)calloc(1, index);
  memcpy(oid, oid_buffer, index);
  free(buffer);
  free(number);
  free(oid_buffer);
  return oid;
}
```