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

```asm
<QMChange>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %rdx,%r15
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %ecx,0x8(%rsp)
  call   <initialise_client@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %r15,%rdi
  mov    %eax,%r14d
  call   <strlen@plt>
  mov    %eax,0x14(%rsp)
  test   %ebx,%ebx
  je     L102
  test   %r14d,%r14d
  je     L72
  mov    0x8(%rsp),%edi
  mov    $0xffffffff,%eax
  mov    $0x1,%r8d
  test   %edi,%edi
  cmovg  %edi,%eax
  test   %r13d,%r13d
  cmovg  %r13d,%r8d
  mov    %eax,0x8(%rsp)
  test   %ebx,%ebx
  jle    L72
  mov    %ebx,%r15d
  movslq %r14d,%rax
  mov    %ebx,0x20(%rsp)
  mov    %rbp,%rbx
  mov    %rbp,0x28(%rsp)
  mov    %r15d,%r13d
  mov    %r8d,%ebp
  mov    %rax,%r15
  movl   $0x0,0x10(%rsp)
  jmp    L40
  nopl   0x0(%rax)
L36:
  mov    %r13d,%edx
  mov    %rax,%rsi
  sub    %rbx,%rsi
  sub    %r14d,%edx
  lea    (%rax,%r15,1),%rbx
  sub    %esi,%edx
  mov    %edx,%r13d
  test   %edx,%edx
  jle    L181
L40:
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <memstr@plt>
  test   %rax,%rax
  je     L181
  sub    $0x1,%ebp
  test   %ebp,%ebp
  jg     L36
  mov    (%rsp),%rcx
  cmove  %rax,%rcx
  addl   $0x1,0x10(%rsp)
  subl   $0x1,0x8(%rsp)
  mov    %rcx,(%rsp)
  jne    L36
  mov    0x20(%rsp),%ebx
  mov    0x28(%rsp),%rbp
L81:
  mov    0x14(%rsp),%r13d
  movslq %r14d,%r15
  mov    %r13d,%eax
  sub    %r14d,%eax
  imul   0x10(%rsp),%eax
  lea    0x1(%rbx,%rax,1),%edi
  call   <malloc@plt>
  test   %r13d,%r13d
  mov    %rax,0x8(%rsp)
  mov    %rax,%r13
  jne    L173
  mov    (%rsp),%rax
  mov    %r15,(%rsp)
  mov    %r12,%r15
  jmp    L155
  nopl   0x0(%rax)
L169:
  add    (%rsp),%rbp
L92:
  sub    %r14d,%ebx
  mov    %r14d,%ecx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    %ebx,%edx
  call   <memstr@plt>
  subl   $0x1,0x10(%rsp)
  je     L122
L155:
  sub    %rbp,%rax
  mov    %rax,%r12
  mov    %eax,%edx
  test   %eax,%eax
  je     L169
  mov    %rbp,%rsi
  mov    %r13,%rdi
  sub    %r12d,%ebx
  call   <memcpy@plt>
  movslq %r12d,%rax
  add    %rax,%r13
  add    (%rsp),%rax
  add    %rax,%rbp
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L181:
  mov    0x10(%rsp),%eax
  mov    0x20(%rsp),%ebx
  mov    0x28(%rsp),%rbp
  test   %eax,%eax
  jne    L81
L72:
  lea    0x1(%rbx),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <strcpy@plt>
L193:
  mov    0x8(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L102:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <NullString@plt>
  nopl   (%rax)
L173:
  movslq 0x14(%rsp),%rax
  mov    (%rsp),%rcx
  mov    %rax,0x20(%rsp)
  mov    %r12,%rax
  mov    %r13,%r12
  mov    %rbp,%r13
  mov    %rax,%rbp
  jmp    L80
  nopl   0x0(%rax)
L93:
  mov    0x14(%rsp),%edx
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdi
  add    %r15,%r13
  call   <memcpy@plt>
  add    0x20(%rsp),%r12
L128:
  sub    %r14d,%ebx
  mov    %r14d,%ecx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  mov    %ebx,%edx
  call   <memstr@plt>
  subl   $0x1,0x10(%rsp)
  mov    %rax,%rcx
  je     L42
L80:
  sub    %r13,%rcx
  mov    %ecx,%edx
  test   %ecx,%ecx
  je     L93
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rcx,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rcx
  mov    0x14(%rsp),%edx
  mov    0x18(%rsp),%rsi
  movslq %ecx,%r10
  sub    %ecx,%ebx
  add    %r10,%r12
  mov    %r10,(%rsp)
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    (%rsp),%r10
  add    0x20(%rsp),%r12
  add    %r15,%r10
  add    %r10,%r13
  jmp    L128
L42:
  mov    %r13,%rbp
  mov    %r12,%r13
L122:
  test   %ebx,%ebx
  jne    L147
L17:
  movslq %ebx,%rbx
  movb   $0x0,0x0(%r13,%rbx,1)
  jmp    L193
  nopl   0x0(%rax,%rax,1)
L147:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <memcpy@plt>
  jmp    L17
```

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;
}
```