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

```asm
<bc_str_split>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,%eax
  mov    %rdx,-0x48(%rbp)
  mov    %al,-0x3c(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L20
  mov    $0x0,%eax
  jmp    L23
L20:
  mov    $0x8,%edi
  call   <bc_malloc@plt>
  mov    %rax,-0x30(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x28(%rbp)
  jmp    L83
L88:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L28
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x3c(%rbp)
  jne    L35
  cmpq   $0x0,-0x48(%rbp)
  je     L36
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x48(%rbp)
  ja     L36
L35:
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L32
L36:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <bc_realloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  sub    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    -0x18(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <bc_malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x28(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  add    %rax,%rcx
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x30(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  sub    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x20(%rbp)
L32:
  addq   $0x1,-0x28(%rbp)
L83:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  cmp    %rax,-0x28(%rbp)
  jb     L88
  jmp    L12
L28:
  nop
L12:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <bc_realloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
L23:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char **bc_str_split(const char *str, char c, size_t max_pieces) {
  if (str == NULL)
    return NULL;
  char **rv = bc_malloc(sizeof(char *));
  size_t i, start = 0, count = 0;
  for (i = 0; i < strlen(str) + 1; i++) {
    if (str[0] == '\0')
      break;
    if ((str[i] == c && (!max_pieces || count + 1 < max_pieces)) || str[i] == '\0') {
      rv = bc_realloc(rv, (count + 1) * sizeof(char *));
      rv[count] = bc_malloc(i - start + 1);
      memcpy(rv[count], str + start, i - start);
      rv[count++][i - start] = '\0';
      start = i + 1;
    }
  }
  rv = bc_realloc(rv, (count + 1) * sizeof(char *));
  rv[count] = NULL;
  return rv;
}
```