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

```asm
<twoway_strstr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x858,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x848(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movzbl (%rsi),%ecx
  mov    $0x0,%ebp
  mov    $0x1,%esi
  test   %cl,%cl
  je     L106
L255:
  cmpb   $0x0,(%r14,%rbp,1)
  je     L165
  mov    %ecx,%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    %rsi,%rdx
  shl    %cl,%rdx
  or     %rdx,0x20(%rsp,%rax,8)
  add    $0x1,%rbp
  movzbl %cl,%ecx
  mov    %rbp,0x40(%rsp,%rcx,8)
  movzbl (%r12,%rbp,1),%ecx
  test   %cl,%cl
  jne    L255
L89:
  cmp    $0x1,%rbp
  jbe    L106
  mov    $0x1,%r8d
  mov    $0x1,%edx
  mov    $0x0,%r9d
  mov    $0xffffffffffffffff,%rdi
  mov    $0x1,%eax
  mov    $0x1,%r10d
  jmp    L422
L165:
  mov    $0x0,%ebx
  test   %cl,%cl
  je     L89
  jmp    L140
L347:
  cmp    %r8,%rdx
  je     L219
  add    $0x1,%rdx
  jmp    L303
L219:
  add    %r8,%r9
  mov    $0x1,%edx
  jmp    L303
L99:
  mov    %r9,%rdi
  lea    0x1(%r9),%r9
  mov    %r10,%r8
  mov    $0x1,%edx
L303:
  lea    (%r9,%rdx,1),%rax
  cmp    %rbp,%rax
  jae    L124
L422:
  lea    (%r12,%rdi,1),%rcx
  movzbl (%rcx,%rdx,1),%esi
  movzbl (%r12,%rax,1),%ecx
  cmp    %cl,%sil
  je     L347
  jbe    L99
  mov    %rax,%r8
  sub    %rdi,%r8
  mov    %rax,%r9
  mov    $0x1,%edx
  jmp    L303
L124:
  movq   $0x1,(%rsp)
  mov    $0x1,%edx
  mov    $0x0,%r9d
  movq   $0xffffffffffffffff,0x10(%rsp)
  mov    $0x1,%eax
  jmp    L425
L187:
  cmp    (%rsp),%rdx
  je     L96
  add    $0x1,%rdx
  jmp    L223
L96:
  add    (%rsp),%r9
  mov    $0x1,%edx
  jmp    L223
L442:
  mov    %r9,0x10(%rsp)
  lea    0x1(%r9),%r9
  movq   $0x1,(%rsp)
  mov    $0x1,%edx
L223:
  lea    (%r9,%rdx,1),%rax
  cmp    %rbp,%rax
  jae    L319
L425:
  mov    0x10(%rsp),%rsi
  lea    (%r12,%rsi,1),%rcx
  movzbl (%rcx,%rdx,1),%esi
  movzbl (%r12,%rax,1),%ecx
  cmp    %cl,%sil
  je     L187
  jae    L442
  mov    %rax,%rsi
  sub    0x10(%rsp),%rsi
  mov    %rsi,(%rsp)
  mov    %rax,%r9
  mov    $0x1,%edx
  jmp    L223
L319:
  mov    0x10(%rsp),%rsi
  lea    0x1(%rsi),%rdx
  lea    0x1(%rdi),%rax
  cmp    %rax,%rdx
  cmova  %rsi,%rdi
  mov    %rdi,0x10(%rsp)
  cmova  (%rsp),%r8
  mov    %r8,(%rsp)
L66:
  mov    0x10(%rsp),%rbx
  lea    0x1(%rbx),%r15
  mov    (%rsp),%r13
  lea    (%r12,%r13,1),%rsi
  mov    %r15,%rdx
  mov    %r12,%rdi
  call   <memcmp@plt>
  mov    %rbp,%rdi
  sub    %r13,%rdi
  mov    %rdi,0x8(%rsp)
  test   %rax,%rax
  je     L108
  lea    -0x1(%rbp),%rax
  sub    %rbx,%rax
  cmp    %rbx,%rax
  cmovb  %rbx,%rax
  add    $0x1,%rax
  mov    %rax,(%rsp)
  movq   $0x0,0x8(%rsp)
L108:
  mov    %r14,%rbx
  mov    $0x0,%r13d
  mov    %rbp,%rax
  or     $0x3f,%rax
  mov    %rax,0x18(%rsp)
  jmp    L161
L420:
  mov    0x18(%rsp),%rdx
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <memchr@plt>
  test   %rax,%rax
  je     L454
  mov    %rax,%rdx
  sub    %rbx,%rdx
  cmp    %rbp,%rdx
  jb     L318
  mov    %rax,%r14
  jmp    L153
L454:
  add    0x18(%rsp),%r14
  jmp    L153
L109:
  add    %rcx,%rbx
  mov    $0x0,%r13d
L161:
  mov    %r14,%rax
  sub    %rbx,%rax
  cmp    %rbp,%rax
  jb     L420
L153:
  movzbl -0x1(%rbx,%rbp,1),%ecx
  mov    %ecx,%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    0x20(%rsp,%rax,8),%rax
  shr    %cl,%rax
  and    $0x1,%eax
  je     L396
  movzbl %cl,%ecx
  mov    %rbp,%rax
  sub    0x40(%rsp,%rcx,8),%rax
  mov    %rax,%rcx
  je     L92
  cmpq   $0x0,0x8(%rsp)
  setne  %dl
  test   %r13,%r13
  setne  %al
  test   %al,%dl
  je     L109
  mov    (%rsp),%rsi
  cmp    %rcx,%rsi
  seta   %dl
  mov    %rbp,%rax
  sub    %rsi,%rax
  test   %dl,%dl
  cmovne %rax,%rcx
  jmp    L109
L396:
  add    %rbp,%rbx
  mov    %rax,%r13
  jmp    L161
L92:
  cmp    %r13,%r15
  mov    %r13,%rax
  cmovae %r15,%rax
  movzbl (%r12,%rax,1),%edx
  test   %dl,%dl
  je     L249
L121:
  cmp    %dl,(%rbx,%rax,1)
  jne    L392
  add    $0x1,%rax
  movzbl (%r12,%rax,1),%edx
  test   %dl,%dl
  jne    L121
  mov    %r15,%rax
L421:
  cmp    %r13,%rax
  jbe    L140
  sub    $0x1,%rax
  movzbl (%rbx,%rax,1),%edi
  cmp    %dil,(%r12,%rax,1)
  je     L421
  add    (%rsp),%rbx
  mov    0x8(%rsp),%r13
  jmp    L161
L249:
  mov    %r15,%rax
  jmp    L421
L392:
  test   %dl,%dl
  je     L207
  sub    0x10(%rsp),%rax
  add    %rax,%rbx
  mov    %rcx,%r13
  jmp    L161
L207:
  mov    %r15,%rax
  jmp    L421
L318:
  mov    $0x0,%ebx
L140:
  mov    0x848(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L376
  mov    %rbx,%rax
  add    $0x858,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  movq   $0xffffffffffffffff,0x10(%rsp)
  movq   $0x1,(%rsp)
  jmp    L66
L376:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *twoway_strstr(const unsigned char *h, const unsigned char *n) {
  const unsigned char *z;
  size_t l, ip, jp, k, p, ms, p0, mem, mem0;
  size_t byteset[32 / sizeof(size_t)] = {0};
  size_t shift[256];
  for (l = 0; n[l] && h[l]; l++)
    ((byteset)[(size_t)(n[l]) / (8 * sizeof *(byteset))] |= (size_t)1 << ((size_t)(n[l]) % (8 * sizeof *(byteset)))), shift[n[l]] = l + 1;
  if (n[l])
    return 0;
  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;
  z = h;
  for (;;) {
    if (z - h < l) {
      size_t grow = l | 63;
      const unsigned char *z2 = memchr(z, 0, grow);
      if (z2) {
        z = z2;
        if (z - h < l)
          return 0;
      } else
        z += grow;
    }
    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)); n[k] && n[k] == h[k]; k++)
      ;
    if (n[k]) {
      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;
  }
}
```