user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ASN1_TIME_adj_internal>:
  endbr64
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x20,%rsp
  mov    %esi,0xc(%rsp)
  lea    0x14(%rsp),%r14
  lea    0xc(%rsp),%rdi
  mov    %r14,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <gmtime_r@plt>
  test   %rax,%rax
  je     L40
  test   %r12d,%r12d
  jne    L15
  test   %r13,%r13
  jne    L15
  cmp    $0x80,%ebx
  je     L12
L212:
  cmp    $0x81,%ebx
  je     L219
  test   %ebx,%ebx
  je     L138
L40:
  xor    %r13d,%r13d
L101:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L120
  add    $0x20,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L15:
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <OPENSSL_gmtime_adj@plt>
  test   %eax,%eax
  je     L40
  cmp    $0x80,%ebx
  jne    L212
L12:
  mov    %r14,%rdi
  call   <utctime_string_from_tm@plt>
  mov    %rax,%r12
  jmp    L144
  nopw   0x0(%rax,%rax,1)
L138:
  mov    %r14,%rdi
  call   <rfc5280_string_from_tm@plt>
  mov    %rax,%r12
L144:
  test   %r12,%r12
  je     L31
  test   %rbp,%rbp
  je     L172
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0xd,%rax
  je     L3
  cmp    $0xf,%rax
  jne    L158
L134:
  movl   $0x81,0x0(%rbp)
  mov    %rbp,%r13
  mov    $0xf,%ebx
L104:
  mov    0x8(%rbp),%rdi
  call   <free@plt>
  mov    %r12,0x8(%rbp)
  mov    %rbx,0x10(%rbp)
  jmp    L101
  cs nopw 0x0(%rax,%rax,1)
L219:
  mov    %r14,%rdi
  call   <gentime_string_from_tm@plt>
  mov    %rax,%r12
  jmp    L144
  nopl   (%rax)
L172:
  xor    %eax,%eax
  call   <ASN1_TIME_new@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L40
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0xd,%rax
  je     L3
  cmp    $0xf,%rax
  je     L134
  mov    %rbp,%rdi
  call   <ASN1_TIME_free@plt>
L158:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L40
  nopl   0x0(%rax)
L3:
  movl   $0x80,0x0(%rbp)
  mov    %rbp,%r13
  mov    $0xd,%ebx
  jmp    L104
  nopl   0x0(%rax)
L31:
  mov    D9(%rip),%rax
  xor    %r13d,%r13d
  mov    (%rax),%edi
  call   <ASN1error@plt>
  jmp    L101
L120:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ASN1_TIME *ASN1_TIME_adj_internal(ASN1_TIME *s, time_t t, int offset_day, long offset_sec, int mode) {
  int allocated = 0;
  struct tm tm;
  size_t len;
  char *p;
  if (gmtime_r(&t, &tm) == NULL)
    return (NULL);
  if (offset_day || offset_sec) {
    if (!OPENSSL_gmtime_adj(&tm, offset_day, offset_sec))
      return (NULL);
  }
  switch (mode) {
  case V_ASN1_UTCTIME:
    p = utctime_string_from_tm(&tm);
    break;
  case V_ASN1_GENERALIZEDTIME:
    p = gentime_string_from_tm(&tm);
    break;
  case 0:
    p = rfc5280_string_from_tm(&tm);
    break;
  default:
    return (NULL);
  }
  if (p == NULL) {
    ASN1error(ASN1_R_ILLEGAL_TIME_VALUE);
    return (NULL);
  }
  if (s == NULL) {
    if ((s = ASN1_TIME_new()) == NULL)
      return (NULL);
    allocated = 1;
  }
  len = strlen(p);
  switch (len) {
  case 15:
    s->type = V_ASN1_GENERALIZEDTIME;
    break;
  case 13:
    s->type = V_ASN1_UTCTIME;
    break;
  default:
    if (allocated)
      ASN1_TIME_free(s);
    free(p);
    return (NULL);
  }
  free(s->data);
  s->data = p;
  s->length = len;
  return (s);
}
```