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

```asm
<QMChange>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r14
  mov    %rdi,0x20(%rsp)
  mov    %rsi,%r15
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%rbx
  mov    %rdx,0x28(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %r8d,%ebp
  mov    $0x0,%eax
  call   <initialise_client@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,0x38(%rsp)
  test   %r14d,%r14d
  je     L14
  test   %r12d,%r12d
  je     L181
  mov    0x18(%rsp),%esi
  test   %esi,%esi
  mov    $0xffffffff,%eax
  cmovg  %esi,%eax
  mov    %eax,0x18(%rsp)
  test   %ebp,%ebp
  mov    $0x1,%eax
  cmovle %eax,%ebp
  test   %r14d,%r14d
  jle    L181
  mov    0x20(%rsp),%r13
  mov    %r14d,%ebx
  mov    $0x0,%r15d
  movslq %r12d,%rax
  mov    %rax,0x10(%rsp)
  mov    %r14d,0x3c(%rsp)
  mov    0x30(%rsp),%r14
  jmp    L171
L14:
  mov    $0x0,%eax
  call   <NullString@plt>
  mov    %rax,%r13
  jmp    L27
L4:
  sub    %r12d,%ebx
  mov    %ebx,%edx
  mov    %rax,%rcx
  sub    %r13,%rcx
  sub    %ecx,%edx
  mov    %edx,%ebx
  mov    0x10(%rsp),%rsi
  lea    (%rax,%rsi,1),%r13
  test   %edx,%edx
  jle    L44
L171:
  mov    %r12d,%ecx
  mov    %ebx,%edx
  mov    0x8(%rsp),%rsi
  mov    %r13,%rdi
  call   <memstr@plt>
  test   %rax,%rax
  je     L44
  sub    $0x1,%ebp
  test   %ebp,%ebp
  jg     L4
  cmove  %rax,%r14
  add    $0x1,%r15d
  subl   $0x1,0x18(%rsp)
  jne    L4
L44:
  mov    %r14,0x30(%rsp)
  mov    0x3c(%rsp),%r14d
  test   %r15d,%r15d
  je     L181
  mov    0x38(%rsp),%ebx
  mov    %ebx,%eax
  sub    %r12d,%eax
  imul   %r15d,%eax
  lea    0x1(%r14,%rax,1),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %rax,%rbp
  mov    %ebx,%eax
  cltq
  mov    %rax,0x10(%rsp)
  mov    0x30(%rsp),%rbx
  mov    %r13,0x18(%rsp)
  mov    0x20(%rsp),%r13
  jmp    L13
L160:
  cmpl   $0x0,0x38(%rsp)
  jne    L91
L180:
  movslq %r12d,%rax
  add    %rax,%r13
  sub    %r12d,%r14d
  mov    %r12d,%ecx
  mov    %r14d,%edx
  mov    0x8(%rsp),%rsi
  mov    %r13,%rdi
  call   <memstr@plt>
  mov    %rax,%rbx
  sub    $0x1,%r15d
  je     L117
L13:
  sub    %r13,%rbx
  mov    %ebx,%edx
  test   %ebx,%ebx
  je     L160
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rax
  add    %rax,%rbp
  add    %rax,%r13
  sub    %ebx,%r14d
  jmp    L160
L91:
  mov    0x38(%rsp),%edx
  mov    0x28(%rsp),%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  add    0x10(%rsp),%rbp
  jmp    L180
L117:
  mov    %r13,0x20(%rsp)
  mov    0x18(%rsp),%r13
  test   %r14d,%r14d
  jne    L123
L54:
  movslq %r14d,%r14
  movb   $0x0,0x0(%rbp,%r14,1)
  jmp    L27
L123:
  mov    %r14d,%edx
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  jmp    L54
L181:
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    0x20(%rsp),%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L27:
  mov    %r13,%rax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *QMChange(char *src, char *old, char *new, int occurrences, int start) {
  int src_len;
  int old_len;
  int new_len;
  int32_t bytes;
  char *start_pos;
  char *new_str;
  int32_t changes;
  char *pos;
  char *p;
  char *q;
  int32_t n;
  initialise_client();
  src_len = strlen(src);
  old_len = strlen(old);
  new_len = strlen(new);
  if (src_len == 0) {
    new_str = NullString();
    return new_str;
  }
  if (old_len == 0)
    goto return_unchanged;
  if (occurrences < 1)
    occurrences = -1;
  if (start < 1)
    start = 1;
  changes = 0;
  bytes = src_len;
  pos = src;
  while (bytes > 0) {
    p = memstr(pos, old, bytes, old_len);
    if (p == NULL)
      break;
    if (--start <= 0) {
      if (start == 0)
        start_pos = p;
      changes++;
      if (--occurrences == 0)
        break;
    }
    bytes -= (p - pos) + old_len;
    pos = p + old_len;
  }
  if (changes == 0)
    goto return_unchanged;
  new_str = (char *)malloc(src_len + changes * (new_len - old_len) + 1);
  q = new_str;
  pos = src;
  bytes = src_len;
  p = start_pos;
  do {
    n = p - pos;
    if (n) {
      memcpy(q, pos, n);
      q += n;
      pos += n;
      bytes -= n;
    }
    if (new_len) {
      memcpy(q, new, new_len);
      q += new_len;
    }
    pos += old_len;
    bytes -= old_len;
    p = memstr(pos, old, bytes, old_len);
  } while (--changes);
  if (bytes)
    memcpy(q, pos, bytes);
  q[bytes] = '\0';
  return new_str;
return_unchanged:
  new_str = (char *)malloc(src_len + 1);
  strcpy(new_str, src);
  return new_str;
}
```