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

```asm
<encode_oid>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  lea    0x1(%rax),%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%r14
  mov    $0x1,%esi
  mov    $0x6,%edi
  call   <calloc@plt>
  mov    %rax,%r15
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%rbp
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    %rsp,%r13
  mov    %r13,%rdx
  lea    D14(%rip),%r12
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  call   <atoi@plt>
  lea    (%rax,%rax,4),%ebx
  shl    $0x3,%ebx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  call   <atoi@plt>
  add    %eax,%ebx
  mov    %bl,0x2(%rbp)
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  test   %rax,%rax
  je     L59
  mov    %rax,%rdi
  mov    $0x3,%r12d
  lea    D14(%rip),%r13
L33:
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    %eax,%edi
  call   <oid_item_length@plt>
  mov    %r12d,%esi
  movzbl %al,%edx
  add    %edx,%r12d
  lea    -0x1(%r12),%edx
  mov    %ebx,%ecx
  and    $0x7f,%ecx
  mov    %cl,0x0(%rbp,%rdx,1)
  sub    $0x2,%al
  js     L3
  movsbl %al,%edx
  add    %esi,%edx
L43:
  shr    $0x7,%ebx
  mov    %edx,%ecx
  mov    %ebx,%esi
  or     $0xffffff80,%esi
  mov    %sil,0x0(%rbp,%rcx,1)
  sub    $0x1,%edx
  sub    $0x1,%al
  jns    L43
L3:
  mov    %rsp,%rdx
  mov    %r13,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L33
L56:
  movb   $0x6,0x0(%rbp)
  lea    -0x2(%r12),%eax
  mov    %al,0x1(%rbp)
  mov    %r12d,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%rbx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    %rbx,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  mov    $0x3,%r12d
  jmp    L56
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D14
type: string

tool: D14: .

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;
}
```