user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<replace>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x328,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x318(%rsp)
  xor    %eax,%eax
  call   <strstr@plt>
  test   %rax,%rax
  je     L62
  mov    %rax,%r14
  lea    0x10(%rsp),%r15
  mov    %rbp,%rsi
  mov    %rax,%rbx
  sub    %rbp,%r14
  mov    %r15,%rdi
  mov    %r14d,%edx
  call   <strncpy@plt>
  mov    %r12,%rdi
  movb   $0x0,0x10(%rsp,%r14,1)
  call   <strlen@plt>
  lea    (%r15,%r14,1),%rdi
  lea    D8(%rip),%r14
  mov    %r13,%rdx
  cltq
  mov    %r14,%rsi
  lea    (%rbx,%rax,1),%rcx
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0x80(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0x80(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0xf0(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0xf0(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0x160(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0x160(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0x1d0(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0x1d0(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0x240(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0x240(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L62
  sub    %rbp,%rax
  lea    0x2b0(%rsp),%r15
  mov    %rbp,%rsi
  mov    %eax,%edx
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rax
  mov    %r12,%rdi
  movb   $0x0,0x2b0(%rsp,%rax,1)
  call   <strlen@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  cltq
  lea    (%rbx,%rax,1),%rcx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rax,1),%rdi
  call   <sprintf@plt>
  movb   $0x0,0x0(%rbp)
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <replace>
  nopw   0x0(%rax,%rax,1)
L62:
  mov    0x318(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x328,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D8
datatype: string

tool: D8: %s%s

assistant: ```c
void replace(char *o_string, char *s_string, char *r_string) {
  char buffer[100];
  char *ch;
  if (!(ch = strstr(o_string, s_string)))
    return;
  strncpy(buffer, o_string, ch - o_string);
  buffer[ch - o_string] = 0;
  sprintf(buffer + (ch - o_string), "%s%s", r_string, ch + strlen(s_string));
  o_string[0] = 0;
  strcpy(o_string, buffer);
  return replace(o_string, s_string, r_string);
}
```