user: Translate the below assembly code into C programming language:

```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     L6
  test   %r12d,%r12d
  jne    L140
  test   %r13,%r13
  jne    L140
  cmp    $0x80,%ebx
  je     L203
L150:
  cmp    $0x81,%ebx
  je     L168
  test   %ebx,%ebx
  je     L148
L6:
  xor    %r13d,%r13d
L64:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L107
  add    $0x20,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L140:
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <OPENSSL_gmtime_adj@plt>
  test   %eax,%eax
  je     L6
  cmp    $0x80,%ebx
  jne    L150
L203:
  mov    %r14,%rdi
  call   <utctime_string_from_tm@plt>
  mov    %rax,%r12
  jmp    L155
  nopw   0x0(%rax,%rax,1)
L148:
  mov    %r14,%rdi
  call   <rfc5280_string_from_tm@plt>
  mov    %rax,%r12
L155:
  test   %r12,%r12
  je     L14
  test   %rbp,%rbp
  je     L200
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0xd,%rax
  je     L1
  cmp    $0xf,%rax
  jne    L207
L156:
  movl   $0x81,0x0(%rbp)
  mov    %rbp,%r13
  mov    $0xf,%ebx
L197:
  mov    0x8(%rbp),%rdi
  call   <free@plt>
  mov    %r12,0x8(%rbp)
  mov    %rbx,0x10(%rbp)
  jmp    L64
  cs nopw 0x0(%rax,%rax,1)
L168:
  mov    %r14,%rdi
  call   <gentime_string_from_tm@plt>
  mov    %rax,%r12
  jmp    L155
  nopl   (%rax)
L200:
  xor    %eax,%eax
  call   <ASN1_TIME_new@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L6
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0xd,%rax
  je     L1
  cmp    $0xf,%rax
  je     L156
  mov    %rbp,%rdi
  call   <ASN1_TIME_free@plt>
L207:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L6
  nopl   0x0(%rax)
L1:
  movl   $0x80,0x0(%rbp)
  mov    %rbp,%r13
  mov    $0xd,%ebx
  jmp    L197
  nopl   0x0(%rax)
L14:
  mov    D14(%rip),%rax
  xor    %r13d,%r13d
  mov    (%rax),%esi
  mov    D1(%rip),%rax
  mov    (%rax),%edi
  call   <ASN1err@plt>
  jmp    L64
L107:
  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) {
    ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ, 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);
}
```