user: 请将以下的汇编代码转换成C语言代码:

```asm
<KnuthMorrisPratt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    %ecx,%edx
  setl   %r12b
  cmpb   $0x0,(%rdi)
  je     L95
  test   %r12b,%r12b
  jne    L95
L106:
  cmpb   $0x0,(%rbx)
  je     L198
  test   %r15d,%r15d
  je     L198
L260:
  lea    0x1(%r15),%ecx
  mov    %rsp,%rsi
  movslq %ecx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L160
L269:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L269
L160:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L246
L229:
  mov    %ecx,-0x44(%rbp)
  mov    %rsp,%r12
  test   %r15d,%r15d
  js     L13
  movslq %r15d,%rax
  xor    %esi,%esi
  mov    %r12,%rdi
  lea    0x4(,%rax,4),%rdx
  call   <memset@plt>
  cmp    $0x1,%r15d
  mov    -0x44(%rbp),%ecx
  jle    L13
  mov    %ecx,%edi
  mov    $0x2,%esi
  nopl   0x0(%rax,%rax,1)
L91:
  mov    (%r12,%rsi,4),%eax
  movzbl -0x1(%rbx,%rsi,1),%ecx
  test   %eax,%eax
  jg     L46
  jmp    L297
  nopw   0x0(%rax,%rax,1)
L300:
  mov    (%r12,%rdx,4),%eax
  test   %eax,%eax
  jle    L297
L46:
  movslq %eax,%rdx
  cmp    %cl,(%rbx,%rdx,1)
  jne    L300
L168:
  add    $0x1,%eax
  mov    %eax,(%r12,%rsi,4)
L170:
  add    $0x1,%rsi
  cmp    %rdi,%rsi
  jne    L91
L13:
  xor    %ecx,%ecx
  xor    %edx,%edx
  lea    D22(%rip),%rdi
  test   %r13d,%r13d
  jg     L155
  jmp    L39
  xchg   %ax,%ax
L101:
  test   %ecx,%ecx
  jle    L54
  mov    (%r12,%rsi,4),%ecx
L143:
  cmp    %edx,%r13d
  jle    L39
L155:
  movslq %ecx,%rsi
  movslq %edx,%rax
  movzbl (%rbx,%rsi,1),%r9d
  cmp    %r9b,(%r14,%rax,1)
  jne    L101
  add    $0x1,%ecx
  lea    0x1(%rdx),%r8d
  cmp    %ecx,%r15d
  je     L272
  mov    %r8d,%edx
  cmp    %edx,%r13d
  jg     L155
L39:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L109
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L198:
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L260
L95:
  lea    D41(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  cmpb   $0x0,(%r14)
  lea    D41(%rip),%rdi
  je     L3
  test   %r12b,%r12b
  je     L106
L3:
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L106
  nop
L297:
  movslq %eax,%rdx
  cmp    %cl,(%rbx,%rdx,1)
  jne    L170
  jmp    L168
  nopl   0x0(%rax)
L54:
  add    $0x1,%edx
  jmp    L143
L272:
  sub    %r15d,%edx
  xor    %eax,%eax
  mov    %ecx,-0x44(%rbp)
  lea    0x1(%rdx),%esi
  mov    %r8d,-0x48(%rbp)
  call   <printf@plt>
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%ecx
  lea    D22(%rip),%rdi
  jmp    L143
L246:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L229
L109:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D22
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D20
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D41
type_guessed: string

tool: D22: Pattern occurs with shift %d


tool: D20: Pattern with shift 0

tool: D41: Pattern is not found

assistant: ```c
void KnuthMorrisPratt(const char *X, const char *Y, int m, int n) {
  if (*X == '\0' || m < n)
    printf("Pattern is not found");
  if (*X == '\0' || m < n)
    printf("Pattern is not found");
  if (*Y == '\0' || n == 0)
    printf("Pattern with shift 0");
  int alternate[n + 1];
  for (int i = 0; i < n + 1; i++)
    alternate[i] = 0;
  for (int i = 1; i < n; i++) {
    int j = alternate[i + 1];
    while (j > 0 && Y[j] != Y[i])
      j = alternate[j];
    if (j > 0 || Y[j] == Y[i])
      alternate[i + 1] = j + 1;
  }
  for (int i = 0, j = 0; i < m; i++) {
    if (*(X + i) == *(Y + j)) {
      if (++j == n)
        printf("Pattern occurs with shift %d\n", i - j + 1);
    } else if (j > 0) {
      j = alternate[j];
      i--;
    }
  }
}
```