user: 这段汇编代码用C语言表示是什么样的：

```asm
<twoway_memmem>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  mov    %rdi,%r8
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x848,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x838(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  test   %rcx,%rcx
  je     L324
  mov    $0x1,%edi
L57:
  movzbl 0x0(%rbp,%rax,1),%ecx
  mov    %rdi,%rsi
  add    $0x1,%rax
  mov    %ecx,%edx
  shl    %cl,%rsi
  mov    %rax,0x30(%rsp,%rcx,8)
  shr    $0x6,%dl
  movzbl %dl,%edx
  or     %rsi,0x10(%rsp,%rdx,8)
  cmp    %rbx,%rax
  jne    L57
  cmp    $0x1,%rbx
  je     L324
  mov    $0x1,%r12d
  mov    $0x1,%edx
  xor    %ecx,%ecx
  mov    $0xffffffffffffffff,%r13
  mov    $0x1,%eax
  jmp    L281
  nopl   0x0(%rax,%rax,1)
L253:
  jae    L197
  mov    %rax,%r12
  mov    %rax,%rcx
  mov    $0x1,%edx
  sub    %r13,%r12
L6:
  lea    (%rdx,%rcx,1),%rax
  cmp    %rax,%rbx
  jbe    L74
L281:
  lea    0x0(%rbp,%rdx,1),%rsi
  movzbl (%rsi,%r13,1),%edi
  cmp    %dil,0x0(%rbp,%rax,1)
  jne    L253
  cmp    %rdx,%r12
  je     L48
  add    $0x1,%rdx
  lea    (%rdx,%rcx,1),%rax
  cmp    %rax,%rbx
  ja     L281
L74:
  mov    $0x1,%r9d
  mov    $0x1,%edx
  xor    %ecx,%ecx
  mov    $0xffffffffffffffff,%rdi
  mov    $0x1,%eax
  jmp    L174
  nop
L7:
  jbe    L331
  mov    %rax,%r9
  mov    %rax,%rcx
  mov    $0x1,%edx
  sub    %rdi,%r9
L352:
  lea    (%rdx,%rcx,1),%rax
  cmp    %rax,%rbx
  jbe    L208
L174:
  lea    0x0(%rbp,%rdx,1),%rsi
  movzbl (%rsi,%rdi,1),%esi
  cmp    %sil,0x0(%rbp,%rax,1)
  jne    L7
  cmp    %rdx,%r9
  je     L62
  add    $0x1,%rdx
  lea    (%rdx,%rcx,1),%rax
  cmp    %rax,%rbx
  ja     L174
L208:
  lea    0x1(%rdi),%rax
  lea    0x1(%r13),%r15
  cmp    %r15,%rax
  jbe    L23
  mov    %rax,%r15
  mov    %rdi,%r13
  mov    %r9,%r12
L23:
  lea    0x0(%rbp,%r12,1),%rsi
  mov    %r15,%rdx
  mov    %rbp,%rdi
  mov    %r8,0x8(%rsp)
  call   <memcmp@plt>
  mov    %rbx,%rsi
  mov    0x8(%rsp),%r8
  sub    %r12,%rsi
  test   %rax,%rax
  je     L149
  lea    -0x1(%rbx),%rax
  sub    %r13,%rax
  cmp    %r13,%rax
  cmovb  %r13,%rax
  xor    %esi,%esi
  lea    0x1(%rax),%r12
L149:
  mov    %r14,%rax
  sub    %r8,%rax
  cmp    %rax,%rbx
  ja     L86
  mov    %rbx,%rdi
  lea    -0x1(%rbx),%rdx
  xor    %r9d,%r9d
  sub    %r12,%rdi
  jmp    L50
  nopl   0x0(%rax)
L344:
  mov    %rbx,%rax
  sub    0x30(%rsp,%rcx,8),%rax
  je     L223
  test   %rsi,%rsi
  setne  %r10b
  test   %r9,%r9
  setne  %cl
  test   %cl,%r10b
  je     L12
  cmp    %rax,%r12
  cmova  %rdi,%rax
L12:
  add    %rax,%r8
  xor    %r9d,%r9d
L67:
  mov    %r14,%rax
  sub    %r8,%rax
  cmp    %rbx,%rax
  jb     L86
L50:
  movzbl (%r8,%rdx,1),%ecx
  mov    %ecx,%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    0x10(%rsp,%rax,8),%rax
  shr    %cl,%rax
  test   $0x1,%al
  jne    L344
  add    %rbx,%r8
  mov    %r14,%rax
  xor    %r9d,%r9d
  sub    %r8,%rax
  cmp    %rbx,%rax
  jae    L50
L86:
  xor    %r8d,%r8d
L325:
  mov    0x838(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x848,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L197:
  mov    %rcx,%r13
  mov    $0x1,%r12d
  add    $0x1,%rcx
  mov    $0x1,%edx
  jmp    L6
  nop
L48:
  add    %r12,%rcx
  mov    $0x1,%edx
  jmp    L6
  nopl   (%rax)
L331:
  mov    %rcx,%rdi
  mov    $0x1,%r9d
  add    $0x1,%rcx
  mov    $0x1,%edx
  jmp    L352
  nopw   0x0(%rax,%rax,1)
L62:
  add    %r9,%rcx
  mov    $0x1,%edx
  jmp    L352
  nopl   (%rax)
L223:
  cmp    %r15,%r9
  mov    %r15,%rax
  cmovae %r9,%rax
  cmp    %rax,%rbx
  ja     L130
  jmp    L198
  nopl   0x0(%rax)
L84:
  add    $0x1,%rax
  cmp    %rax,%rbx
  je     L198
L130:
  movzbl (%r8,%rax,1),%ecx
  cmp    %cl,0x0(%rbp,%rax,1)
  je     L84
  cmp    %rax,%rbx
  jbe    L198
  sub    %r13,%rax
  jmp    L12
  nopl   0x0(%rax)
L198:
  mov    %r15,%rax
  jmp    L180
  nopl   (%rax)
L35:
  sub    $0x1,%rax
  movzbl (%r8,%rax,1),%ecx
  cmp    %cl,0x0(%rbp,%rax,1)
  jne    L85
L180:
  cmp    %r9,%rax
  ja     L35
  jmp    L325
  nopl   0x0(%rax)
L85:
  add    %r12,%r8
  mov    %rsi,%r9
  jmp    L67
L324:
  xor    %r15d,%r15d
  mov    $0xffffffffffffffff,%r13
  mov    $0x1,%r12d
  jmp    L23
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *twoway_memmem(const unsigned char *h, const unsigned char *z, const unsigned char *n, size_t l) {
  size_t i, ip, jp, k, p, ms, p0, mem, mem0;
  size_t byteset[32 / sizeof(size_t)] = {0};
  size_t shift[256];
  for (i = 0; i < l; i++)
    ((byteset)[(size_t)(n[i]) / (8 * sizeof *(byteset))] |= (size_t)1 << ((size_t)(n[i]) % (8 * sizeof *(byteset)))), shift[n[i]] = i + 1;
  ip = -1;
  jp = 0;
  k = p = 1;
  while (jp + k < l) {
    if (n[ip + k] == n[jp + k]) {
      if (k == p) {
        jp += p;
        k = 1;
      } else
        k++;
    } else if (n[ip + k] > n[jp + k]) {
      jp += k;
      k = 1;
      p = jp - ip;
    } else {
      ip = jp++;
      k = p = 1;
    }
  }
  ms = ip;
  p0 = p;
  ip = -1;
  jp = 0;
  k = p = 1;
  while (jp + k < l) {
    if (n[ip + k] == n[jp + k]) {
      if (k == p) {
        jp += p;
        k = 1;
      } else
        k++;
    } else if (n[ip + k] < n[jp + k]) {
      jp += k;
      k = 1;
      p = jp - ip;
    } else {
      ip = jp++;
      k = p = 1;
    }
  }
  if (ip + 1 > ms + 1)
    ms = ip;
  else
    p = p0;
  if (memcmp(n, n + p, ms + 1)) {
    mem0 = 0;
    p = ((ms) > (l - ms - 1) ? (ms) : (l - ms - 1)) + 1;
  } else
    mem0 = l - p;
  mem = 0;
  for (;;) {
    if (z - h < l)
      return 0;
    if (((byteset)[(size_t)(h[l - 1]) / (8 * sizeof *(byteset))] & (size_t)1 << ((size_t)(h[l - 1]) % (8 * sizeof *(byteset))))) {
      k = l - shift[h[l - 1]];
      if (k) {
        if (mem0 && mem && k < p)
          k = l - p;
        h += k;
        mem = 0;
        continue;
      }
    } else {
      h += l;
      mem = 0;
      continue;
    }
    for (k = ((ms + 1) > (mem) ? (ms + 1) : (mem)); k < l && n[k] == h[k]; k++)
      ;
    if (k < l) {
      h += k - ms;
      mem = 0;
      continue;
    }
    for (k = ms + 1; k > mem && n[k - 1] == h[k - 1]; k--)
      ;
    if (k <= mem)
      return (char *)h;
    h += p;
    mem = mem0;
  }
}
```