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

```asm
<reformatString>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r12
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L6:
  cmp    %rdx,%rsp
  je     L45
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L6
L45:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L110
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L110:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L61
L103:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x45(%rbp)
  movsbl -0x45(%rbp),%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L74
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    -0x30(%rbp),%rdx
  cltq
  movzbl -0x45(%rbp),%ecx
  mov    %cl,(%rdx,%rax,1)
L74:
  addl   $0x1,-0x44(%rbp)
L61:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L103
  mov    -0x30(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  movb   $0x0,(%rdx,%rax,1)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L83
L129:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x46(%rbp)
  movsbl -0x46(%rbp),%eax
  cmp    $0x43,%eax
  je     L119
  cmp    $0x63,%eax
  je     L8
  jmp    L21
L119:
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    -0x30(%rbp),%rdx
  cltq
  movzbl (%rdx,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x44(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x58(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,(%rbx)
  jmp    L100
L8:
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    -0x30(%rbp),%rdx
  cltq
  movzbl (%rdx,%rax,1),%eax
  movsbl %al,%eax
  mov    -0x44(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x58(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,(%rbx)
  jmp    L100
L21:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x46(%rbp),%eax
  mov    %al,(%rdx)
L100:
  addl   $0x1,-0x44(%rbp)
L83:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L129
  mov    %r12,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L77
  call   <__stack_chk_fail@plt>
L77:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void reformatString(char *word, char *format) {
  int len = (int)strlen(word);
  char trimmedWord[len];
  int i, j = 0;
  for (i = 0; i < len; i++) {
    char c = *(word + i);
    if (isalpha(c)) {
      trimmedWord[j++] = c;
    }
  }
  trimmedWord[j] = '\0';
  j = 0;
  for (i = 0; i < len; i++) {
    char c = *(format + i);
    switch (c) {
    case 'C':
      *(word + i) = toupper(trimmedWord[j++]);
      break;
    case 'c':
      *(word + i) = tolower(trimmedWord[j++]);
      break;
    default:
      *(word + i) = c;
    }
  }
}
```