user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  lea    D11(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D14(%rip),%rbx
  sub    $0x18,%rsp
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,%r12d
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,0x8(%rsp)
  call   <_computeLPS@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L120
L158:
  xor    %r13d,%r13d
  lea    D22(%rip),%r15
  jmp    L30
  nopl   0x0(%rax)
L156:
  mov    0x0(%rbp,%r13,4),%edx
  mov    %r14d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%r13
  call   <printf@plt>
L30:
  mov    %rbx,%rdi
  mov    %r13d,%r14d
  call   <strlen@plt>
  cmp    %r13d,%eax
  jg     L156
  mov    $0xa,%edi
  call   <putchar@plt>
  test   %r12d,%r12d
  jle    L157
  mov    $0x54,%edx
  mov    $0x54,%eax
  xor    %r15d,%r15d
  xor    %ecx,%ecx
  lea    D0(%rip),%rdi
  jmp    L78
  nopl   (%rax)
L15:
  movslq %r15d,%rax
  cmp    %r15d,0x8(%rsp)
  je     L81
L31:
  test   %r15d,%r15d
  je     L139
  mov    -0x4(%rbp,%rax,4),%r15d
L60:
  cmp    %r12d,%ecx
  jge    L157
  movslq %r15d,%rax
  movslq %ecx,%rdx
L134:
  lea    D11(%rip),%rsi
  movzbl (%rbx,%rax,1),%eax
  movzbl (%rsi,%rdx,1),%edx
L78:
  cmp    %dl,%al
  jne    L15
  add    $0x1,%r15d
  add    $0x1,%ecx
  cmp    %r15d,0x8(%rsp)
  je     L81
  cmp    %ecx,%r12d
  jg     L151
L157:
  add    $0x18,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <free@plt>
  nopl   0x0(%rax,%rax,1)
L81:
  mov    %ecx,%esi
  xor    %eax,%eax
  mov    %ecx,0xc(%rsp)
  sub    %r15d,%esi
  movslq %r15d,%r15
  call   <printf@plt>
  mov    -0x4(%rbp,%r15,4),%r15d
  mov    0xc(%rsp),%ecx
  lea    D0(%rip),%rdi
  jmp    L60
  nopl   (%rax)
L139:
  add    $0x1,%ecx
  jmp    L60
L120:
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L158
L151:
  movslq %ecx,%rdx
  lea    D11(%rip),%rsi
  movslq %r15d,%rax
  movzbl (%rsi,%rdx,1),%esi
  cmp    %sil,(%rbx,%rax,1)
  je     L134
  jmp    L31
```

tool_calls: name: unpack_data
arguments: data_tag: D11
type_guessed: string
name: unpack_data
arguments: data_tag: D14
type_guessed: string
name: unpack_data
arguments: data_tag: D22
type_guessed: string
name: unpack_data
arguments: data_tag: D0
type_guessed: string
name: unpack_data
arguments: data_tag: D4
type_guessed: string

tool: D11: THIS IS A TEST TEXT

tool: D14: TEST

tool: D22: lsp[%d]:=%d

tool: D0: 
SUCCESS: Found pattern at %d

tool: D4: 
Error: lsp array not allocated 

assistant: ```c
void main() {
  char *txt = "THIS IS A TEST TEXT";
  char *pat = "TEST";
  int *lsp;
  int i = 0, j = 0, str_len = strlen(txt), pat_len = strlen(pat);
  lsp = _computeLPS(pat);
  if (!lsp) {
    printf("\nError: lsp array not allocated ");
    exit(0);
  }
  for (int k = 0; k < strlen(pat); k++) {
    printf("lsp[%d]:=%d", k, lsp[k]);
  }
  printf("\n");
  while (i < str_len) {
    if (pat[j] == txt[i]) {
      j++;
      i++;
    }
    if (j == pat_len) {
      printf("\nSUCCESS: Found pattern at %d", i - j);
      j = lsp[j - 1];
    } else if (i < str_len && pat[j] != txt[i]) {
      if (j != 0) {
        j = lsp[j - 1];
      } else {
        i = i + 1;
      }
    }
  }
  free(lsp);
}
```