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

```asm
<segment_internal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <iswlower@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <wcslen@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <count_double_characters@plt>
  mov    -0x38(%rbp),%rdx
  add    %rdx,%rax
  add    $0x10,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <copy_and_normalize@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x5c(%rbp),%ecx
  mov    -0x44(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strip_suffixes@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rax,%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <wcsncpy@plt>
  mov    -0x10(%rbp),%rax
  sub    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copy_and_denormalize@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    -0x20(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x40(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x40(%rbp),%rax
  leave
  ret
```

assistant: ```c
wchar_t **segment_internal(wchar_t *word, int case_insensitive) {
  wchar_t **result = malloc(2 * sizeof(wchar_t *));
  int uppercase = !iswlower(word[0]);
  unsigned long length = wcslen(word);
  unsigned long intermediate_length = length + count_double_characters(word, length) + 16;
  wchar_t *intermediate = malloc(intermediate_length * sizeof(wchar_t));
  wchar_t *stem_result = malloc(intermediate_length * sizeof(wchar_t));
  wchar_t *suffix_result = malloc(intermediate_length * sizeof(wchar_t));
  unsigned long normalized_length = copy_and_normalize(word, length, intermediate, 0);
  unsigned long stem_length = strip_suffixes(intermediate, intermediate_length, uppercase, case_insensitive);
  wcsncpy(suffix_result, intermediate + stem_length, normalized_length - stem_length);
  suffix_result[normalized_length - stem_length] = 0;
  intermediate[stem_length] = 0;
  copy_and_denormalize(intermediate, stem_length, stem_result);
  free(intermediate);
  result[0] = stem_result;
  result[1] = suffix_result;
  return result;
}
```