user: What is the c source code of the assembly code below:

```asm
<Q_replace>:
  endbr64
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  movslq %ecx,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %rdi,%rsi
  mov    %rdx,%rdi
  sub    $0x18,%rsp
  call   <strstr@plt>
  test   %rax,%rax
  mov    %rax,(%rsp)
  je     L128
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  movslq %eax,%r12
  call   <strlen@plt>
  mov    (%rsp),%r8
  mov    %eax,%r15d
  sub    %r12d,%r15d
  test   %r15d,%r15d
  jg     L10
  jne    L126
  nopl   (%rax)
L3:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L167
  mov    %rbx,%rdx
  nopw   0x0(%rax,%rax,1)
L55:
  add    $0x1,%rdx
  mov    %al,(%r8)
  add    $0x1,%r8
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L55
L167:
  mov    %r8,%rdi
  mov    %rbp,%rsi
  add    $0x1,%r15d
  call   <strstr@plt>
  mov    %rax,%r8
  test   %rax,%rax
  jne    L3
L128:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L10:
  lea    (%r14,%r13,1),%rax
  mov    %r14,%rdi
  mov    %r8,0x8(%rsp)
  movslq %r15d,%r13
  mov    %rax,(%rsp)
  xor    %r15d,%r15d
  call   <strlen@plt>
  mov    0x8(%rsp),%r8
  cltq
  add    %rax,%r14
  nopl   (%rax)
L166:
  mov    %r14,%rcx
  add    %r13,%r14
  cmp    (%rsp),%r14
  jae    L128
  lea    (%r8,%r12,1),%rdx
  xor    %eax,%eax
  mov    %rdx,%rsi
  sub    %rcx,%rsi
  cmp    %rdx,%rcx
  jb     L76
  nopl   (%rax)
L153:
  movzbl (%rcx,%rax,1),%edx
  mov    %dl,(%r14,%rax,1)
  mov    %rax,%rdx
  sub    $0x1,%rax
  cmp    %rsi,%rdx
  jne    L153
L76:
  movzbl (%rbx),%eax
  mov    %rbx,%rdx
  test   %al,%al
  je     L96
  cs nopw 0x0(%rax,%rax,1)
L131:
  add    $0x1,%rdx
  mov    %al,(%r8)
  add    $0x1,%r8
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L131
L96:
  mov    %r8,%rdi
  mov    %rbp,%rsi
  add    $0x1,%r15d
  call   <strstr@plt>
  mov    %rax,%r8
  test   %rax,%rax
  jne    L166
  jmp    L128
L126:
  movslq %eax,%r13
  xor    %r15d,%r15d
  nopl   0x0(%rax)
L112:
  lea    (%r8,%r12,1),%rsi
  lea    (%r8,%r13,1),%rcx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L154:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  test   %dl,%dl
  jne    L154
  movzbl (%rbx),%eax
  test   %al,%al
  je     L103
  mov    %rbx,%rdx
  nopl   0x0(%rax)
L69:
  add    $0x1,%rdx
  mov    %al,(%r8)
  add    $0x1,%r8
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L69
L103:
  mov    %r8,%rdi
  mov    %rbp,%rsi
  add    $0x1,%r15d
  call   <strstr@plt>
  mov    %rax,%r8
  test   %rax,%rax
  jne    L112
  jmp    L128
```

assistant: ```c
int Q_replace(const char *str1, const char *str2, char *src, int max_len) {
  int len1, len2, d, count;
  const char *s0, *s1, *s2, *max;
  char *match, *dst;
  match = strstr(src, str1);
  if (!match)
    return 0;
  count = 0;
  len1 = strlen(str1);
  len2 = strlen(str2);
  d = len2 - len1;
  if (d > 0) {
    max = src + max_len;
    src += strlen(src);
    do {
      s1 = src;
      src += d;
      if (src >= max)
        return count;
      dst = src;
      s0 = match + len1;
      while (s1 >= s0)
        *dst-- = *s1--;
      s2 = str2;
      while (*s2) {
        *match++ = *s2++;
      }
      match = strstr(match, str1);
      count++;
    } while (match);
    return count;
  } else if (d < 0) {
    do {
      s1 = match + len1;
      dst = match + len2;
      while ((*dst++ = *s1++) != '\0')
        ;
      s2 = str2;
      while (*s2) {
        *match++ = *s2++;
      }
      match = strstr(match, str1);
      count++;
    } while (match);
    return count;
  } else
    do {
      s2 = str2;
      while (*s2) {
        *match++ = *s2++;
      }
      match = strstr(match, str1);
      count++;
    } while (match);
  return count;
}
```