user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  lea    D62(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D21(%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     L129
L114:
  xor    %r13d,%r13d
  lea    D76(%rip),%r15
  jmp    L49
  nopl   0x0(%rax)
L142:
  mov    0x0(%rbp,%r13,4),%edx
  mov    %r14d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%r13
  call   <printf@plt>
L49:
  mov    %rbx,%rdi
  mov    %r13d,%r14d
  call   <strlen@plt>
  cmp    %r13d,%eax
  jg     L142
  mov    $0xa,%edi
  call   <putchar@plt>
  test   %r12d,%r12d
  jle    L58
  mov    $0x54,%edx
  mov    $0x54,%eax
  xor    %r15d,%r15d
  xor    %ecx,%ecx
  lea    D75(%rip),%rdi
  jmp    L55
  nopl   (%rax)
L111:
  movslq %r15d,%rax
  cmp    %r15d,0x8(%rsp)
  je     L131
L132:
  test   %r15d,%r15d
  je     L77
  mov    -0x4(%rbp,%rax,4),%r15d
L137:
  cmp    %r12d,%ecx
  jge    L58
  movslq %r15d,%rax
  movslq %ecx,%rdx
L36:
  lea    D62(%rip),%rsi
  movzbl (%rbx,%rax,1),%eax
  movzbl (%rsi,%rdx,1),%edx
L55:
  cmp    %al,%dl
  jne    L111
  add    $0x1,%r15d
  add    $0x1,%ecx
  cmp    %r15d,0x8(%rsp)
  je     L131
  cmp    %ecx,%r12d
  jg     L126
L58:
  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)
L131:
  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    D75(%rip),%rdi
  jmp    L137
  nopl   (%rax)
L77:
  add    $0x1,%ecx
  jmp    L137
L129:
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L114
L126:
  movslq %ecx,%rdx
  lea    D62(%rip),%rsi
  movslq %r15d,%rax
  movzbl (%rsi,%rdx,1),%esi
  cmp    %sil,(%rbx,%rax,1)
  je     L36
  jmp    L132
```

tool_calls: name: retrieve_data
arguments: data_label: D62
type_infered: string
name: retrieve_data
arguments: data_label: D21
type_infered: string
name: retrieve_data
arguments: data_label: D76
type_infered: string
name: retrieve_data
arguments: data_label: D75
type_infered: string
name: retrieve_data
arguments: data_label: D9
type_infered: string

tool: D62: THIS IS A TEST TEXT

tool: D21: TEST

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

tool: D75: 
SUCCESS: Found pattern at %d

tool: D9: 
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);
}
```