user: Converte this assembly snippet into its equivalent C code:

```asm
<aim_interpolate_variables>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x68(%rbp)
  movl   $0x0,-0x64(%rbp)
  movl   $0x1,-0x5c(%rbp)
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,-0x6c(%rbp)
  lea    -0x6c(%rbp),%rax
  mov    %rax,%rdi
  call   <localtime@plt>
  mov    %rax,-0x50(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  jne    L276
  mov    $0x0,%eax
  jmp    L62
L276:
  mov    -0x50(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x60(%rbp)
  cmpl   $0xb,-0x60(%rbp)
  jle    L10
  movl   $0x0,-0x5c(%rbp)
L10:
  cmpl   $0xc,-0x60(%rbp)
  jle    L108
  subl   $0xc,-0x60(%rbp)
L108:
  cmpl   $0x0,-0x60(%rbp)
  jne    L165
  movl   $0xc,-0x60(%rbp)
L165:
  cmpl   $0x1,-0x5c(%rbp)
  jne    L163
  lea    D56(%rip),%rax
  jmp    L135
L163:
  lea    D79(%rip),%rax
L135:
  mov    -0x50(%rbp),%rdx
  mov    0x8(%rdx),%esi
  mov    -0x50(%rbp),%rdx
  mov    0x4(%rdx),%ecx
  mov    -0x60(%rbp),%edx
  lea    -0x17(%rbp),%rdi
  mov    %rax,%r9
  mov    %esi,%r8d
  lea    D26(%rip),%rax
  mov    %rax,%rsi
  call   <sprintf@plt>
  mov    -0x50(%rbp),%rax
  mov    0x14(%rax),%eax
  lea    0x76c(%rax),%esi
  mov    -0x50(%rbp),%rax
  mov    0x10(%rax),%ecx
  mov    -0x50(%rbp),%rax
  mov    0xc(%rax),%eax
  lea    0x1(%rax),%edx
  lea    -0x26(%rbp),%rax
  mov    %esi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D18(%rip),%rdx
  mov    $0xf,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x48(%rbp)
  lea    -0x26(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x40(%rbp)
  lea    -0x17(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x30(%rbp)
  movq   $0x0,-0x58(%rbp)
  jmp    L160
L3:
  mov    -0x78(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x74,%eax
  je     L233
  cmp    $0x74,%eax
  jg     L282
  cmp    $0x6e,%eax
  je     L178
  cmp    $0x6e,%eax
  jg     L282
  cmp    $0x25,%eax
  je     L194
  cmp    $0x64,%eax
  je     L204
  jmp    L282
L194:
  cmpl   $0x1,-0x64(%rbp)
  jne    L237
  movl   $0x0,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x25,(%rax,%rdx,1)
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x25,(%rax,%rdx,1)
  jmp    L125
L237:
  movl   $0x1,-0x64(%rbp)
  jmp    L125
L178:
  cmpl   $0x1,-0x64(%rbp)
  jne    L58
  movl   $0x0,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    D73(%rip),%rdx
  lea    (%rax,%rdx,1),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x48(%rbp),%rax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x68(%rbp)
  jmp    L125
L58:
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x6e,(%rax,%rdx,1)
  jmp    L125
L204:
  cmpl   $0x1,-0x64(%rbp)
  jne    L199
  movl   $0x0,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    D73(%rip),%rdx
  lea    (%rax,%rdx,1),%rcx
  mov    -0x40(%rbp),%rdx
  lea    -0x26(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x68(%rbp)
  jmp    L125
L199:
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x64,(%rax,%rdx,1)
  jmp    L125
L233:
  cmpl   $0x1,-0x64(%rbp)
  jne    L20
  movl   $0x0,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    D73(%rip),%rdx
  lea    (%rax,%rdx,1),%rcx
  mov    -0x38(%rbp),%rdx
  lea    -0x17(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x38(%rbp),%rax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x68(%rbp)
  jmp    L125
L20:
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x74,(%rax,%rdx,1)
  jmp    L125
L282:
  cmpl   $0x1,-0x64(%rbp)
  jne    L35
  movl   $0x0,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  cltq
  lea    D73(%rip),%rdx
  movb   $0x25,(%rax,%rdx,1)
L35:
  mov    -0x78(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  movzbl (%rcx),%edx
  cltq
  lea    D73(%rip),%rcx
  mov    %dl,(%rax,%rcx,1)
L125:
  addq   $0x1,-0x58(%rbp)
L160:
  mov    -0x58(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L3
  mov    -0x68(%rbp),%eax
  cltq
  lea    D73(%rip),%rdx
  movb   $0x0,(%rax,%rdx,1)
  lea    D73(%rip),%rax
L62:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L196
  call   <__stack_chk_fail@plt>
L196:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D56
type: string
name: parse_data
arguments: label: D79
type: string
name: parse_data
arguments: label: D26
type: string
name: parse_data
arguments: label: D18
type: string

tool: D56: AM

tool: D79: PM

tool: D26: %d:%02d:%02d %s

tool: D18: %d/%d/%d

assistant: ```c
char *aim_interpolate_variables(const char *const input, const char *const nickname) {
  static char output[16384];
  int o = 0, gotpercent = 0;
  size_t nl, dl, tl, l, i;
  char date[15], tim[15];
  {
    int hour;
    int am = 1;
    struct tm *t;
    time_t b;
    b = time(NULL);
    t = localtime(&b);
    if (t == NULL)
      return (NULL);
    hour = t->tm_hour;
    if (hour >= 12)
      am = 0;
    if (hour > 12)
      hour -= 12;
    if (hour == 0)
      hour = 12;
    sprintf(tim, "%d:%02d:%02d %s", hour, t->tm_min, t->tm_sec, am == 1 ? "AM" : "PM");
    snprintf(date, 15, "%d/%d/%d", t->tm_mon + 1, t->tm_mday, t->tm_year + 1900);
  }
  nl = strlen(nickname);
  dl = strlen(date);
  tl = strlen(tim);
  l = strlen(input);
  for (i = 0; i < l; i++)
    switch (input[i]) {
    case '%':
      if (gotpercent == 1) {
        gotpercent = 0;
        output[o++] = '%';
        output[o++] = '%';
      } else
        gotpercent = 1;
      break;
    case 'n':
      if (gotpercent == 1) {
        gotpercent = 0;
        memcpy(&output[o], nickname, nl);
        o += nl;
      } else
        output[o++] = 'n';
      break;
    case 'd':
      if (gotpercent == 1) {
        gotpercent = 0;
        memcpy(&output[o], date, dl);
        o += dl;
      } else
        output[o++] = 'd';
      break;
    case 't':
      if (gotpercent == 1) {
        gotpercent = 0;
        memcpy(&output[o], tim, tl);
        o += tl;
      } else
        output[o++] = 't';
      break;
    default:
      if (gotpercent == 1) {
        gotpercent = 0;
        output[o++] = '%';
      }
      output[o++] = input[i];
    }
  output[o] = 0;
  return (output);
}
```