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

```asm
<TimeFmt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  js     L153
  mov    %rsi,%rdi
  mov    %rdx,%rbx
  lea    0x10(%rsp),%rcx
  mov    %r12,%r15
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    0x14(%rsp),%r8
  call   <Time_hmsl@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  je     L216
  lea    D35(%rip),%rbp
  lea    D58(%rip),%r14
  lea    D117(%rip),%r13
  jmp    L103
  xchg   %ax,%ax
L159:
  mov    %al,(%r15)
  add    $0x1,%r15
  movzbl 0x1(%rbx),%eax
  mov    %rdx,%rbx
L220:
  test   %al,%al
  je     L216
L103:
  lea    0x1(%rbx),%rdx
  cmp    $0x25,%al
  jne    L159
  movzbl 0x1(%rbx),%edx
  test   %dl,%dl
  je     L216
  lea    -0x47(%rdx),%eax
  cmp    $0x2c,%al
  ja     L126
  movzbl %al,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L216:
  movb   $0x0,(%r15)
L27:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L259
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L153:
  movb   $0x0,(%rdi)
  jmp    L27
  nopl   (%rax)
L126:
  mov    %dl,(%r15)
  add    $0x2,%rbx
  movzbl (%rbx),%eax
  add    $0x1,%r15
  jmp    L220
  nopl   0x0(%rax,%rax,1)
  mov    0x8(%rsp),%edx
  lea    D101(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  nopl   0x0(%rax,%rax,1)
L135:
  mov    %r15,%rdi
  add    $0x2,%rbx
  call   <strlen@plt>
  cltq
  add    %rax,%r15
  movzbl (%rbx),%eax
  jmp    L220
  nopl   0x0(%rax)
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L195
  lea    -0xc(%rdx),%eax
  cmp    $0xc,%edx
  cmovg  %eax,%edx
L140:
  lea    D101(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  xchg   %ax,%ax
  mov    0x14(%rsp),%edx
  lea    D33(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  nopl   (%rax)
  mov    0xc(%rsp),%edx
  jmp    L140
  xchg   %ax,%ax
  cmpl   $0xb,0x8(%rsp)
  lea    D123(%rip),%rsi
  lea    D48(%rip),%rax
  cmovg  %rax,%rsi
L132:
  mov    %r15,%rdi
  call   <strcpy@plt>
  jmp    L135
  nopl   0x0(%rax)
  mov    0x10(%rsp),%edx
  lea    D101(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  mov    0x8(%rsp),%edx
  lea    D12(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  nopl   0x0(%rax,%rax,1)
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L208
  lea    -0xc(%rdx),%eax
  cmp    $0xc,%edx
  cmovg  %eax,%edx
L48:
  lea    D12(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  nopl   (%rax)
  mov    0x14(%rsp),%edx
  jmp    L48
  xchg   %ax,%ax
  cmpl   $0xb,0x8(%rsp)
  mov    %r13,%rsi
  cmovg  %r14,%rsi
  jmp    L132
  nopl   0x0(%rax)
  mov    0x10(%rsp),%edx
  lea    D12(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  mov    0xc(%rsp),%edx
  lea    D12(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  jmp    L135
  nopl   0x0(%rax,%rax,1)
L208:
  mov    $0xc,%edx
  jmp    L48
  nopw   0x0(%rax,%rax,1)
L195:
  mov    $0xc,%edx
  jmp    L140
L259:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D58
type_guessed: string
name: read_data
arguments: data_tag: D117
type_guessed: string
name: read_data
arguments: data_tag: D101
type_guessed: string
name: read_data
arguments: data_tag: D33
type_guessed: string
name: read_data
arguments: data_tag: D123
type_guessed: string
name: read_data
arguments: data_tag: D48
type_guessed: string
name: read_data
arguments: data_tag: D12
type_guessed: string

tool: D58: pm

tool: D117: am

tool: D101: %02d

tool: D33: %03d

tool: D123: AM

tool: D48: PM

tool: D12: %d

assistant: ```c
char *TimeFmt(char *buf, long tm, char *msk) {
  int h, m, s, l;
  char *bp = buf;
  int temp;
  if (tm < 0L) {
    *buf = '\0';
    return (buf);
  }
  Time_hmsl(tm, &h, &m, &s, &l);
  while (*msk)
    if (*msk != '%')
      *bp++ = *msk++;
    else
      switch (*++msk) {
      case '\0':
        break;
      case '%':
      default:
        *bp++ = *msk++;
        break;
      case 'G':
        sprintf(bp, "%02d", h);
        bp += strlen(bp);
        msk++;
        break;
      case 'g':
        sprintf(bp, "%d", h);
        bp += strlen(bp);
        msk++;
        break;
      case 'H':
        if (!h)
          temp = 12;
        else if (h > 12)
          temp = h - 12;
        else
          temp = h;
        sprintf(bp, "%02d", temp);
        bp += strlen(bp);
        msk++;
        break;
      case 'h':
        if (!h)
          temp = 12;
        else if (h > 12)
          temp = h - 12;
        else
          temp = h;
        sprintf(bp, "%d", temp);
        bp += strlen(bp);
        msk++;
        break;
      case 'M':
        sprintf(bp, "%02d", m);
        bp += strlen(bp);
        msk++;
        break;
      case 'm':
        sprintf(bp, "%d", m);
        bp += strlen(bp);
        msk++;
        break;
      case 'S':
        sprintf(bp, "%02d", s);
        bp += strlen(bp);
        msk++;
        break;
      case 's':
        sprintf(bp, "%d", s);
        bp += strlen(bp);
        msk++;
        break;
      case 'L':
        sprintf(bp, "%03d", l);
        bp += strlen(bp);
        msk++;
        break;
      case 'l':
        sprintf(bp, "%d", l);
        bp += strlen(bp);
        msk++;
        break;
      case 'P':
        strcpy(bp, h >= 12 ? "PM" : "AM");
        bp += strlen(bp);
        msk++;
        break;
      case 'p':
        strcpy(bp, h >= 12 ? "pm" : "am");
        bp += strlen(bp);
        msk++;
        break;
      }
  *bp = '\0';
  return (buf);
}
```