user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<twoway_strstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x8a0,%rsp
  mov    %rdi,-0x898(%rbp)
  mov    %rsi,-0x8a0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x830(%rbp)
  movq   $0x0,-0x828(%rbp)
  movq   $0x0,-0x820(%rbp)
  movq   $0x0,-0x818(%rbp)
  movq   $0x0,-0x888(%rbp)
  jmp    L125
L227:
  mov    -0x8a0(%rbp),%rdx
  mov    -0x888(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    -0x830(%rbp,%rax,8),%rdx
  mov    -0x8a0(%rbp),%rcx
  mov    -0x888(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  mov    $0x1,%esi
  mov    %eax,%ecx
  shl    %cl,%rsi
  mov    -0x8a0(%rbp),%rcx
  mov    -0x888(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  shr    $0x6,%al
  movzbl %al,%eax
  or     %rsi,%rdx
  mov    %rdx,-0x830(%rbp,%rax,8)
  mov    -0x8a0(%rbp),%rdx
  mov    -0x888(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x888(%rbp),%rdx
  add    $0x1,%rdx
  cltq
  mov    %rdx,-0x810(%rbp,%rax,8)
  addq   $0x1,-0x888(%rbp)
L125:
  mov    -0x8a0(%rbp),%rdx
  mov    -0x888(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L282
  mov    -0x898(%rbp),%rdx
  mov    -0x888(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L227
L282:
  mov    -0x8a0(%rbp),%rdx
  mov    -0x888(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L98
  mov    $0x0,%eax
  jmp    L276
L98:
  movq   $0xffffffffffffffff,-0x880(%rbp)
  movq   $0x0,-0x878(%rbp)
  movq   $0x1,-0x868(%rbp)
  mov    -0x868(%rbp),%rax
  mov    %rax,-0x870(%rbp)
  jmp    L394
L411:
  mov    -0x880(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8a0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x878(%rbp),%rcx
  mov    -0x870(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8a0(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L100
  mov    -0x870(%rbp),%rax
  cmp    -0x868(%rbp),%rax
  jne    L281
  mov    -0x868(%rbp),%rax
  add    %rax,-0x878(%rbp)
  movq   $0x1,-0x870(%rbp)
  jmp    L394
L281:
  addq   $0x1,-0x870(%rbp)
  jmp    L394
L100:
  mov    -0x880(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8a0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x878(%rbp),%rcx
  mov    -0x870(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8a0(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jbe    L267
  mov    -0x870(%rbp),%rax
  add    %rax,-0x878(%rbp)
  movq   $0x1,-0x870(%rbp)
  mov    -0x878(%rbp),%rax
  sub    -0x880(%rbp),%rax
  mov    %rax,-0x868(%rbp)
  jmp    L394
L267:
  mov    -0x878(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x878(%rbp)
  mov    %rax,-0x880(%rbp)
  movq   $0x1,-0x868(%rbp)
  mov    -0x868(%rbp),%rax
  mov    %rax,-0x870(%rbp)
L394:
  mov    -0x878(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x888(%rbp)
  ja     L411
  mov    -0x880(%rbp),%rax
  mov    %rax,-0x860(%rbp)
  mov    -0x868(%rbp),%rax
  mov    %rax,-0x848(%rbp)
  movq   $0xffffffffffffffff,-0x880(%rbp)
  movq   $0x0,-0x878(%rbp)
  movq   $0x1,-0x868(%rbp)
  mov    -0x868(%rbp),%rax
  mov    %rax,-0x870(%rbp)
  jmp    L245
L330:
  mov    -0x880(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8a0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x878(%rbp),%rcx
  mov    -0x870(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8a0(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L212
  mov    -0x870(%rbp),%rax
  cmp    -0x868(%rbp),%rax
  jne    L338
  mov    -0x868(%rbp),%rax
  add    %rax,-0x878(%rbp)
  movq   $0x1,-0x870(%rbp)
  jmp    L245
L338:
  addq   $0x1,-0x870(%rbp)
  jmp    L245
L212:
  mov    -0x880(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8a0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x878(%rbp),%rcx
  mov    -0x870(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8a0(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jae    L243
  mov    -0x870(%rbp),%rax
  add    %rax,-0x878(%rbp)
  movq   $0x1,-0x870(%rbp)
  mov    -0x878(%rbp),%rax
  sub    -0x880(%rbp),%rax
  mov    %rax,-0x868(%rbp)
  jmp    L245
L243:
  mov    -0x878(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x878(%rbp)
  mov    %rax,-0x880(%rbp)
  movq   $0x1,-0x868(%rbp)
  mov    -0x868(%rbp),%rax
  mov    %rax,-0x870(%rbp)
L245:
  mov    -0x878(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x888(%rbp)
  ja     L330
  mov    -0x880(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x860(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,%rdx
  jbe    L265
  mov    -0x880(%rbp),%rax
  mov    %rax,-0x860(%rbp)
  jmp    L209
L265:
  mov    -0x848(%rbp),%rax
  mov    %rax,-0x868(%rbp)
L209:
  mov    -0x860(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8a0(%rbp),%rcx
  mov    -0x868(%rbp),%rax
  add    %rax,%rcx
  mov    -0x8a0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L450
  movq   $0x0,-0x850(%rbp)
  mov    -0x888(%rbp),%rax
  sub    -0x860(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x860(%rbp),%rax
  cmp    %rax,%rdx
  cmovae %rdx,%rax
  add    $0x1,%rax
  mov    %rax,-0x868(%rbp)
  jmp    L188
L450:
  mov    -0x888(%rbp),%rax
  sub    -0x868(%rbp),%rax
  mov    %rax,-0x850(%rbp)
L188:
  movq   $0x0,-0x858(%rbp)
  mov    -0x898(%rbp),%rax
  mov    %rax,-0x890(%rbp)
L303:
  mov    -0x890(%rbp),%rax
  sub    -0x898(%rbp),%rax
  cmp    %rax,-0x888(%rbp)
  jbe    L179
  mov    -0x888(%rbp),%rax
  or     $0x3f,%rax
  mov    %rax,-0x840(%rbp)
  mov    -0x840(%rbp),%rdx
  mov    -0x890(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memchr@plt>
  mov    %rax,-0x838(%rbp)
  cmpq   $0x0,-0x838(%rbp)
  je     L324
  mov    -0x838(%rbp),%rax
  mov    %rax,-0x890(%rbp)
  mov    -0x890(%rbp),%rax
  sub    -0x898(%rbp),%rax
  cmp    %rax,-0x888(%rbp)
  jbe    L179
  mov    $0x0,%eax
  jmp    L276
L324:
  mov    -0x840(%rbp),%rax
  add    %rax,-0x890(%rbp)
L179:
  mov    -0x888(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x898(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    -0x830(%rbp,%rax,8),%rdx
  mov    -0x888(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x898(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  and    $0x1,%eax
  test   %rax,%rax
  je     L275
  mov    -0x888(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x898(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  cltq
  mov    -0x810(%rbp,%rax,8),%rdx
  mov    -0x888(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,-0x870(%rbp)
  cmpq   $0x0,-0x870(%rbp)
  je     L172
  cmpq   $0x0,-0x850(%rbp)
  je     L0
  cmpq   $0x0,-0x858(%rbp)
  je     L0
  mov    -0x870(%rbp),%rax
  cmp    -0x868(%rbp),%rax
  jae    L0
  mov    -0x888(%rbp),%rax
  sub    -0x868(%rbp),%rax
  mov    %rax,-0x870(%rbp)
L0:
  mov    -0x870(%rbp),%rax
  add    %rax,-0x898(%rbp)
  movq   $0x0,-0x858(%rbp)
  jmp    L323
L275:
  mov    -0x888(%rbp),%rax
  add    %rax,-0x898(%rbp)
  movq   $0x0,-0x858(%rbp)
  jmp    L323
L172:
  mov    -0x860(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x858(%rbp),%rax
  cmp    %rdx,%rax
  cmovb  %rdx,%rax
  mov    %rax,-0x870(%rbp)
  jmp    L12
L63:
  addq   $0x1,-0x870(%rbp)
L12:
  mov    -0x8a0(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L460
  mov    -0x8a0(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x898(%rbp),%rcx
  mov    -0x870(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L63
L460:
  mov    -0x8a0(%rbp),%rdx
  mov    -0x870(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L61
  mov    -0x870(%rbp),%rax
  sub    -0x860(%rbp),%rax
  add    %rax,-0x898(%rbp)
  movq   $0x0,-0x858(%rbp)
  jmp    L323
L61:
  mov    -0x860(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x870(%rbp)
  jmp    L238
L406:
  subq   $0x1,-0x870(%rbp)
L238:
  mov    -0x870(%rbp),%rax
  cmp    -0x858(%rbp),%rax
  jbe    L107
  mov    -0x870(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x8a0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x870(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x898(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L406
L107:
  mov    -0x870(%rbp),%rax
  cmp    -0x858(%rbp),%rax
  ja     L400
  mov    -0x898(%rbp),%rax
  jmp    L276
L400:
  mov    -0x868(%rbp),%rax
  add    %rax,-0x898(%rbp)
  mov    -0x850(%rbp),%rax
  mov    %rax,-0x858(%rbp)
L323:
  jmp    L303
L276:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L409
  call   <__stack_chk_fail@plt>
L409:
  leave
  ret
```

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