user: 这段汇编代码用C语言表示是什么样的?

```asm
<str_replace>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  je     L98
  cmpq   $0x0,-0x70(%rbp)
  je     L98
  cmpq   $0x0,-0x78(%rbp)
  jne    L16
L98:
  mov    $0x0,%eax
  jmp    L18
L16:
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x38(%rbp)
  movq   $0x0,-0x50(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x60(%rbp)
L114:
  mov    -0x70(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L88
  addq   $0x1,-0x50(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  jmp    L114
L88:
  nop
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x48(%rbp),%rax
  sub    -0x40(%rbp),%rax
  imul   -0x50(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jb     L65
  mov    -0x20(%rbp),%rax
  cmp    %rax,-0x28(%rbp)
  jb     L42
  cmpq   $0x0,-0x20(%rbp)
  jns    L102
L42:
  mov    $0x0,%eax
  jmp    L18
L65:
  cmpq   $0x0,-0x20(%rbp)
  jle    L102
  mov    $0x0,%eax
  jmp    L18
L102:
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  sub    %rdx,%rax
  add    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L35
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x58(%rbp)
L2:
  mov    -0x70(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L93
  mov    -0x30(%rbp),%rax
  sub    -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x60(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x30(%rbp),%rax
  sub    -0x60(%rbp),%rax
  add    %rax,-0x58(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x78(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x40(%rbp),%rax
  add    %rax,-0x58(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  jmp    L2
L93:
  nop
  mov    -0x60(%rbp),%rax
  sub    -0x68(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  sub    %rdx,%rax
  add    $0x1,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x60(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L35:
  mov    -0x10(%rbp),%rax
L18:
  leave
  ret
```

assistant: ```c
char *str_replace(const char *src, const char *from, const char *to) {
  if (src == NULL || from == NULL || to == NULL)
    return NULL;
  const char *sp;
  const char *mp;
  char *dp;
  size_t from_len = strlen(from);
  size_t to_len = strlen(to);
  size_t src_len = strlen(src);
  size_t count = 0;
  sp = src;
  while (1) {
    mp = strstr(sp, from);
    if (mp == NULL)
      break;
    count++;
    sp = mp + from_len;
  }
  size_t len = src_len;
  long int sub = (from_len - to_len) * count;
  if (from_len >= to_len) {
    if (sub > len || sub < 0)
      return NULL;
  } else {
    if ((len - sub) < 0 || sub > 0)
      return NULL;
  }
  size_t actual_size = (len - sub) + 1;
  char *dest = malloc(actual_size);
  if (dest != NULL) {
    sp = src;
    dp = dest;
    while (1) {
      mp = strstr(sp, from);
      if (mp == NULL)
        break;
      memcpy(dp, sp, mp - sp);
      dp += mp - sp;
      memcpy(dp, to, to_len);
      dp += to_len;
      sp = mp + from_len;
    }
    size_t k = src_len - (sp - src) + 1;
    memcpy(dp, sp, k);
  }
  return dest;
}
```