user: What would the C source look like for the assembly code provided here:

```asm
<str_ireplace>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <nullstr@plt>
  test   %rax,%rax
  jne    L50
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <nullstr@plt>
  test   %rax,%rax
  jne    L50
  cmpq   $0x0,-0x48(%rbp)
  jne    L38
L50:
  mov    -0x38(%rbp),%rax
  jmp    L16
L38:
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stristr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L64
  mov    -0x20(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cmp    $0x7fb,%rax
  jbe    L63
L64:
  mov    -0x38(%rbp),%rax
  jmp    L16
L63:
  mov    D20(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D28(%rip)
  mov    D28(%rip),%edx
  movslq %edx,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x2,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x3,%ecx
  sub    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,D28(%rip)
  mov    D28(%rip),%eax
  cltq
  shl    $0xb,%rax
  mov    %rax,%rdx
  lea    D28(%rip),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    $0x7fc,%eax
  sub    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncpy@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x20(%rbp),%rdx
  lea    (%rax,%rdx,1),%rsi
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <strncpy@plt>
  mov    -0x28(%rbp),%rax
  add    $0x7fc,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
L16:
  leave
  ret
```

assistant: ```c
const char *str_ireplace(const char *orig, const char *old, const char *pnew) {
  char *buf = NULL;
  const char *ptr = NULL;
  size_t len = 0, a = 0, b = 0;
  static char outbuf[7][2048];
  static int i = 0;
  if (nullstr(orig) || nullstr(old) || pnew == NULL) {
    return orig;
  }
  if ((ptr = stristr(orig, old)) == NULL || (a = ptr - orig) + (len = strlen(pnew)) >= (2048 - 4)) {
    return orig;
  }
  ++i, i %= 7;
  buf = outbuf[i];
  b = 2048 - 4 - a - len;
  strcpy(buf, orig);
  strncpy(buf + a, pnew, len);
  strncpy(buf + a + len, ptr + strlen(old), b);
  buf[2048 - 4] = 0;
  return (buf);
}
```