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

```asm
<TimeFmt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  jns    L24
  mov    -0x38(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  jmp    L329
L24:
  lea    -0x18(%rbp),%rdi
  lea    -0x1c(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  lea    -0x24(%rbp),%rsi
  mov    -0x40(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <Time_hmsl@plt>
  jmp    L330
L298:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  je     L43
  mov    -0x48(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L330
L43:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  test   %eax,%eax
  je     L330
  test   %eax,%eax
  js     L221
  cmp    $0x73,%eax
  jg     L221
  cmp    $0x47,%eax
  jl     L221
  sub    $0x47,%eax
  cmp    $0x2c,%eax
  ja     L221
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D28(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D28(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L221:
  mov    -0x48(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L330
  mov    -0x24(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D115(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x24(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D134(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L240
  movl   $0xc,-0x14(%rbp)
  jmp    L67
L240:
  mov    -0x24(%rbp),%eax
  cmp    $0xc,%eax
  jle    L351
  mov    -0x24(%rbp),%eax
  sub    $0xc,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L67
L351:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L67:
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D115(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L305
  movl   $0xc,-0x14(%rbp)
  jmp    L143
L305:
  mov    -0x24(%rbp),%eax
  cmp    $0xc,%eax
  jle    L130
  mov    -0x24(%rbp),%eax
  sub    $0xc,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L143
L130:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L143:
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D134(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x20(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D115(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x20(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D134(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D115(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D134(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x18(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D54(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x18(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    D134(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x24(%rbp),%eax
  cmp    $0xb,%eax
  jle    L62
  lea    D97(%rip),%rax
  jmp    L28
L62:
  lea    D93(%rip),%rax
L28:
  mov    -0x10(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L330
  mov    -0x24(%rbp),%eax
  cmp    $0xb,%eax
  jle    L58
  lea    D66(%rip),%rax
  jmp    L30
L58:
  lea    D14(%rip),%rax
L30:
  mov    -0x10(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x10(%rbp)
  addq   $0x1,-0x48(%rbp)
  nop
L330:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L298
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
L329:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L17
  call   <__stack_chk_fail@plt>
L17:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D115
datatype: string
name: parse_data
arguments: data_label: D134
datatype: string
name: parse_data
arguments: data_label: D54
datatype: string
name: parse_data
arguments: data_label: D97
datatype: string
name: parse_data
arguments: data_label: D93
datatype: string
name: parse_data
arguments: data_label: D66
datatype: string
name: parse_data
arguments: data_label: D14
datatype: string

tool: D115: %02d

tool: D134: %d

tool: D54: %03d

tool: D97: PM

tool: D93: AM

tool: D66: pm

tool: D14: am

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