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

```asm
<strreplace>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x38,%rsp
  mov    %rdx,0x20(%rsp)
  test   %rbx,%rbx
  je     L53
  cmpq   $0x0,(%rbx)
  je     L53
  test   %rsi,%rsi
  setne  %al
  xor    %edi,%edi
  test   %rdx,%rdx
  setne  %dil
  and    %eax,%edi
L53:
  call   <assert@plt>
  mov    (%rbx),%r15
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %r14,%rdi
  mov    %rax,0x10(%rsp)
  mov    %rax,%r12
  call   <strlen@plt>
  mov    0x20(%rsp),%rdi
  mov    %rax,0x8(%rsp)
  call   <strlen@plt>
  mov    %rax,%rbp
  cmp    %rax,0x8(%rsp)
  jb     L29
  mov    0x8(%rsp),%rsi
  xor    %r9d,%r9d
  sub    %rsi,%rax
  sub    %rsi,%r12
  mov    %rax,0x28(%rsp)
  jmp    L90
L47:
  test   %r13d,%r13d
  je     L56
  mov    0x8(%rsp),%rax
  sub    %r15,%rcx
  mov    %r12,%rdx
  sub    $0x1,%r13d
  lea    0x0(%rbp,%rcx,1),%r9
  sub    %rcx,%rdx
  mov    %rcx,0x18(%rsp)
  lea    (%rax,%rcx,1),%rsi
  lea    (%r15,%r9,1),%rdi
  mov    %r9,0x10(%rsp)
  add    %r15,%rsi
  call   <memmove@plt>
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdx
  add    (%rbx),%rcx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    (%rbx),%rax
  mov    0x10(%rsp),%r9
  add    %r12,%rax
  add    0x28(%rsp),%r12
  movb   $0x0,(%rax,%rbp,1)
  mov    (%rbx),%r15
L90:
  lea    (%r15,%r9,1),%rdi
  mov    %r14,%rsi
  call   <strstr@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  jne    L47
L56:
  add    $0x38,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L29:
  sub    0x8(%rsp),%rax
  mov    %r13d,0x10(%rsp)
  xor    %r9d,%r9d
  mov    %rax,0x28(%rsp)
  jmp    L92
  nopl   0x0(%rax)
L46:
  mov    0x10(%rsp),%edx
  add    0x28(%rsp),%r12
  test   %edx,%edx
  je     L56
  sub    %r15,%rax
  mov    %r15,%rdi
  lea    0x1(%r12),%rsi
  mov    %rax,%r13
  call   <xrealloc@plt>
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdx
  lea    0x0(%rbp,%r13,1),%r9
  mov    %rax,(%rbx)
  sub    %rbp,%rdx
  lea    (%rax,%r9,1),%rdi
  add    %r13,%rsi
  sub    %r13,%rdx
  mov    %r9,0x18(%rsp)
  add    %rax,%rsi
  call   <memmove@plt>
  mov    (%rbx),%rdi
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdx
  add    %r13,%rdi
  call   <memcpy@plt>
  mov    (%rbx),%rax
  subl   $0x1,0x10(%rsp)
  mov    0x18(%rsp),%r9
  movb   $0x0,(%rax,%r12,1)
  mov    (%rbx),%r15
L92:
  lea    (%r15,%r9,1),%rdi
  mov    %r14,%rsi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L46
  jmp    L56
```

assistant: ```c
char *strreplace(char **s, const char *find, const char *replace, int n_replace) {
  char *found;
  size_t s_len, find_len, replace_len, offset;
  assert(s != NULL && *s != NULL && find != NULL && replace != NULL);
  found = NULL;
  s_len = strlen(*s);
  find_len = strlen(find);
  replace_len = strlen(replace);
  offset = 0;
  while ((found = strstr(*s + offset, find)) != NULL && n_replace-- != 0) {
    offset = found - *s;
    if (replace_len > find_len)
      *s = xrealloc(*s, s_len + replace_len - find_len + 1);
    memmove(*s + offset + replace_len, *s + offset + find_len, s_len - offset - find_len);
    memcpy(*s + offset, replace, replace_len);
    s_len += replace_len - find_len;
    *(*s + s_len) = 0;
    offset += replace_len;
  }
  return *s;
}
```