user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<TimeFmt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  js     L22
  mov    %rsi,%rdi
  mov    %rdx,%rbx
  lea    0x10(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    0x14(%rsp),%r8
  call   <Time_hmsl@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  je     L179
  mov    %r12,%rbp
  lea    D63(%rip),%r13
  lea    D85(%rip),%r15
  lea    D121(%rip),%r14
  jmp    L160
L22:
  movb   $0x0,(%rdi)
  jmp    L178
L214:
  add    $0x1,%rbx
  mov    %al,0x0(%rbp)
  lea    0x1(%rbp),%rbp
L264:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L271
L160:
  cmp    $0x25,%al
  jne    L214
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L161
  lea    -0x47(%rax),%edx
  cmp    $0x2c,%dl
  ja     L277
  ja     L277
  movzbl %dl,%edx
  movslq 0x0(%r13,%rdx,4),%rdx
  add    %r13,%rdx
  notrack jmp *%rdx
L161:
  add    $0x1,%rbx
  jmp    L264
L277:
  add    $0x2,%rbx
  mov    %al,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  jmp    L264
  mov    0x8(%rsp),%edx
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x8(%rsp),%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L165
  lea    -0xc(%rdx),%eax
  cmp    $0xc,%edx
  cmovg  %eax,%edx
L129:
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
L165:
  mov    $0xc,%edx
  jmp    L129
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L67
  lea    -0xc(%rdx),%eax
  cmp    $0xc,%edx
  cmovg  %eax,%edx
L13:
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
L67:
  mov    $0xc,%edx
  jmp    L13
  mov    0xc(%rsp),%edx
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0xc(%rsp),%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x10(%rsp),%edx
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x10(%rsp),%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x14(%rsp),%edx
  lea    D94(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  mov    0x14(%rsp),%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  cmpl   $0xb,0x8(%rsp)
  lea    D125(%rip),%rsi
  lea    D133(%rip),%rax
  cmovg  %rax,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
  cmpl   $0xb,0x8(%rsp)
  mov    %r14,%rsi
  cmovg  %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  add    $0x2,%rbx
  jmp    L264
L179:
  mov    %r12,%rbp
L271:
  movb   $0x0,0x0(%rbp)
L178:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L274
  mov    %r12,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L274:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D85
datatype: string
name: disassemble_data
arguments: data_tag: D121
datatype: string
name: disassemble_data
arguments: data_tag: D7
datatype: string
name: disassemble_data
arguments: data_tag: D58
datatype: string
name: disassemble_data
arguments: data_tag: D94
datatype: string
name: disassemble_data
arguments: data_tag: D125
datatype: string
name: disassemble_data
arguments: data_tag: D133
datatype: string

tool: D85: pm

tool: D121: am

tool: D7: %02d

tool: D58: %d

tool: D94: %03d

tool: D125: AM

tool: D133: PM

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