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

```asm
<KnuthMorrisPratt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %edx,-0x74(%rbp)
  mov    %ecx,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L130
  mov    -0x74(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jge    L0
L130:
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L0:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L217
  mov    -0x74(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jge    L221
L217:
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L221:
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L170
  cmpl   $0x0,-0x78(%rbp)
  jne    L20
L170:
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L20:
  mov    -0x78(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L33:
  cmp    %rdx,%rsp
  je     L192
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L33
L192:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L134
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L134:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L182
L243:
  mov    -0x40(%rbp),%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  movl   $0x0,(%rax,%rdx,4)
  addl   $0x1,-0x5c(%rbp)
L182:
  mov    -0x78(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jge    L243
  movl   $0x1,-0x58(%rbp)
  jmp    L105
L205:
  mov    -0x58(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,-0x54(%rbp)
  jmp    L110
L27:
  mov    -0x40(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,-0x54(%rbp)
L110:
  cmpl   $0x0,-0x54(%rbp)
  jle    L4
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x58(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x70(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L27
L4:
  cmpl   $0x0,-0x54(%rbp)
  jg     L44
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x58(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x70(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L104
L44:
  mov    -0x58(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x54(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
L104:
  addl   $0x1,-0x58(%rbp)
L105:
  mov    -0x58(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jl     L205
  movl   $0x0,-0x50(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L77
L201:
  mov    -0x50(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x70(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L14
  addl   $0x1,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jne    L193
  mov    -0x50(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L193
L14:
  cmpl   $0x0,-0x4c(%rbp)
  jle    L193
  mov    -0x40(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    %eax,-0x4c(%rbp)
  subl   $0x1,-0x50(%rbp)
L193:
  addl   $0x1,-0x50(%rbp)
L77:
  mov    -0x50(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L201
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D39
type_infered: string
name: unpack_data
arguments: data_tag: D3
type_infered: string
name: unpack_data
arguments: data_tag: D25
type_infered: string

tool: D39: Pattern is not found

tool: D3: Pattern with shift 0

tool: D25: Pattern occurs with shift %d


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