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

```asm
<set_dedx_filename>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x1,-0x28(%rbp)
  jmp    L99
L38:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x28(%rbp)
  jge    L31
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  jmp    L47
L31:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
L47:
  mov    %al,-0x29(%rbp)
  movsbl -0x29(%rbp),%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x28(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <camel_split@plt>
  test   %rax,%rax
  je     L46
  addl   $0x1,-0x24(%rbp)
L46:
  addl   $0x1,-0x28(%rbp)
L99:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L38
  mov    -0x24(%rbp),%eax
  lea    0x5(%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <reallocate@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    -0x18(%rbp),%rdx
  mov    %al,(%rdx)
  movl   $0x1,-0x28(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L86
L70:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x28(%rbp)
  jge    L44
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  jmp    L55
L44:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
L55:
  mov    %al,-0x2a(%rbp)
  movsbl -0x2a(%rbp),%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x28(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <camel_split@plt>
  test   %rax,%rax
  je     L21
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5f,(%rax)
  addl   $0x1,-0x20(%rbp)
L21:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,(%rbx)
  addl   $0x1,-0x28(%rbp)
  addl   $0x1,-0x20(%rbp)
L86:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L70
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x74,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x78,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x74,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void set_dedx_filename(const char *name, char **filename_ptr) {
  const int n0 = strlen(name);
  int i, n = n0;
  for (i = 1; i < n0; i++) {
    const char c = (i < n0 - 1) ? name[i + 1] : name[n0 - 1];
    if (camel_split(name[i - 1], name[i], c))
      n++;
  }
  char *filename = reallocate(*filename_ptr, n + 5);
  *filename_ptr = filename;
  filename[0] = tolower(name[0]);
  int j;
  for (i = 1, j = 1; i < n0; i++, j++) {
    const char c = (i < n0 - 1) ? name[i + 1] : name[n0 - 1];
    if (camel_split(name[i - 1], name[i], c)) {
      filename[j] = '_';
      j++;
    }
    filename[j] = tolower(name[i]);
  }
  filename[n + 0] = '.';
  filename[n + 1] = 't';
  filename[n + 2] = 'x';
  filename[n + 3] = 't';
  filename[n + 4] = 0x0;
}
```