user: 请将以下的汇编代码转换成C语言代码：

```asm
<convert_human_date_format>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %eax,%eax
  add    $0x1,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <xcalloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movb   $0x0,-0x1e(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L186
L131:
  movb   $0x1,-0x1d(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    $0x59,%al
  je     L126
  movl   $0x0,-0x1c(%rbp)
L126:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L84
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x44,%eax
  cmp    $0x35,%eax
  seta   %dl
  test   %dl,%dl
  jne    L54
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  movabs $0x100000001,%rdx
  and    %rax,%rdx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L135
  movabs $0x20000000200,%rdx
  and    %rax,%rdx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L92
  movabs $0x20000000200000,%rdx
  and    %rdx,%rax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  je     L54
  cmpb   $0x59,-0x1e(%rbp)
  je     L10
  mov    -0x10(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addq   $0x2,-0x10(%rbp)
  movb   $0x59,-0x1e(%rbp)
L10:
  addl   $0x1,-0x1c(%rbp)
  cmpl   $0x2,-0x1c(%rbp)
  jle    L113
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movb   $0x59,(%rax)
  jmp    L113
L92:
  cmpb   $0x4d,-0x1e(%rbp)
  je     L146
  mov    -0x10(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addq   $0x2,-0x10(%rbp)
  movb   $0x4d,-0x1e(%rbp)
  jmp    L146
L135:
  cmpb   $0x44,-0x1e(%rbp)
  je     L76
  mov    -0x10(%rbp),%rax
  lea    D32(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addq   $0x2,-0x10(%rbp)
  movb   $0x44,-0x1e(%rbp)
  jmp    L76
L54:
  movb   $0x0,-0x1d(%rbp)
  jmp    L20
L84:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <ispunct@plt>
  test   %rax,%rax
  je     L136
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x18(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movb   $0x0,-0x1e(%rbp)
  jmp    L20
L136:
  movb   $0x0,-0x1d(%rbp)
  jmp    L20
L113:
  nop
  jmp    L20
L146:
  nop
  jmp    L20
L76:
  nop
L20:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  cmpb   $0x0,-0x1d(%rbp)
  sete   %al
  movzbl %al,%eax
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <is_fatal@plt>
  addq   $0x1,-0x18(%rbp)
L186:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L131
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type_infered: string
name: unpack_data
arguments: label: D4
type_infered: string
name: unpack_data
arguments: label: D32
type_infered: string
name: unpack_data
arguments: label: D7
type_infered: string

tool: D2: %y

tool: D4: %m

tool: D32: %d

tool: D7: Invalid character "%c" in date format!

assistant: ```c
char *convert_human_date_format(const char *human_datef) {
  char *result, *cin, *cout;
  char prev;
  int ylen;
  result = (char *)xcalloc((2 * strlen(human_datef)) + 1, 1);
  cout = result;
  prev = '\0';
  ylen = 0;
  for (cin = (char *)human_datef; *cin; cin++) {
    char okay = 1;
    if (toupper(*cin) != 'Y')
      ylen = 0;
    if (isalpha(*cin)) {
      switch (*cin) {
      case 'y':
      case 'Y':
        if (prev != 'Y') {
          strcat(cout, "%y");
          cout += 2;
          prev = 'Y';
        }
        ylen++;
        if (ylen > 2)
          *(cout - 1) = 'Y';
        break;
      case 'm':
      case 'M':
        if (prev != 'M') {
          strcat(cout, "%m");
          cout += 2;
          prev = 'M';
        }
        break;
      case 'd':
      case 'D':
        if (prev != 'D') {
          strcat(cout, "%d");
          cout += 2;
          prev = 'D';
        }
        break;
      default:
        okay = 0;
      }
    } else if (ispunct(*cin)) {
      *cout++ = *cin;
      prev = '\0';
    } else
      okay = 0;
    is_fatal(okay == 0, "Invalid character \"%c\" in date format!", *cin);
  }
  return result;
}
```